Skip to content

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

License

Notifications You must be signed in to change notification settings

rubentium/ESBMTK_ODE_Algos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESBMTK_ODE_Algos

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 $i$-th equation is of the form $\dfrac{dy_i}{dt}=f(y_1,\ldots, y_n, \omega, t)$ where $\omega$ is a time-dependent variable whose values are not influenced by the model and the values of $\omega$ may not continuously defined for $t$. Thus the function $f$ at some $t_0$ may be different from the same function at some $t_1$. ODE solvers with a static step size cannot account for such changes and neither can most dynamic ODE solvers as those assume that the equations within the system do not change.

To resolve this issue without invoking complicated dynamic step size adjusting ODE solvers, we propose (for the lack of any more knowledge about $\omega$) to linearly interpolate the data set and to partition the data set into smaller data sets using the IPA with a general linear pattern up to the standard deviation. The algorithm is designed to not react to rapid spikes and subsequent falls in the $\omega$ values as they do not have as much of an impact on the general solution as the steady rise or fall does.

After partitioning, each interval is further passed through the PolyMC algorithm to determine the appropriate step size (up to a user determined coefficient $k$) which accounts for how volatile the general data is. It, just like the previous algorithm, is designed to not give too much weight to sudden spikes and drops in $\omega$ values.

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).

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages