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

Uploaded CPython 3.12+Windows x86-64

tsdynamics-5.2.4-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.2.4-cp312-abi3-musllinux_1_2_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-5.2.4-cp312-abi3-macosx_10_12_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: tsdynamics-5.2.4.tar.gz
  • Upload date:
  • Size: 857.8 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.4.tar.gz
Algorithm Hash digest
SHA256 6f2fe584ae723c7e7b87d27122a5266fb810fe6f968cd8041f7bd2d8c75d9667
MD5 fa0a3ce0f93246cb25b059ad574b7895
BLAKE2b-256 442a20b5710fcd8ecf3cbb941c6cb5149cb18abda92dd388a412a935f6fe0cc6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-5.2.4-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.4-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1d7070ae80446df78c7b52dca195e00f0511ab20ce99d546f49e797ee04dc1f7
MD5 2ac4c74bbc9189b9b828d3d3c52bc951
BLAKE2b-256 078e5510ba5988c918c1f736a0fe38b6a04310931d6100e18f52dbe53b06d507

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 edd9acba95ce7ca67ff8f4cfd940a2f48f53aa7c6ff1bbdf864bddec9f81d941
MD5 da426453192be23627767c2cd6dc4e82
BLAKE2b-256 9771eeac38981be2b0e86f1d34781ef9b593a73df5f1119fbc36ee2197b2a850

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8ec6e09bc0e67b42f54d9057f77f0aae626446513940a6be359c58a5eb91aaee
MD5 eae678172d5624c9cc3a62701d05d2fd
BLAKE2b-256 ace143ace1cd40a4abeba1274a8f9ce00949793f7de034d0f2f3b960925b1402

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89e8a48907a1fd3a88994ffc3896ca429c9dfe4aa9e4fd7b0cb5b39eb41c688e
MD5 84a5405afc289f38c6a80575e84e208f
BLAKE2b-256 890104fef280ea933fe6c282ea61969ce651d06f327ffc7add569d17f449e591

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 942750b01e483246deb417a38dbaac69e11cfc72a279ed763a02a1820e65bc7e
MD5 0f3ce424a14ee932514bc89340aa92eb
BLAKE2b-256 dc306669e931de38234735b32aa943befa9ce55faa826023bfc5030dc7d996c9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a550f8a5d39baa587b66974468d0e9d6c4b2bba82f2b87165e0c27875143dbbd
MD5 bec97be6cd6c786a716163a10267c198
BLAKE2b-256 ed923323707d0002e77a1e4e1bd930e2527abb330c12eee013e07d250225d45e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-5.2.4-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2ffb2ffda14ebd725580b2ffa0f20003982100eb30cd2fe86e0e7e452c580132
MD5 fde5263c7a3ce0948db70a3ff14b317e
BLAKE2b-256 4cd63f566777e6deb661164d89d616327e639114a8ce9f6d0a92cfd47286fd73

See more details on using hashes here.

Provenance

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