Skip to main content

A Python package to simulate and measure chaotic dynamical systems.

Project description

LorenzPy

Code style: black Ruff codecov license: MIT Python versions

⚙️ Installation

To install only the core functionality:

$ pip install lorenzpy

To install with the additional plotting functionality. This also installs plotly.

$ pip install lorenzpy[plot]

▶️ Usage

LorenzPy can be used to simulate and measure chaotic dynamical systems. The following example shows how to simulate the famous Lorenz63 system, and measure its largest Lyapunov exponent from the Lorenz63 iterator:

import lorenzpy as lpy

# Initialize the Lorenz63 simulation object with a RK4 time step of dt=0.05
l63_obj = lpy.simulations.Lorenz63(dt=0.05)

# Simulate 5000 steps of the Lorenz63 system:
data = l63_obj.simulate(5000)    # -> data.shape = (5000,3)

# Calculate the largest Lyapunov exponent from the l63_obj iterator:
iterator = l63_obj.iterate
lle = lpy.measures.largest_lyapunov_exponent(
    iterator_func=iterator,
    starting_point=l63_obj.default_starting_point,
    dt=l63_obj.dt
)
# -> lle = 0.905144329...

The calculated largest Lyapunov exponent of 0.9051... is very close to the literature value of 0.9056[^SprottChaos].

📗 Documentation

⚠️ Further notes:

  • So far the usefulness of this package is very limited. The authors main purpose to creating this package was to learn the full workflow to develop a Python package. More information about the development process can be found in CONTRIBUTING.md.
  • The plotting functionality, which can be installed with pip install lorenzpy[plot] is not tested so far.
  • See Pynamical for a similar package

[^SprottChaos]: Sprott, Julien Clinton, and Julien C. Sprott. Chaos and time-series analysis. Vol. 69. Oxford: Oxford university press, 2003.

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

lorenzpy-0.0.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

lorenzpy-0.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file lorenzpy-0.0.1.tar.gz.

File metadata

  • Download URL: lorenzpy-0.0.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for lorenzpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a810d0c6a38bd579dcd0f2eab0e38f2878a74d529c31849c8b49a572245b748c
MD5 54f0efeca44d6a553e366d9f4e73df88
BLAKE2b-256 3fd706c7e838a299415f878365456f90458045d70f7e1f57b7757b6a19e9f80b

See more details on using hashes here.

File details

Details for the file lorenzpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lorenzpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for lorenzpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe2347aa1e6e106e17e593e8e9c739e6e6069f0624ca400c285e14231602536
MD5 a5bfee2897c1d40ed7e8a6517aeb653f
BLAKE2b-256 2d59961e9a6c017cac767f125df4f5803e902a5fe59f3914433012ba5457a7a7

See more details on using hashes here.

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