Metadata-Version: 2.4
Name: dynamodels
Version: 0.2.1
Summary: Dynamical-system models with history tracking and pluggable integrators (Lorenz, Van der Pol, Rijke, annular combustor, KS)
Author-email: Andrea Nóvoa <a.novoa@imperial.ac.uk>
License-Expression: MIT
Project-URL: Homepage, https://github.com/andreanovoa/dynamodels
Project-URL: Repository, https://github.com/andreanovoa/dynamodels
Project-URL: Issues, https://github.com/andreanovoa/dynamodels/issues
Keywords: dynamical-systems,chaos,thermoacoustics,reduced-order-modelling
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib<4.0,>=3.9
Requires-Dist: multiprocess>=0.70
Requires-Dist: numpy<3.0,>=2.0
Requires-Dist: scipy<2.0,>=1.13
Requires-Dist: typeguard
Provides-Extra: dev
Requires-Dist: pytest>=8.4; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# dynamodels

[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.21843588-blue.svg)](https://doi.org/10.5281/zenodo.21843588)
[![PyPI](https://img.shields.io/pypi/v/dynamodels)](https://pypi.org/project/dynamodels/)

Dynamical-system models with pre-allocated history tracking and pluggable time
integrators — the modelling core split out of
[romda](https://github.com/andreanovoa/real-time-bias-aware-DA) so it can be
reused on its own. Torch-free; depends only on numpy, scipy, matplotlib,
typeguard and multiprocess.

Tutorial: [`tutorial_dynamodels.ipynb`](tutorial_dynamodels.ipynb) | Interface
documentation: [model protocol](https://andreanovoa.github.io/ntsa/protocol/)

## Install

```bash
pip install dynamodels
```

## Quickstart

```python
from dynamodels.physical import Lorenz63

model = Lorenz63(rho=28., dt=0.01)
psi, t = model.time_integrate(Nt=1000)   # (Nt, Nphi, m) states, (Nt,) times
model.update_history(psi, t)
y = model.get_observable_hist()          # (Nt, Nq, m) observables
model.visualize_history()
model.close()                            # release the integrator's pool
```

A model composes a `HistoryTracker` (state/time buffer behind `hist`, `hist_t`,
`update_history()`) with an `Integrator` strategy; subclasses supply
`obs_labels` plus either `time_derivative(t, psi, **params)` (continuous) or
`time_step(Nt)` (discrete map). `m`-member ensembles are supported natively
(`init_ensemble`). Included physical models (`dynamodels.physical`): `Lorenz63`,
`Lorenz96`, `VdP`, `Rijke`, `Annular`, `KS` — the `lorenz63`, `lorenz96` and `rijke`
modules carry measured dominant-Lyapunov tables (module-level `_LAM1_MEASURED`;
`_LAM1_MEASURED_NX10` for Lorenz96) from which instances set `t_lyap`.

## Ecosystem

- [`ntsa`](https://github.com/andreanovoa/ntsa) — nonlinear time-series analysis
  for any dynamodels-style model ([docs](https://andreanovoa.github.io/ntsa/)).
- [romda](https://github.com/andreanovoa/real-time-bias-aware-DA) — bias-aware
  ensemble data assimilation built on top.

## Development

```bash
pip install -e ".[dev]"
python -m pytest tests/
ruff check dynamodels/ tests/
```

Releases: bump `version` in `pyproject.toml`, then `git tag vX.Y.Z && git push --tags`
(publishes to PyPI).

## License

MIT
