Metadata-Version: 2.4
Name: sindy-exp
Version: 0.2.2
Summary: A basic library for constructing dynamics experiments
Author-email: Jake Stevens-Haas <jacob.stevens.haas@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Jacob Stevens-Haas
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/Jake-Stevens-Haas/gen-experiments
Keywords: Machine Learning,Science,Mathematics,Experiments
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib
Requires-Dist: numpy>=2.0.0
Requires-Dist: seaborn
Requires-Dist: scipy
Requires-Dist: sympy
Requires-Dist: dysts
Provides-Extra: jax
Requires-Dist: jax[cuda12]; extra == "jax"
Requires-Dist: diffrax; extra == "jax"
Requires-Dist: sympy2jax; extra == "jax"
Requires-Dist: typing_extensions; extra == "jax"
Provides-Extra: dev
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest>=6.0.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: flake8-comprehensions>=3.1.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: codecov; extra == "dev"
Requires-Dist: tomli; extra == "dev"
Requires-Dist: pysindy>=2.1.0; extra == "dev"
Dynamic: license-file

# Dynamics Experiments

A library for constructing dynamics experiments.
This includes data generation and plotting/evaluation.

## Getting started

It's not yet on PyPI, so install it with `pip install sindy_exp @ git+https://github.com/Jacob-Stevens-Haas/sindy-experiments`

Generate data

    data = sindy_exp.data.gen_data("lorenz", num_trajectories=5, t_end=10.0, dt=0.01)["data]

Evaluate your SINDy-like model with:

    sindy_exp.odes.fit_eval(model, data)

![Coefficient plots](images/coeff.png)

A list of available ODE systems can be found in `ODE_CLASSES`, which includes most
of the systems from the [dysts package](https://pypi.org/project/dysts/) as well as some non-chaotic systems.

## ODE representation

We deal primarily with autonomous ODE systems of the form:

    dx/dt = sum_i f_i(x)

Thus, we represent ODE systems as a list of right-hand side expressions.
Each element is a dictionary mapping a term (Sympy expression) to its coefficient.

## Other useful imports, compatibility, and extensions

This is built to be compatible with dynamics learning models that follow the
pysindy _BaseSINDy interface.
The experiments are also built to be compatible with the `mitosis` tool,
an experiment runner.
To integrate your own experiments or data generation in a way that is compatible,
see the `ProbData` and `DynamicsTrialData` classes.
For plotting tools, see `plot_coefficients`, `compare_coefficient_plots_from_dicts`,
`plot_test_trajectory`, `plot_training_data`, and `COLOR`.
For metrics, see `coeff_metrics`, `pred_metrics`, and `integration_metrics`.

![3d plot](images/composite.png)
![1d plot](images/1d.png)
