From 15e9220113946171c8cbdf8a31213ff60cd68d44 Mon Sep 17 00:00:00 2001 From: DuncDennis <90915296+DuncDennis@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:07:57 +0200 Subject: [PATCH] Added supported systems to readme. --- README.md | 13 +++++++++++- src/lorenzpy/simulations/autonomous_flows.py | 21 ++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 30f68d0..102baef 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,22 @@ lle = lpy.measures.largest_lyapunov_exponent( The calculated largest Lyapunov exponent of *0.9051...* is very close to the literature value of *0.9056*[^SprottChaos]. +## 💫 Supported systems + + +| Name | Type | System Dimension | +|:---------------------------:|:---------------------------:|:----------------:| +| `Lorenz63` | autonomous dissipative flow | 3 | +| `Lorenz96` | autonomous dissipative flow | variable | +| `Logistic` | noninvertible map | 1 | +| `SimplestDrivenChaoticFlow` | conservative flow | 2 space + 1 time | +| `KuramotoSivashinsky` | PDE | variable | +| `MackeyGlass` | delay differential equation | variable | ## 📗 Documentation - The main documentation can be found here: https://duncdennis.github.io/lorenzpy/ - ⚠️: The documentation is not in a useful state. -## ⚠️ Further notes: +## ⚠️ 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. diff --git a/src/lorenzpy/simulations/autonomous_flows.py b/src/lorenzpy/simulations/autonomous_flows.py index 48599ec..133d3a8 100644 --- a/src/lorenzpy/simulations/autonomous_flows.py +++ b/src/lorenzpy/simulations/autonomous_flows.py @@ -1,4 +1,6 @@ """Autonomous flows.""" +from typing import Callable + import numpy as np from .base import _BaseSimFlow @@ -9,13 +11,16 @@ class Lorenz63(_BaseSimFlow): This function is able to simulate the chaotic dynamical system originally introduced by Lorenz. - - Attributes: - sigma: Sigma parameter. - rho: rho parameter. """ - def __init__(self, sigma=10.0, rho=28.0, beta=8 / 3, dt=0.1, solver="rk4"): + def __init__( + self, + sigma: float = 10.0, + rho: float = 28.0, + beta: float = 8 / 3, + dt: float = 0.1, + solver: str | str | Callable[[Callable, float, np.ndarray], np.ndarray] = "rk4", + ): """Initialize the Lorenz63 simulation object. Args: @@ -49,7 +54,11 @@ class Lorenz96(_BaseSimFlow): """Simulate the n-dimensional Lorenz 96 model.""" def __init__( - self, sys_dim: int = 30, force: float = 8.0, dt: float = 0.05, solver="rk4" + self, + sys_dim: int = 30, + force: float = 8.0, + dt: float = 0.05, + solver: str | str | Callable[[Callable, float, np.ndarray], np.ndarray] = "rk4", ) -> None: """Initialize the Lorenz96 simulation object.