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), 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-3.1.4.tar.gz (545.0 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.1.4-cp312-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

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

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

tsdynamics-3.1.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

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

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

tsdynamics-3.1.4-cp312-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tsdynamics-3.1.4.tar.gz
Algorithm Hash digest
SHA256 3251d205b5d8a4804c18254d92ead6a7ae42d062eb30463e481f5048d07a63b7
MD5 d92ca76334774d2b8375441bad971688
BLAKE2b-256 45478e2dc98211e95b426193c8676eceb75071a916ada9b72d66be6a287fffaf

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tsdynamics-3.1.4-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 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.1.4-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d7b70233d4cd26974ec2b36122017750a318dc21e81a96a1a9f1ce7a3f48221d
MD5 8f54b34f88631f3ffb5c20d8cb65bf4d
BLAKE2b-256 5d7ee7821c315884c3f76356dd10920b102879af2d08f05b21d39eb90a459e3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f8aaf7437bb4709a046b0fa2056a73fa216febf3c8bc9a19680fd4ce2d19d63f
MD5 d6d921ef9d9dcb31ea3b14776e191637
BLAKE2b-256 8d33d2cd16817b8db360a667df374db3d11271914c6cd2302007399725f66b4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0d7332b8a13b11bc778b56a0fcd9400adf64757e74e38eaacfb6b21e9b9b0b60
MD5 e1b2757e0c50337a7cd0ee3dd1ff18d8
BLAKE2b-256 59e5e2f9b86b2dea09d97afe85b4f95a3c97bef2d70b6e666daa682febbce056

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e419872f2c576a48e4430fd5d8e2bfb7b4edd1e871d103fbae4cf61f3ce9eefa
MD5 29a5116cd0aef3ed4bc3679bc2b2ceb9
BLAKE2b-256 1c57056a899e5ad37d3f2234bba3e1dcc543a94d05b23c11ec050799ad73cdb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3849163c3e699c06979cb134e35407fffb2755f8cc9d923b6f937e8c45b66efa
MD5 0e81185b772a7caac18368e6c905d66e
BLAKE2b-256 1446be8fe0738faf2f10e26aef020dfe80417020a13d9641b65563d4bd25a9b1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f75ececad56fa72e6967375dbf15738648cdb747c779e71f8225682e426b119
MD5 d13c72171858a123019257a0ec941f1f
BLAKE2b-256 7e0f8310844acfcba1785ef71d26ba8a41f0898d020cfef6af575bd5facfbce9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tsdynamics-3.1.4-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad3c010dc3de062a257913ee319509c8cce191fb483df35313a13251c973a904
MD5 acac26ad9b407b1a2897314fef4194e5
BLAKE2b-256 bb3b71c537ffb0cf45aca2b349a2ca60034209724783299a3595379311199b3d

See more details on using hashes here.

Provenance

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