qilisdk.ml.datasets.lorenz
Classes
Lorenz attractor, a chaotic dynamical system. |
Functions
|
Integrate the Lorenz system with a fixed-step RK4 scheme. |
Module Contents
- integrate_lorenz(*, sigma: float, rho: float, beta: float, initial_state: tuple[float, float, float], dt: float, n_steps: int) qilisdk.ml.datasets.dataset.FloatArray[source]
Integrate the Lorenz system with a fixed-step RK4 scheme.
The Lorenz equations are
\[\dot{x} = \sigma (y - x), \quad \dot{y} = x (\rho - z) - y, \quad \dot{z} = x y - \beta z.\]- Parameters:
sigma (
float) – Prandtl number \(\sigma\).rho (
float) – Rayleigh number \(\rho\).beta (
float) – Geometric factor \(\beta\).initial_state (
tuple[float,float,float]) – Initial(x, y, z)state.dt (
float) – Integration step.n_steps (
int) – Number of RK4 steps to take.
- Returns:
The trajectory, shaped
(n_steps + 1, 3).- Return type:
FloatArray
- class Lorenz(*, sigma: float = 10.0, rho: float = 28.0, beta: float = 8.0 / 3.0, initial_state: tuple[float, float, float] = (1.0, 1.0, 1.0), dt: float = 0.01, sample_every: int = 5, washout: int = 1000, horizon: int = 1, seed: int | None = None)[source]
Bases:
qilisdk.ml.datasets.dataset.DatasetLorenz attractor, a chaotic dynamical system.
Configure a Lorenz generator.
- Parameters:
sigma (
float) – Prandtl number \(\sigma\). Defaults to10.0.rho (
float) – Rayleigh number \(\rho\). Defaults to28.0.beta (
float) – Geometric factor \(\beta\). Defaults to8/3.initial_state (
tuple[float,float,float]) – Initial(x, y, z)state. Defaults to(1.0, 1.0, 1.0).dt (
float) – Internal integration step. Defaults to0.01.sample_every (
int) – Sub-sampling stride. Defaults to5.washout (
int) – Integration steps discarded as transient. Defaults to1000.horizon (
int) – Prediction horizon in sampled steps. Defaults to1.seed (
int | None) – Unused; the system is deterministic. Defaults toNone.
- Raises:
ValueError – If
dtorsample_everyis not positive.
- generate(npoints: int) qilisdk.ml.datasets.dataset.DatasetSample[source]
Integrate the Lorenz system and build a prediction sample.
This produces a single time series of length
npoints + horizon, discarding the firstwashoutsteps, and then sub-sampling everysample_every` steps. The resulting series is split into ``inputsandtargets, wheretargetsis the same series shifted forward byhorizon.- Parameters:
npoints (
int) – Number of time steps to produce.- Returns:
A
horizon-step-ahead prediction pair, both arrays shaped(npoints, 3).- Return type:
- Raises:
ValueError – If
npointsis not positive.