As part of my work at the Lab, I developped two algorithms that when paired with a static stepsize ODE solver produces a more accurate solutin for a system of discontinuous differential equations. The algorithms were presented at the American Geophysics Union conference as a research posted on December 14th 2022.
Given systems of ODEs where the
To resolve this issue without invoking complicated dynamic step size adjusting ODE solvers, we propose (for the lack of any more knowledge about
After partitioning, each interval is further passed through the PolyMC algorithm to determine the appropriate step size (up to a user determined coefficient
I intergrated the two aglorithms and wrote the filegen code to run them by just giving the correct inputs.
User-defined inputs | Type | Deault | Description |
---|---|---|---|
file-path |
str |
N/A | file path |
time |
str |
N/A | time column name in csv file |
raw_data |
str |
N/A | data column in csv file |
min_interval |
int |
N/A | minimum size of a subinterval for IPA given in number of steps |
start |
float/int |
N/A | start of the data set x-values |
end |
float/int |
N/A | end of the data set x-values |
num_steps |
int |
N/A | number of steps between start and end not accounting for steps in csv file |
coef |
float/int |
1 | the coeffieicient for PolyMC step size |
To run it, input the variables into the filegen.py
file's variables section and run it. It'll create a folder with a bunch of csv files (this is the partitioned dataset using IPA.py
) and then it inserts each and every one of these files into polymc.py
to generate a stepsize and return an list of tuples with each files name and the calculated stepsize.
When intergrating with an ODE solver, interpolate the data using scipy
and not pandas
or numpy
as those require a point by point input to return an array while scipy returns a callable function that works on all inputs. (this is optional unless you intend to use the stepsize for a fixed stepsize solver)
The stepsize is mainly intended to be used as an upper bound for autogenerated stepsize solvers like solve_ivp.
To further understand the algorithms please refer to their respective PDF files (Partitionares.pdf
for IPA).