Skip to main content

dysts

Analyze hundreds of chaotic systems.

Plots of chaotic systems in the collection

Basic Usage

Import a model and run a simulation with default initial conditions and parameter values

from dysts.flows import Lorenz

model = Lorenz()
sol = model.make_trajectory(1000)
# plt.plot(sol[:, 0], sol[:, 1])

Modify a model's parameter values and re-integrate

model = Lorenz()
model.gamma = 1
model.ic = [0.1, 0.0, 5]
sol = model.make_trajectory(1000)
# plt.plot(sol[:, 0], sol[:, 1])

Integrate new trajectories from all 135 chaotic systems with a custom granularity

from dysts.systems import make_trajectory_ensemble

all_out = make_trajectory_ensemble(100, resample=True, pts_per_period=75)

Load a precomputed collection of time series from all 135 chaotic systems

from dysts.datasets import load_dataset

data = load_dataset(subsets="train", data_format="numpy", standardize=True)

Additional functionality and examples can be found in the demonstrations notebook.. The full API documentation can be found here.

A database of precomputed time series from each system is hosted on HuggingFace

Reference

For more information, or if using this code for published work, please consider citing the papers.

William Gilpin. "Chaos as an interpretable benchmark for forecasting and data-driven modelling" Advances in Neural Information Processing Systems (NeurIPS) 2021 https://arxiv.org/abs/2110.05266

William Gilpin. "Model scale versus domain knowledge in statistical forecasting of chaotic systems" Physical Review Research 2023 https://arxiv.org/abs/2303.08011

We are very grateful for any suggestions or contributions. See CONTRIBUTING.md

Installation

Install from PyPI

pip install dysts

See the additional installation guide for more options.

Benchmarks

The benchmarks reported in our publications are stored in a separate benchmarks repository. An overview of the contents of the directory can be found in BENCHMARKS.md within that repository, while individual task areas are summarized in corresponding Jupyter Notebooks within the top level of that directory.

Contents

  • Code to generate benchmark forecasting and training experiments are included in a separate benchmarks repository
  • Pre-computed time series with training and test partitions are included in data
  • The raw definitions metadata for all chaotic systems are included in the database file chaotic_attractors. The Python implementations of differential equations can be found in the flows module

Additional Installation Guide

To obtain the latest version, including new features and bug fixes, download and install the project directly from GitHub

pip install git+https://github.com/williamgilpin/dysts

Test that everything is working

python -m unittest

To install the optional precomputed trajectories and benchmark results (a large, static dataset), install directly from GitHub

pip install git+https://github.com/williamgilpin/dysts_data

Implementation Notes

  • Currently there are 135 continuous time models, including several delay differential equations. There is also a separate module with 10 discrete maps, which is currently being expanded.
  • The right hand side of each dynamical equation is compiled using numba, wherever possible. Ensembles of trajectories are vectorized where needed.
  • Attractor names, default parameter values, references, and other metadata are stored in parseable JSON database files. Parameter values are based on standard or published values, and default initial conditions were generated by running each model until the moments of the autocorrelation function all become stationary.
  • The default integration step is stored in each continuous-time model's dt field. This integration timestep was chosen based on the highest significant frequency observed in the power spectrum, with significance being determined relative to random phase surrogates. The period field contains the timescale associated with the dominant frequency in each system's power spectrum. When using the model.make_trajectory() method with the optional setting resample=True, integration is performed at the default dt. The integrated trajectory is then resampled based on the period. The resulting trajectories will have have consistant dominant timescales across models, despite having different integration timesteps.

Development goals

Acknowledgements

  • Two existing collections of named systems can be found on the webpages of Jürgen Meier and J. C. Sprott. The current version of dysts contains all systems from both collections.
  • Several of the analysis routines (such as calculation of the correlation dimension) use the library nolds. If re-using code that depends on nolds, please be sure to credit that library and heed its license. The Lyapunov exponent calculation is based on the QR factorization approach used by Wolf et al 1985 and Eckmann et al 1986, with implementation details adapted from conventions in the Julia library DynamicalSystems.jl

Metadata

Release files for dysts 0.96

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dysts 0.96
File Size Uploaded
dysts-0.96.tar.gz 26.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dysts 0.96
File Interpreter ABI Platform
dysts-0.96-py3-none-any.whl Python 3 none any Details

Total release size: 52.9 MB

Release files / dysts-0.96.tar.gz

Download URL dysts-0.96.tar.gz
Size 26.4 MB
Tags Source
SHA-256 checksum
How to use checksums
772579ef5abbc3e1c3a863646488b4787032e789cba53f52f4f5210cf22fafc6
BLAKE2b-256 checksum
How to use checksums
19145d41ae77a78435b782ae08e5b5e801699ad0679d424f0bf884078c38e780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / dysts-0.96-py3-none-any.whl

Download URL dysts-0.96-py3-none-any.whl
Size 26.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
17d0106a33e424cd43692a2c7cab72da8784a8726cd277656ac81d9a0ea530a2
BLAKE2b-256 checksum
How to use checksums
43c70f4b3abde6920d96936bf0df44921519201e04617b9a6d65ebec6433a4fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.96 This release

2 release files

0.95

2 release files

0.94

2 release files

0.93

2 release files

0.92

2 release files

0.91

2 release files

0.90

2 release files

0.89

2 release files

0.87

2 release files

0.86

2 release files

0.85

2 release files

0.84

2 release files

0.83

2 release files

0.82

2 release files

0.81

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page