Lorenz Attractor (Lorenz-v0)
The Lorenz environment implements the classic Lorenz system — a three-dimensional chaotic system which, at the standard parameters, has three unstable equilibria: the origin and the two non-trivial equilibria ( ± β ( ρ − 1 ) , ± β ( ρ − 1 ) , ρ − 1 ) (\pm\sqrt{\beta(\rho-1)},\, \pm\sqrt{\beta(\rho-1)},\, \rho - 1) ( ± β ( ρ − 1 ) , ± β ( ρ − 1 ) , ρ − 1 ) . The control task is to stabilise the state at the non-trivial equilibrium with positive x 1 , x 2 x_1, x_2 x 1 , x 2 , x ∗ = ( β ( ρ − 1 ) , β ( ρ − 1 ) , ρ − 1 ) x^* = (\sqrt{\beta(\rho-1)},\, \sqrt{\beta(\rho-1)},\, \rho - 1) x ∗ = ( β ( ρ − 1 ) , β ( ρ − 1 ) , ρ − 1 ) .
Dynamics
x ˙ 1 = σ ( x 2 − x 1 ) + u x ˙ 2 = x 1 ( ρ − x 3 ) − x 2 x ˙ 3 = x 1 x 2 − β x 3 \begin{aligned}
\dot{x}_1 &= \sigma (x_2 - x_1) + u \\
\dot{x}_2 &= x_1 (\rho - x_3) - x_2 \\
\dot{x}_3 &= x_1 x_2 - \beta x_3
\end{aligned} x ˙ 1 x ˙ 2 x ˙ 3 = σ ( x 2 − x 1 ) + u = x 1 ( ρ − x 3 ) − x 2 = x 1 x 2 − β x 3
Standard Lorenz parameters: σ = 10 \sigma = 10 σ = 10 , ρ = 28 \rho = 28 ρ = 28 , β = 8 / 3 \beta = 8/3 β = 8/3 .
The action u u u enters additively through x ˙ 1 \dot{x}_1 x ˙ 1 . Integration uses RK45 with Δ t = 0.01 s \Delta t = 0.01\,\text{s} Δ t = 0.01 s .
Spaces and limits
Property Value State dimension 3 Action dimension 1 x 1 x_1 x 1 range[ − 20 , 20 ] [-20, 20] [ − 20 , 20 ] x 2 x_2 x 2 range[ − 50 , 50 ] [-50, 50] [ − 50 , 50 ] x 3 x_3 x 3 range[ 0 , 50 ] [0, 50] [ 0 , 50 ] Action range [ − 75 , 75 ] [-75, 75] [ − 75 , 75 ] Δ t \Delta t Δ t 0.01 s Max episode steps 2000 (20 s)
Reference point
x ∗ = ( β ( ρ − 1 ) , β ( ρ − 1 ) , ρ − 1 ) ≈ ( 8.485 , 8.485 , 27.0 ) x^* = \bigl(\sqrt{\beta(\rho-1)},\; \sqrt{\beta(\rho-1)},\; \rho - 1\bigr)
\approx (8.485,\; 8.485,\; 27.0) x ∗ = ( β ( ρ − 1 ) , β ( ρ − 1 ) , ρ − 1 ) ≈ ( 8.485 , 8.485 , 27.0 )
Cost function
c ( x , u ) = ( x − x ∗ ) ⊤ Q ( x − x ∗ ) + u ⊤ R u c(x, u) = (x - x^*)^\top Q (x - x^*) + u^\top R u c ( x , u ) = ( x − x ∗ ) ⊤ Q ( x − x ∗ ) + u ⊤ R u
with Q = I 3 Q = I_3 Q = I 3 and R = 0.001 ⋅ I 1 R = 0.001 \cdot I_1 R = 0.001 ⋅ I 1 . The small action cost (R = 0.001 R = 0.001 R = 0.001 ) reflects the large control authority needed to overcome chaotic divergence.
LQR linearisation
The LQR baseline linearises around x ∗ x^* x ∗ :
A lin = ( − σ σ 0 ρ − z ∗ − 1 0 y ∗ x ∗ − β ) , B lin = ( 1 0 0 ) A_{\text{lin}} = \begin{pmatrix} -\sigma & \sigma & 0 \\ \rho - z^* & -1 & 0 \\ y^* & x^* & -\beta \end{pmatrix}, \qquad
B_{\text{lin}} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} A lin = − σ ρ − z ∗ y ∗ σ − 1 x ∗ 0 0 − β , B lin = 1 0 0
Usage
uv run -m koopmanrl.soft_koopman_value_iteration --env_id Lorenz-v0 uv run -m koopmanrl.soft_actor_koopman_critic \ --config_file configurations/sakc_lorenz_hparams.json
Notes
The Lorenz system is chaotic for the standard parameters; without control, trajectories diverge from x ∗ x^* x ∗ exponentially.
The large action range (± 75 \pm 75 ± 75 ) is needed for reliable stabilisation from arbitrary initial conditions.
Source: koopmanrl/environments/lorenz.py