Skip to content

Dynamical systems & chaos analysis in Python

TSDynamics

Simulate and analyse dynamical systems with fast compiled solvers, expressive plots and 177 built-in models. Start with a known system or define your own equations.

pip install "tsdynamics[viz]"

Using TSDynamics in research? Cite the library with its DOI and BibTeX entry.

Live attractor drag to rotate
A Lorenz trajectory traces the two lobes of its butterfly-shaped attractor
Static preview of the Lorenz attractor
Lorenz trajectory state
Simulation

Compiled solvers, Python equations

Run flows, maps, delay equations and stochastic models from Python. The compiled Rust engine ships in the package, so installing a prebuilt wheel needs no compiler. Ordinary parameter sweeps reuse the compiled equations.

Models

177 systems to explore

From Lorenz and Hénon to delay feedback and spatial fields. Browse equations, parameter meanings, plots and references together, then copy the example into your own work.

Analysis

From trajectories to measurements

Measure stability, chaos, recurrence and attractor geometry. Results carry their settings and provide plots. Each analysis explains its supported inputs and the assumptions behind the answer.

Simulate, plot, analyse

Run a model, inspect its trajectory and estimate its Lyapunov spectrum with the same system definition.

Python
import tsdynamics as ts

model = ts.systems.Lorenz(ic=[1, 1, 1])
trajectory = model.run(final_time=100, dt=0.01)
ts.plot(trajectory).save("lorenz.png")

spectrum = ts.analysis.lyapunov_spectrum(
    model, final_time=500, dt=0.05
)
print(spectrum)
print(spectrum.kaplan_yorke)
Lorenz phase portrait beside the three component time series
One trajectory, two useful views: the geometry in state space and each component evolving in time.

Follow the first-trajectory guide →

Study the dynamics

Explore parameter changes, stability and the geometry of attraction.

Choose a starting point