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.3.tar.gz (502.4 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.3-cp312-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-3.0.3-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.3-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.3-cp312-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.0.3-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.3.tar.gz.

File metadata

  • Download URL: tsdynamics-3.0.3.tar.gz
  • Upload date:
  • Size: 502.4 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.3.tar.gz
Algorithm Hash digest
SHA256 65e354cb06ce4c76700c16801b8fb5361fc43ea68e207c4d063bf9bdf7da43e5
MD5 7055567ad9fe45687247cc24a87de769
BLAKE2b-256 85cdd7dddd02fad3aa5365620a9434d4ef06d3488d1b6f19471609ae582b9116

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-3.0.3-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.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9543dc684c7587bc033971a258be3e2eedcfa81221592a8a5b76a9d473394cba
MD5 354e1d06235f7d93e752c0cc4e55a5de
BLAKE2b-256 2cf40c68a392330c1139f6bb3da132027580802727630392f13459115a38fcdf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6b653b919285e2859cef0a7337439f9fc60653f6748f540e25cae4d60b0015e5
MD5 9b049b766fa98018d10de7bad9a81d4d
BLAKE2b-256 3ccf329039b451d1f292f6d48fb279969c99072fac8bfc5a4e896f70c2f6f9c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 06d8e8b42630fc0c33ebaf3c4fdc1b3ffe56da798d67f95eca43ac3c9526d815
MD5 34115ba08205d92146af3883c3cd9cd2
BLAKE2b-256 1afe41d3e39ac915b8b5ace869626355defa1ce211b6276e82f299a97c7f33f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef5c54363f34188900e064144ad066982b0f21f3561f5a43ed840bebe33d87a6
MD5 64a9c04a8923ff0a7828a5f7da29d416
BLAKE2b-256 6279048c3fe851dc9eeba9572e7dd4dbd8b2cb44e8ee01f61d9c42f24d7ab612

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23c2ce6468b10b18df71519588dfce9d1c1a3e2b69cc895d0725753082a74470
MD5 b5bbfcc23cf663e8069dcf1a22a2b598
BLAKE2b-256 8063729ab23cd06d697fdbe650937d91bd280be9bf3c202ceb4c062b4ab57fcf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a4389fa7a30064b4c742b8b64a38ba14cedd23bc9217185bf5dbc2b909b2be0
MD5 80896784754a2154670f43af071f3346
BLAKE2b-256 3d7ed11cfe765a6d9bd999713cec428ca6da2f261c05665ed6ed5537730f9f4e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.3-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9240bc77742f34409f58e529dfeef284e3837b1facd2e5a5f814c4e2fab3e5aa
MD5 5d1ed6672ed191c6938a587f3f588c7a
BLAKE2b-256 832868cca06363e574bd53a234d65748db5c631723924fc7369589b9c602ce21

See more details on using hashes here.

Provenance

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