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-4.0.0.tar.gz (653.0 kB view details)

Uploaded Source

Built Distributions

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

tsdynamics-4.0.0-cp312-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.12+Windows x86-64

tsdynamics-4.0.0-cp312-abi3-musllinux_1_2_x86_64.whl (2.9 MB view details)

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

tsdynamics-4.0.0-cp312-abi3-musllinux_1_2_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-4.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

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

tsdynamics-4.0.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

tsdynamics-4.0.0-cp312-abi3-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-4.0.0-cp312-abi3-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tsdynamics-4.0.0.tar.gz
Algorithm Hash digest
SHA256 bb0057378c11063fc037b4ca0e2b750196494e76b054b848466afdf348d9a0ab
MD5 2e564e6d0969f6415141b40ab3ee692b
BLAKE2b-256 717bf488ab1c41e6b179bbae2be559eb7c42ee5b6261a3a08780b8535c7f42d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: tsdynamics-4.0.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.3 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-4.0.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c7c2d2bba032075ab8c448c3a934503b506d2b0ba597d08e08295c5ee4918e42
MD5 672c92247cd789768169be10cf389393
BLAKE2b-256 11af16c34ceace8b5a2c20475219f2ec6d45748f82ea7033226b8162bcee48a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 718a6e66652a64584217acb96e17dd7c96f96fd4e8ddae0ff5d3ca6219333b96
MD5 536cdb186fa302839aa70190622f969f
BLAKE2b-256 019cf3afa1114c0081698fe55df05bb9866873f984b5f4d405d4468b102ec26a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6e0a1d4e3c7dbaa30e021a27b956b9059500329d628708c3a9e2f89bcea3c0b3
MD5 6df9c095d2d132bf06e83ac96af1b4ad
BLAKE2b-256 781d29584866e26dc6c15f54ba0b6c8e29dbcc3b9d2334030e4ee6745251efb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49e563611442e9e75dcc5590b905a9d225eecf4fe46fa2d4e865201b701d542b
MD5 4ad59ac83c1c908842ca18bd91803dbe
BLAKE2b-256 234a44c1b73c4755314bbeea37752cab7cf3fab903bbd98839ae37bb2f693569

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d8577b5dd759fe54653f7f8f6225c47df1cd0dc1fc971740cd52cdd72fddee87
MD5 cba6fc84b19a405804cff02639a21353
BLAKE2b-256 78df21c6aaba5f5ab4d060b2a98087225d9eb4fc1aa50a086ca057f7ef516700

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b4fe7be88c926323d490658249530e946a33c09609456b2688c83b635915cef
MD5 0882915c44f4e4b72f2d229884167561
BLAKE2b-256 477146b3bd4b283852fb808554c476077882979ac8fd973b45e3cea02fcdca6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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-4.0.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tsdynamics-4.0.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 30d1fd6163c7bfa3c7036e4b791357b9a266db77c641310d51202612fd653832
MD5 c393659b9269293378063e07e0ad1960
BLAKE2b-256 1cda09d778a2f8c4ce01b3cc10eb8f291f5562e64af0e5a95a2240b4a9a3cf84

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsdynamics-4.0.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