Straightforward numerical integration of ODE systems from SymPy.
Project description
pyodesys provides a straightforward way of numerically integrating systems of ordinary differential equations. It unifies the interface of several libraries. It also provides a convenience class for representing and integrating ODE systems defined by SymPy expressions.
The numerical integration is perfomed using eiher:
Note that implicit steppers which require a user supplied callback for calculating the jacobian is provided automatically by pyodesys.
Documentation
Autogenerated API documentation for latest stable release is found here: https://bjodah.github.io/pyodesys/latest (and the development version for the current master branch are found here: http://hera.physchem.kth.se/~pyodesys/branches/master/html).
Installation
Simplest way to install pyodesys and its (optional) dependencies is to use the conda package manager:
$ conda install -c bjodah pyodesys pytest $ python -m pytest --pyargs pyodesys
alternatively you may also use pip:
$ python -m pip install --user pyodesys[all]
see setup.py for optional requirements.
Example
The classic van der Pol oscillator (see examples/van_der_pol.py)
>>> from pyodesys.symbolic import SymbolicSys
>>> def f(t, y, p):
... return [y[1], -y[0] + p[0]*y[1]*(1 - y[0]**2)]
...
>>> odesys = SymbolicSys.from_callback(f, 2, 1)
>>> xout, yout, info = odesys.integrate(10, [1, 0], [1], integrator='odeint', nsteps=1000)
>>> _ = odesys.plot_result()
>>> import matplotlib.pyplot as plt; plt.show() # doctest: +SKIP
for more examples, see examples/, and rendered jupyter notebooks here: http://hera.physchem.kth.se/~pyodesys/branches/master/examples
License
The source code is Open Source and is released under the simplified 2-clause BSD license. See LICENSE for further details. Contributors are welcome to suggest improvements at https://github.com/bjodah/pyodesys
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.