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

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.0.4-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.4.tar.gz.

File metadata

  • Download URL: tsdynamics-3.0.4.tar.gz
  • Upload date:
  • Size: 504.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.4.tar.gz
Algorithm Hash digest
SHA256 25eabcb17bbc4969df9ed0510bbb1a0cc82cda922139f31f50a0fd65b0c2625d
MD5 ab0f68ac9aab2ce8ef598b2c1c1468e9
BLAKE2b-256 c3843cb07451c0241aab3fd7d2f381d7dfda00501bbf2abf5e9b32bae5c0f9fc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-3.0.4-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.4-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e9db145b7230808bd6c185d81caf1c00f1baa701271994f9899ef7c381eeab94
MD5 3d6013a947e86f9a7e09d94067e72bf9
BLAKE2b-256 ffd41750df2befe4a001a6edae52c85f76a4dc5ced76aa83b0442923ad661c85

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 770019f7b1ddf8baf4104db7dff77133cd145b9a461d3edfcd9413525a182bf1
MD5 20471d85e5b31a875e2dc6c2790574cd
BLAKE2b-256 bf80f2632470ba48d3a2d81a1396a74acba3920867de78eba17bdf121d01aa50

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c9cb35295c40ee2ab93bf6277601d23aa2994f9a4a71b3f0d37e9191fe961eea
MD5 1681cb28aa3676ee6f9169c10c8ba08a
BLAKE2b-256 a54ca86c4cb93949e30fd976aaadb53756dffc4be8e21afc1154694934efd39e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7965a4e473360c48279bb4b34723a95a3e453864d057a998da26915727aab6f9
MD5 cd2f4f6f37d6e348122567e3353f58a9
BLAKE2b-256 519d850afaf1516415972ee591020f4a3e780bf0b996433813cf4f7121516284

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb85dcf2bd068d1a9f5cc8b6875f15ed00005990ec340d91e91771932684910d
MD5 d6cf175556a70b51ff5ade7495891cdb
BLAKE2b-256 3390eb2e714688dd0495f4490e2bf58f7f85999f9a91e5eb0de1ab9ad36ab78e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 422570baf2c9a5cdd3baf61054cbee293089ed82f8bb56c1bdf77989d105495f
MD5 705c59aaaa933bc9b2ce28a8cee22a6b
BLAKE2b-256 f10a9f85ed5b32620a53d6cd464ed4f7c1a176e4b171045373caa147b09bc610

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.0.4-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d3e490107f607cd67a0c832b7108ac1c83300db494ea73407a9ea87ad56b771f
MD5 53ed86b9a52259ab8412315cdc6824e2
BLAKE2b-256 3213876b405f65258f894d368459fe59a79cace61423d76b03eeb4e0ce275c82

See more details on using hashes here.

Provenance

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