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), steps=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.0.2.tar.gz (501.1 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.0.2-cp312-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12+Windows x86-64

tsdynamics-3.0.2-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.0.2-cp312-abi3-musllinux_1_2_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-3.0.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

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

tsdynamics-3.0.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.0.2-cp312-abi3-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tsdynamics-3.0.2.tar.gz
Algorithm Hash digest
SHA256 bf2341d60a534d7cbabbd66cc6002fe9ff6e0771c8d1c9e0b86c9ccefe89f323
MD5 053bf503f35642a570c81efc6124ea6b
BLAKE2b-256 8e7635711bcec62df6163357fca12cdf4dad3744e626a875fc2d7aba1fe32c63

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 608a6df5c901cd519c73218a823cefc2c94ecb802a3477f4292b4b71392a7af7
MD5 7e9857c894dcd8bbbb192764cd44436f
BLAKE2b-256 5c4f362d29196b6bd306e97d2a9b2da698f7ea275a50fd7ab203545280e3c85c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9b958749882e1e16cc2bcd68da5580ac9990a9e88435d623f809bbd9d74248ee
MD5 438a2edf9299b1b18dcefdc9d88553d4
BLAKE2b-256 ab6fae60ea545c3045f4231427511c5c12640a9707169d56295de80901bf6b1e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 de47d0a00198ac76225dc62bf9ebdaf30e612ab7ca1530f533201a9d080c1336
MD5 9b383bf4f98aeac5e45b4825e04a90df
BLAKE2b-256 32522507c6ebd6afc68ad36d762930fbb443a5218916e6556ecb11a5540f2502

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d7f1757ef8385348f756162120c678ee3a576eab652d004817127738f94900b
MD5 86b6b6f0fa62582a022bc6db769826ab
BLAKE2b-256 b7cbe1a9f040dec258ef6c9303816b6d195b25a693fcdbf095cbd5c8b5c305c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db9becf49069d402a6a86fa567b3f817abb0ecd34afe47348a24fc838a5a9a74
MD5 87897c8b2ad8e0177b31810eafc420a3
BLAKE2b-256 48c339be8833bcb54293e0295a7c272842d3c4709580e52f7e57b819c3235de7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4543fbe6d39098f8837075bc9c0d97574b7a402099aa3bf63e5b4c72b86d5879
MD5 3e4463206e71d3e47de9546933c26a19
BLAKE2b-256 d7560c61f0094ea2f0d51bd02fb5e7de8c4b5e6677762df2ee1036c3bcd0779c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.2-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bfd3ad9d84ae4817ef3b45eaa9b02f9232d7dad5fd0038f1de48e9b36088e3bf
MD5 85c636a09cfe0ec05c04579154d4b36e
BLAKE2b-256 885e7263e70f6d6fa9e73eaaef1802718df11846c27b81a664ee6f90b2f63325

See more details on using hashes here.

Provenance

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