Lorenz Attractor
Integrate the Lorenz system — the three equations Edward Lorenz studied in 1963 that gave chaos theory its name and the butterfly effect its image: dx/dt = σ(y−x), dy/dt = x(ρ−z) − y, dz/dt = xy − βz. With the classic parameters σ=10, ρ=28, β=8/3 the trajectory settles onto the famous two-lobed strange attractor: deterministic, never repeating, yet forever confined. Two orbits that start a hair's breadth apart diverge exponentially — a separation amplified by a factor of roughly e0.9·t — which is why long-term weather prediction fails. Integration uses fourth-order Runge–Kutta (RK4). Slide ρ down below 1 and the system quiets to the stable origin. Everything runs locally in your browser.
Attractor projection (x–z)
The trajectory projected onto x (horizontal) vs z (vertical) — the iconic two-winged attractor.
Butterfly effect — divergence of two orbits
Log-distance over time between two orbits starting 10⁻⁸ apart. A rising line = sensitive dependence on initial conditions.
The Lorenz equations are a simplified model of fluid convection: dx/dt = σ(y−x), dy/dt = x(ρ−z) − y, dz/dt = xy − βz. For ρ < 1 the only fixed point is the origin and it is stable (the fluid sits still); for ρ > 1 two nonzero fixed points C± = (±√(β(ρ−1)), ±√(β(ρ−1)), ρ−1) appear. At the classic parameters (σ=10, ρ=28, β=8/3) all three fixed points are unstable, and every trajectory is drawn onto a fractal strange attractor of zero volume but nonzero dimension (≈2.06). The system is deterministic — the same initial state always yields the same orbit — yet it is chaotic: the largest Lyapunov exponent is ≈0.906, so nearby states separate as e0.906·t until they are as far apart as the attractor allows (≈30 units). This is why weather forecasts degrade after a couple of weeks. The equations are symmetric under (x, y) → (−x, −y), which RK4 preserves exactly, so mirrored initial conditions stay mirrored forever. Integration uses classical fourth-order Runge–Kutta: each step takes four derivative evaluations (k1…k4) and combines them as (k1 + 2k2 + 2k3 + k4)/6 for O(dt⁵) local accuracy. Pairs with the Logistic Map, Mandelbrot Set, and Elementary Cellular Automata. Everything runs locally — nothing leaves your browser.