Ordinary differential equation zoo
Project description
diffeqzoo
So, what was the initial condition of the restricted three-body problem again?
diffeqzoo
delivers all differential equation test problems in one place. It works with numpy and jax.
Features include
- Standard non-stiff benchmark problems (Lotka--Volterra, FitzHugh--Nagumo, Van-der-Pol, rigid-body, ...)
- Standard stiff benchmark problems (HIRES, ROBER, ...)
- Compartmental epidemiological models (SIR, SEIR, SIRD, ...)
- Chaotic systems (Lorenz63, Lorenz96, ...)
- N-Body problems
- Boundary value problems
As well as
- Flexibly NumPy and JAX-backends. Other than one of those two, there are 0 (zero!) dependencies.
- Mathematical descriptions and BibTex entries of the ODE problems
- Compatibility with all NumPy/JAX-based ODE solvers: SciPy, JAX, Diffrax, ProbNum, Tornadox, etc..
and many more goodies.
- DOCUMENTATION: (todo: add link)
- ISSUE TRACKER: click here
Quick example
>>> from diffeqzoo import ivps, backend
>>> backend.select("numpy")
>>>
>>> # Create test problems like this
>>> f, u0, t_span, f_args = ivps.lotka_volterra()
>>> x = f(u0, *f_args)
>>> print(x)
[-10. 10.]
>>>
>>> # The numpy backend determines the type of input/output
>>> print(type(x))
<class 'numpy.ndarray'>
>>>
>>> # All sorts of ODEs are available, e.g., Rigid-Body:
>>> f, u0, t_span, f_args = ivps.rigid_body()
>>> print(f(u0, *f_args))
[-0. 1.125 -0. ]
>>>
>>> ## make it jax
>>> backend.change_to("jax")
>>> f, u0, t_span, f_args = ivps.rigid_body()
>>> x = f(u0, *f_args)
>>> print(x)
[-0. 1.125 -0. ]
>>> print(type(x))
<class 'jaxlib.xla_extension.DeviceArray'>
Related work
- F. Mazzia et al. published a for Matlab and Fortran.
There is a similar . Neither one offers Python code, and both also run benchmarks, which
diffeqzoo
does not care about at all. - E. Hairer et al. published their , but there is no Python code
- hosts datasets of nonlinear dynamical system observations. They are quite specialised problems, and don't contain the textbook problems like Lotka-Volterra, van der Pol, etc..
- DifferentialEquations.jl provides in Julia.
- offers a similar set of problems to
diffeqzoo
(no surprise -- the set of authors intersects) but tied to ProbNum's ODE solver interface.diffeqzoo
is less of an API, switches more flexibly between numpy and jax (at the time of developing), and contains more problems.
Anything missing in this list? Please open an issue or make a pull request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
diffeqzoo-0.0.1-py3-none-any.whl
(18.7 kB
view hashes)
Close
Hashes for diffeqzoo-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bd948ed78f99d7b44be5e461141b2d777932ff69523fb5efdd7bdb8b3e2ecd4 |
|
MD5 | 2daa2fe225783d29f26c1bae441651de |
|
BLAKE2b-256 | 38b0633cfb0d7fd2427685e032fb2b780d7d35231652b3224ab96547ab0b432d |