Skip to main content

Zero-warmup Rust-engine ODE/DDE/SDE integration, discrete maps, and chaos analysis for dynamical systems.

Project description

TSDynamics

Python CI Release Docs PyPI

Dynamical systems in Python: 149 built-in systems, a native Rust integration engine, and chaos analysis — with the simplest system-definition contract anywhere.

You write the math (one symbolic method); TSDynamics lowers it to a native Rust engine and handles integration, Lyapunov spectra, bifurcation diagrams, Poincaré sections, and even the documentation page for your system.

import tsdynamics as ts

lor = ts.Lorenz()
traj = lor.integrate(final_time=100.0, dt=0.01)
traj["x"]                              # named component access
lor.lyapunov_spectrum()                # → [0.91, ~0, -14.57]
ts.kaplan_yorke_dimension(_)           # → ~2.06

📖 Documentation: https://el3ssar.github.io/TSDynamics/


Highlights

  • Three families, one interface — ODEs, delay-differential equations (including DDE Lyapunov spectra), and discrete maps, all running on the same native Rust engine. All implement one stepping protocol, so every analysis tool works on every system.
  • 149 built-in systems with literature parameters: Lorenz, Rössler, Chua, 21 Sprott flows, Mackey–Glass, Hénon, ... each with an auto-generated docs page showing its equations and attractor.
  • Native engine, zero warmup — equations lower to a Rust engine (an SSA-tape interpreter, with a Cranelift JIT alongside) in-process; parameters are runtime control values, so changing them is free and there is no compile step or cache.
  • Composition — a PoincareMap of a flow is a discrete map, so orbit_diagram(PoincareMap(Rossler(), (1, 0.0)), "c", values) draws the bifurcation diagram of a flow with one line.
  • Analysis toolkit — orbit/bifurcation diagrams, Poincaré sections (root-refined), maximal Lyapunov exponent without Jacobians, Kaplan–Yorke dimension, fixed points with stability.

Install

pip install tsdynamics            # or: uv add tsdynamics

A prebuilt abi3 wheel (manylinux / musllinux / macOS / Windows) bundles the native Rust engine, so no Rust toolchain and no C compiler are needed to install or run. Building from the sdist needs a Rust toolchain (the build backend is maturin).

Optional extra: tsdynamics[plot] (matplotlib).

Define your own system

import tsdynamics as ts

class MySystem(ts.ContinuousSystem):
    params = {"a": 0.2, "b": 0.2, "c": 5.7}
    dim = 3
    variables = ("x", "y", "z")            # optional niceties

    @staticmethod
    def _equations(y, t, *, a, b, c):
        x, yv, z = y(0), y(1), y(2)
        return (-yv - z, x + a * yv, b + z * (x - c))

That's the whole contract. The class auto-registers: the bulk test-suite sweeps it, and the docs build renders its equations (LaTeX, straight from the symbolics) and its attractor figure — zero extra steps. Delay systems use y(0, t - tau); maps implement _step/_jacobian (signature order is validated at import).

A taste of the analysis layer

import numpy as np
import tsdynamics as ts

# Bifurcation diagram of the logistic map
od = ts.orbit_diagram(ts.Logistic(), "r", np.linspace(2.5, 4.0, 600))
x, y = od.flat()

# Poincaré section of the Rössler attractor (root-refined crossings)
section = ts.poincare_section(ts.Rossler(), plane=(1, 0.0), n=500)

# Fixed points of the Hénon map, with stability
ts.fixed_points(ts.Henon())
# [FixedPoint([-1.131354  -0.339406], unstable, ...),
#  FixedPoint([ 0.631354   0.189406], unstable, ...)]

# Maximal Lyapunov exponent, no Jacobian needed
ts.max_lyapunov(ts.Lorenz(ic=[1, 1, 1]), dt=0.05)    # ≈ 0.91

Development

git clone https://github.com/El3ssar/TSDynamics && cd TSDynamics
uv sync --group dev --group docs
uv run pytest -m "not slow" --no-cov     # fast tier
uv run pytest --no-cov                   # full local suite
TSD_DOCS_FIGURES=0 uv run mkdocs serve   # docs preview

Releases are automated: conventional-commit PR titles drive semantic-release on merge — see CONTRIBUTING.

License

MIT © Daniel Estevez

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsdynamics-3.2.0.tar.gz (563.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tsdynamics-3.2.0-cp312-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ x86-64

tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

tsdynamics-3.2.0-cp312-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.2.0-cp312-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file tsdynamics-3.2.0.tar.gz.

File metadata

  • Download URL: tsdynamics-3.2.0.tar.gz
  • Upload date:
  • Size: 563.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tsdynamics-3.2.0.tar.gz
Algorithm Hash digest
SHA256 b428c5e1f5f67243500dd4ec9ee8e0add833090bdc6e3346e3c8d19b6b66cade
MD5 9e6f079cdb6f6896f02b5b7901c06d37
BLAKE2b-256 3f99634312f1c9573530bfcd367b2a8b2240533991d02343698d01183ca64f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0.tar.gz:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: tsdynamics-3.2.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0c8fc64b7d1122e027fab15014b370a0a7fc27f0125156f70581b2c3309eef13
MD5 f4150c3371a598f4989e5bc4b330019d
BLAKE2b-256 a1f3cc6559428771c163b20c42830af2d0786ad44f573a67dc2937dc5037260d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-win_amd64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 42137166e2740a1ecdfeeecc898f6e0af25e1e7bcb050abd0848ea6ff7ca1016
MD5 b85e357afa9da25a2bf56cb61fa42329
BLAKE2b-256 205892dd6fc96dc1ea08cd7a0aab2bdb247a3770755738f7a9e8fb16145c99ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 718044efec2e0ff66b1f68d42c277f01aa1c16d19bde66fb66dfa018dae4b393
MD5 94dc76eda84097679540015d35e2ba59
BLAKE2b-256 4da878ca14d12ab090c2695a05f35c20c7fbcefcb49474ea736afb689337906b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c7960c4197e8e45cc5824edb72f4e395be0e26821d402c672a487ffb9bddc39
MD5 5cb63554c7a4903c6ca487080bf5f8b3
BLAKE2b-256 7cf713d291ee6351e76ceadc73dc7c0a05699d13b64f3c75e547531851648e29

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 32d768178765e32960fc3c79f77384cba0699227a628bd3bba17ce98eeb42b32
MD5 0e3feb24465e536c6fd47534ca047241
BLAKE2b-256 ba33d779dff2a864cf2db3f90034c7d607264232b34729f8efd55bd2c25b5119

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d87d03518f6835d44e15af378d22da3fec55ffc80fc23cf0328e6cc283fd8fdf
MD5 304582c4561820cf12c7e26696e946b8
BLAKE2b-256 2fa9dbf949de84292bf0228a3e3fe3175da1830cc17e95f78e7dbcd44460f6fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsdynamics-3.2.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-3.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d4238fec048b1b02cbcd4dbac11c4975d5877a9a6bf4896bac812261e959b4b8
MD5 6008e8d101f7f2f9c6714faaf41cc096
BLAKE2b-256 4d6cd4df904caff37ddcac91192e2851f20f5b3f6b239bb7237a9d332e3bbfec

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-3.2.0-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on El3ssar/TSDynamics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page