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 is found here: https://bjodah.github.com/pyodesys
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
Optional requirements not listed in requirements.txt:
pygslodeiv2
pyodeint
pycvodes
Source distribution is available here: https://pypi.python.org/pypi/pyodesys
Example
The classic van der Pol oscillator (see examples/van_der_pol.py)
>>> import sympy as sp
>>> import numpy as np
>>> from pyodesys import SymbolicSys
>>> mu = 1.0
>>> y = sp.symarray('y', 2)
>>> f = [y[1], -y[0] + mu*y[1]*(1 - y[0]**2)]
>>> odesys = SymbolicSys(zip(y, f))
>>> out = odesys.integrate('odeint', 10, [1, 0]) # use pyodeint
>>> import matplotlib.pyplot as plt
>>> plt.plot(out[:, 0], out[:, 1:]) # doctest: +SKIP
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.
Source Distribution
File details
Details for the file pyodesys-0.1.1.tar.gz
.
File metadata
- Download URL: pyodesys-0.1.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a398c99690b6ad562332aa432f7339c6fe4b73c383a75ad4d1ad47d8b654ff86 |
|
MD5 | 961c24a4fa129f129e7605245ab4fc11 |
|
BLAKE2b-256 | b8b0fc8d23a061db5f49362f2773d81034f552843f900038a593766a897f7fb9 |