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 codecov

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

Uploaded Source

Built Distributions

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

tsdynamics-5.2.3-cp312-abi3-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12+Windows x86-64

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

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

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

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-5.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

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

tsdynamics-5.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

tsdynamics-5.2.3-cp312-abi3-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-5.2.3-cp312-abi3-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tsdynamics-5.2.3.tar.gz
Algorithm Hash digest
SHA256 659b490501a7cd0584f31d4a375e9a6e046ccd80e791bcd0da0aec0405decf1f
MD5 18208611f9cdab3a7575a5674cf8ea81
BLAKE2b-256 09b1b387ce97c93ffc3b07f6f937a485f9089897d5cbcb980b0bd3b768168121

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-5.2.3-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.6 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-5.2.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 55ec15a6436c66d7a2650a8dc8706bf2da391d3f42b49605031a80fc3ccde6f5
MD5 83d7ab27843a420c25925f9c66a55e92
BLAKE2b-256 693bb4aee5e5da77b8793a5c42be54c184371ce186a6ada2a3525f477a885625

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fa4d494b70e7176d6c63edf63cfc8ddeb40f66ad0709713991d7e064cb654dd8
MD5 3212dc945b50059abfc6b0db26006ebe
BLAKE2b-256 14c5302c6cb0b2690e50f32104092861d44cfef800340299e8e04eed860272bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9fce844b47f2f294027feb81820f95d6b2aef97cfd71817afbae9e5390a967f6
MD5 d7cf20373117e508edd2baf5c90c4356
BLAKE2b-256 fd5fe90b60fab159a0c059cd06149b2ca918a207d11b8a49e5b82332ebc3879e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b18c019520106f40a149c99ad347171e3add7e120e366a3727d29bbdd4c0302f
MD5 7a98129f5a7783f6ea9947285aaf4aef
BLAKE2b-256 0a842f8f41e55e8db1fd794096bb18af9e30402e80a2061562e1602016ef882a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 33dc35f718d3eb313ec154fb09338e91143df91ca93d5685512c9ce1c9b65c0a
MD5 ad2b4baa957a36c4426e83780496ab77
BLAKE2b-256 87d614b55bed3ddce95d2540594ab269fa62e548828bfa1f9331d34ee0510930

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c65b6d65dbf1e8e8e95242486662443a0e844c9c432a74355baba914dfbe641
MD5 4b9df406993b028250bfc4fedd239cc1
BLAKE2b-256 90d036788f767083350c0741511dbdb0f48afbaa0f7773cf44289e39567133b6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.3-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7bbee1507f3e74b4acf168534cbdab6edf47f398348d5b8e7206d1eccfb99699
MD5 b54653af03f3a7a4c1ee4a2e9ddb16ea
BLAKE2b-256 5fcecc003b475f06ce9729aa08cc67d5a1a5251d2fb6766dfb991875e2fd7f9b

See more details on using hashes here.

Provenance

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