Metadata-Version: 2.4
Name: pydiffsol
Version: 0.4.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: numpy
Requires-Dist: diffrax ; extra == 'bench'
Requires-Dist: casadi ; extra == 'bench'
Requires-Dist: numpy ; extra == 'bench'
Requires-Dist: pandas ; extra == 'bench'
Requires-Dist: matplotlib ; extra == 'bench'
Requires-Dist: jax<0.7.0 ; extra == 'bench'
Requires-Dist: matplotlib ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: json5 ; extra == 'dev'
Requires-Dist: docutils ; extra == 'dev'
Requires-Dist: markdown-it-py ; extra == 'dev'
Provides-Extra: bench
Provides-Extra: dev
License-File: LICENSE
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# pydiffsol

Python bindings for [diffsol](https://github.com/martinjrobins/diffsol)

- **Documentation:** [https://pydiffsol.readthedocs.io/en/latest](https://pydiffsol.readthedocs.io/en/latest)
- **Source code:** [https://github.com/alexallmont/pydiffsol](https://github.com/alexallmont/pydiffsol)

## Example usage

```py
import pydiffsol as ds
import numpy as np

# DiffSl code and matrix type specified in constructor
# Defaults to f64 BDF solver unless specified
ode = ds.Ode(
    """
    in { r = 1.0 }
    k { 1.0 }
    u { 0.1 }
    F { r * u * (1.0 - u / k) }
    """,
    ds.nalgebra_dense
)

# Solve up to t = 0.4, overriding r input param = 2.0
params = np.array([2.0])
solution = ode.solve(params, 0.4)
print(solution.ys, solution.ts)

# Above defaults to bdf. Try esdirk34 instead
ode.method = ds.esdirk34
solution = ode.solve(params, 0.4)
print(solution.ys, solution.ts)
```
