The ODES scikit for ordinary differential and algebraic equations, an extension to scipy
Jupyter Notebook Fortran Python Makefile Batchfile Shell
Clone or download
bmcage Merge pull request #74 from aragilar/use_setuptools
Multi-precision support + automatic installation of numpy and cython
Latest commit 09778ec May 17, 2018
Permalink
Failed to load latest commit information.
apidocs Improve CI and documentation for multiple precisions Apr 26, 2018
ci_support Improve CI and documentation for multiple precisions Apr 26, 2018
docs Update release instructions caused by recent changes. Feb 7, 2018
ipython_examples New sphinx doc system Jul 13, 2017
paper Fix some minor paper stuff for acceptance Feb 14, 2018
scikits Add multi-precision logic to cython (no setup.py support yet) Apr 26, 2018
.gitignore Add setup.py support for multi-precision Apr 26, 2018
.travis.yml Add CI support for multi-precision Apr 26, 2018
CONTRIBUTING.md PR #46, Community guidelines must be added to address JOSS requirements Feb 17, 2017
LICENSE.txt legal stuff added Jan 27, 2012
MANIFEST.in Move from recursive setup.py to standard python setup.py Apr 26, 2018
README.md reset as development branch with new DOI Feb 22, 2018
common.py Move from recursive setup.py to standard python setup.py Apr 26, 2018
github_deploy_key_aragilar_odes.enc Use doctr to build apidocs Dec 20, 2017
github_deploy_key_bmcage_odes.enc change repo to bmcage\odes Jan 5, 2018
pyproject.toml Add PEP 518 (i.e. pyproject.toml) support May 31, 2017
setup.cfg Add check-manifest and check-readme to tox Jun 6, 2017
setup.py Move from recursive setup.py to standard python setup.py Apr 26, 2018
setup_build.py Add setup.py support for multi-precision Apr 26, 2018
tox.ini Move from recursive setup.py to standard python setup.py Apr 26, 2018
upload_api_docs.sh Skip running doctr as needed so CI doesn't always fail Mar 24, 2018

README.md

Documentation Status Build Status Version License Supported versions Supported implementations PyPI

DOI

ODES is a scikit for Python 2.7 and 3.3-3.5 offering extra ode/dae solvers, as an extension to what is available in scipy. The documentation is available at Read The Docs, and API docs can be found at https://bmcage.github.io/odes.

Available solvers:

ODES provides interfaces to the following solvers:

  • BDF linear multistep method for stiff problems (CVODE and IDA from SUNDIALS)
  • Adams-Moulton linear multistep method for nonstiff problems (CVODE and IDA from SUNDIALS)
  • Explicit Runge-Kutta method of order (4)5 with stepsize control (dopri5 from scipy.integrate)
  • Explicit Runge-Kutta method of order 8(5,3) with stepsize control (dop853 from scipy.integrate)
  • Historical solvers: lsodi and ddaspk are available for comparison reasons. Use IDA instead!

Usage

A simple example solving the Van der Pol oscillator is as follows:

import matplotlib.pyplot as plt
import numpy as np
from scikits.odes import ode

t0, y0 = 1, np.array([0.5, 0.5])  # initial condition
def van_der_pol(t, y, ydot):
    """ we create rhs equations for the problem"""
    ydot[0] = y[1]
    ydot[1] = 1000*(1.0-y[0]**2)*y[1]-y[0]

solution = ode('cvode', van_der_pol, old_api=False).solve(np.linspace(t0,500,200), y0)
plt.plot(solution.values.t, solution.values.y[:,0], label='Van der Pol oscillator')
plt.show()

For simplicity there is also a convenience function odeint wrapping the ode solver class. See the User Guide for a simple example for odeint, as well as simple examples for object orientated interfaces and further examples using ODES solvers.

Projects that use odes

You can learn by example from following code that uses ODES:

  • Centrifuge simulation, a wrapper around the ida solver: see centrifuge-1d

You have a project using odes? Do a pull request to add your project.