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.0.0.tar.gz (758.5 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.0.0-cp312-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.12+Windows x86-64

tsdynamics-5.0.0-cp312-abi3-musllinux_1_2_x86_64.whl (3.0 MB view details)

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

tsdynamics-5.0.0-cp312-abi3-musllinux_1_2_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-5.0.0-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.0.0-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.0.0-cp312-abi3-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-5.0.0-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.0.0.tar.gz.

File metadata

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

File hashes

Hashes for tsdynamics-5.0.0.tar.gz
Algorithm Hash digest
SHA256 21e8ed4937e02cfe0114bfd514927632fc216155f197cdb40d2302fac466856f
MD5 23b63efe7def3657bad21521fe67281f
BLAKE2b-256 6ec0be6dc0ffc395f97b3f1eedf9ab6abc62eaac1753bdff95a87faa7ba08524

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-5.0.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.4 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.0.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 577d42afef4d0db4c39e27535b9e03a4575ed7e341de434ace874c1b073a9264
MD5 148c6b3237cc0e6f0971b6a128209aa9
BLAKE2b-256 833a149770c23f146129a171facf1c3041c7f4b4458cb157dead540281aea224

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c77166005082252bb87aad66e5f67a0b87a0dc98bb4073a3e1598c45e6454acb
MD5 fe2192e21b4a8ce970241c8d6b0eb046
BLAKE2b-256 c39ffb40d0140bc62d139d39824c588ceceb4a781ee1debb8cc96d5276f8917a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1ed5d9ed26575bf7d9261cf7ba0382ba53af826de6d936dfcfd997c06d5f72e7
MD5 3c6e29215139d8f8e06666f2de604814
BLAKE2b-256 ff6cf8770ad4dd50f27d0a9ddd11b5a5cef40c32009d90da84d3d89206e96069

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1cee70e1151ac0c9acb93537d8a11e7c9431d804ddbb14c6fb3703bb303253f
MD5 0fb3c8eb3e5071784ac8cfa9811995b4
BLAKE2b-256 975e21d766c0c5797dd5718f01df42d55352722ccb8c6931c89e9056e92fc3cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e9b64f2f51b58ef086bd1104a6747f9eb307ec9683bf0cf5e020cf295d01b95b
MD5 5ecd5e829b4e0ed8ae194fa29437f8f1
BLAKE2b-256 abe028a96ad7bed99ed08d4b869f5c45ed59355956fcb583bd4fb8268c945eaf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6fc16de7007c97cd282debb82660aa18fbc6aad8fcea31ff438f61ff33340983
MD5 bcea4aacdc84f54975f3ba80f0b46ef8
BLAKE2b-256 82361bd9c1f748f9cf50096371aa36a400083bd2580761ab8b04d367dc4e6b74

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.0.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f20b3c55407ed10215244c516fcca2639c7c52cf356cd15167d5f555a09ff186
MD5 58e5ade9df9f8b6cde348dca229ae4e0
BLAKE2b-256 85d8d7772136a4994899d83d3a9250e973c4768ad756382bc9a5f62919c70ac9

See more details on using hashes here.

Provenance

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