Chaos Theory Equation Representations (Strange Attractors)

Five chaotic systems integrated live from their differential equations. Drag to orbit.

Interactive, 2023

Why: I built this because I went down a chaos theory rabbit hole. It started with the Lorenz paper. A month later I had five systems and a Runge-Kutta integrator and no real reason to stop.

Lorenz

ẋ = σ (y − x)
ẏ = x (ρ − z) − y
ż = x y − β z

σ = 10, ρ = 28, β = 8/3

Drag to orbit.

Deterministic, and still unpredictable

Each system on this page is a set of ordinary differential equations: rules that say exactly how x, y and z change from one instant to the next. Nothing in them is random. Give the equations a starting point and the entire future of that point is fixed.

Chaos is what you get when such a system is also sensitive to where it started. Two points that differ in the tenth decimal place follow paths that separate exponentially, so after a short while they have nothing to do with each other. Edward Lorenz ran into this in 1963 while boiling a weather model down to the three equations at the top of this list, noticed that re-running a simulation from rounded-off printout gave a completely different forecast, and the nickname that stuck was the butterfly effect. The separation rate has a name, the largest Lyapunov exponent, and a positive one is the textbook definition of chaos.

What surprised me is that the paths do not fly off to infinity. They get pulled onto a bounded shape, the attractor, and never leave it, but they also never repeat. The shape is called strange because it is a fractal: zoom in on any sheet of the Lorenz butterfly and it turns out to be infinitely many thinner sheets. Lorenz is the one everybody has seen. Halvorsen is the one I keep coming back to.

The canvas releases 1,800 points at random and moves every one of them with the equations. Each step is a fourth-order Runge-Kutta update, four derivative evaluations per point per step, because plain Euler integration slowly drifts off the attractor for a stiff system like Lorenz and the butterfly smears into a blob. The Butterfly test button drops all 1,800 points onto one spot. They draw a single line for a few seconds. Then they peel apart, and before long they cover the whole attractor again as if they had never been together.

The equations

  • Lorenzon screen now

    ẋ = σ (y − x)
    ẏ = x (ρ − z) − y
    ż = x y − β z

    σ = 10, ρ = 28, β = 8/3

    Lorenz's 1963 model of convection rolls in the atmosphere, and the paper that started chaos theory. Two lobes, and a trajectory that hops between them without ever settling into a pattern.

  • Aizawa

    ẋ = (z − b) x − d y
    ẏ = d x + (z − b) y
    ż = c + a z − z³/3 − (x² + y²)(1 + e z) + f z x³

    a = 0.95, b = 0.7, c = 0.6, d = 3.5, e = 0.25, f = 0.1

    Points swirl around a sphere and get sucked through a channel down its axis. The cubic terms keep everything bounded; the x³ term breaks the symmetry just enough to make it chaotic.

  • Thomas

    ẋ = sin(y) − b x
    ẏ = sin(z) − b y
    ż = sin(x) − b z

    b = 0.208

    René Thomas's system: a particle in a lattice of sine wells with linear damping. Swap x → y → z → x and the equations are unchanged, which is why the attractor is symmetric under that rotation. Lower b and it turns into a random walk through the lattice.

  • Halvorsen

    ẋ = −a x − 4 y − 4 z − y²
    ẏ = −a y − 4 z − 4 x − z²
    ż = −a z − 4 x − 4 y − x²

    a = 1.89

    Every variable is damped and pushed by the other two, plus one square term. The same cyclic symmetry as Thomas, but the quadratic terms fold the flow into three interlocking spiral arms.

  • Rössler

    ẋ = −y − z
    ẏ = x + a y
    ż = b + z (x − c)

    a = 0.2, b = 0.2, c = 5.7

    Otto Rössler built the simplest chaotic system he could: linear in every term but one. Trajectories spiral outward in the plane until z (x − c) kicks them up and drops them back near the centre, and the reinjection is what makes it chaotic.