Skip to content

MicheleCeresoli/odepy

Repository files navigation

odepy

An extremely fast propagator for Python, in Python.

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Stable Docs Build Status codecov License: GPL v3

This is a small suite of Ordinary Differential Equations (ODEs) Runge-Kutta solvers for Python that leverages Numba to minimise integration times, outperforming well established libraries like SciPy. Additionally, odepy's integrator capability to be called within numba-decorated functions allows the optimisation and decoration of much larger portion of code.

Installation

You can install odepy from PyPI:

pip install odepy

odepy runs on Python 3.7+ and only requires NumPy, SciPy and Numba. However, it cannot be installed on Python 3.11 until official support for Numba is released for that Python version.

Features

This package has been designed to maximise performance and flexibility. This is achieved by optimising and extending some of Scipy's built-in features, including:

  • H. A. Watts' initial step size selection [1]
  • Horner's rule for dense output polynomial evaluation [2]
  • In-place vector and matrices computations

Advanced stepsize controllers can be enabled for all odepy's solvers, including:

  • Integral Controller: the standard proportional control algorithm, adopted by SciPy.
  • PI Controller: second order proportional-integral controllers with improved stability properties [3-4]
  • PID Controller: further improves the stability and efficiency properties of PI Controllers [5-6]

For a list of all the available controllers, please refer to the Stepsize control documentation.

Additionally, each of the available Runge-Kutta solvers comes with a dedicated dense output interpolant:

  • BS5 - Bogacki-Shampine 5/4 method (lazy 5th order interpolant).
  • DOP853 - Hairer's 8/5/3 adaptation of the Dormand-Prince method (7th order interpolant)
  • Vern7 - Verner's "Most Efficient" 7/6 method (lazy 6th order interpolant).
  • Vern8 - Verner's "Most Efficient" 8/7 method (lazy 7th order interpolant).
  • Vern9 - Verner's "Most Efficient" 9/8 method (lazy 8th order interpolant).

For further details on these algorithms, see the stable documentation.

Customisation

You can easily extend odepy's built-in methods and stepsize controllers by defining your own Runge-Kutta tableau and set of control coefficients. Check out the tutorials to start enjoying the full flexibility of this package.

Documentation

Please refer to the documentation for additional information.

Supporting

The software was developed as part of academic research by Michele Ceresoli and Andrea Pasquale. If you found this package useful, please consider starring the repository.

About

An extremely fast propagator for Python, in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages