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

Uploaded CPython 3.12+Windows x86-64

tsdynamics-3.0.1-cp312-abi3-musllinux_1_2_x86_64.whl (2.6 MB view details)

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

tsdynamics-3.0.1-cp312-abi3-musllinux_1_2_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-3.0.1-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.1-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.1-cp312-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.0.1-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.1.tar.gz.

File metadata

  • Download URL: tsdynamics-3.0.1.tar.gz
  • Upload date:
  • Size: 493.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.1.tar.gz
Algorithm Hash digest
SHA256 3f600453f1e2acf918ceeb27ef01f140f7f7480444101ebf2aa26b8da66d352c
MD5 85d4ac69afc9ab0cb7530e9738436705
BLAKE2b-256 fb343d11ae351194ef3100cacbd5c8b58d4fc339521c195ee1abc9d3d973340f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-3.0.1-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.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 90754d51c01c313138a4df671f145098b4cc33f1dbc00b19ef6eb62a818b673d
MD5 0bf2cb691d299e29f03e3feec1320520
BLAKE2b-256 b7427e257352580b0692f714430ff06f00209a9b7f9484d9c0865609046bf42e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e8b03d907259acde78772348e892144c46557d6209e1093d8a90a0349764bee7
MD5 5f66e3ca5efb43cf8fe31d6509e526ff
BLAKE2b-256 aadd0af650fe4603e1f8d1d59837419f9f3c171395bb9ca9b87c9f8047a44cca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 314600ed01f74d3c1c74e4542f99b02d8dbe9cf24214d776bbbc18d50d4a8825
MD5 85801df87721232b5a2bbc99e98c2366
BLAKE2b-256 215d9d7746c0e8998d566797ac0c8845a587dcf20bf202d9fe5ff45bf50b6bfd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5baf1235738550d6f384cb1b6f1031dae7e9a438c0eff3a0c740b154a6aec291
MD5 c34b91019a257c7f51575d7bcabdaddb
BLAKE2b-256 4790a1dd97bf7dfdf51a2bd8d3fcbe60e6d8355299188b68ecceacc625f2d6a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8d90af3404ecfa4c1d73d8569b54c5f1f4c1d389bceb735095bf0ef71c1e3c6a
MD5 510770948f251f16e9b65a3608eafdd0
BLAKE2b-256 6d638f6f4799e10efcb44679a4fe5d1ef96f6ddac77cd108588806ef65c74a26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b887b4afb288af86873c46f7963c7a670f01e01a057014acadc3f8bc8af555a
MD5 621c18a7d9c83a67f7d7df98f3807b8f
BLAKE2b-256 65e8058edbda56205e94a7ec882be3980e4e5c77c05092affe578683f10517ac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 18df93ba3f17ddbf55fd698f5291c04988acbcf5935b7e1398cceaa80d92da38
MD5 8eb60602c061d4bcbece59338eb1839f
BLAKE2b-256 962fea951996cd984e89ac2b36eeadc52afbcd0789ed10b0cde96d885538aea9

See more details on using hashes here.

Provenance

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