Installation
odecast requires Python 3.10 or later.
pip install odecast
This also installs the required dependencies NumPy, SciPy and SymPy.
Plotting (sol.plot(), the example scripts and Examples) uses
Matplotlib, and sol.to_pandas() uses pandas. Both are available as an
extra:
pip install "odecast[examples]"
Partial differential equations (Partial differential equations) need findiff:
pip install "odecast[pde]"
From source
git clone https://github.com/maroba/odecast.git
cd odecast
pip install -e .
For development, use the dev extra, which adds pytest, pytest-cov, Ruff,
Black, Matplotlib, pandas and findiff:
pip install -e ".[dev]"
Checking the installation
import odecast
from odecast import var, Eq, solve
print(odecast.__version__)
y = var("y")
sol = solve(Eq(y.d() + y, 0), ivp={y: 1.0}, tspan=(0, 1))
print(sol[y][-1]) # approximately exp(-1) = 0.3679