Not Actually a Fractal

The Lorenz attractor is a chaotic dynamical system, not a fractal. But its double-spiral shape has a fractal-like internal structure (its Hausdorff dimension is about 2.06), and it's too good-looking to leave out.

Discovery

In 1961, Edward Lorenz was running a weather simulation on a Royal McBee LGP-30 computer at MIT. To save time, he restarted a run partway through by typing in numbers from an earlier printout. The printout showed three decimal places. The computer stored six. That difference (0.506 versus 0.506127) was enough. The new run diverged completely from the original within a few simulated days.

Lorenz had stumbled onto something. He spent the next two years stripping his 12-equation weather model down to just three equations that still showed the same behavior. The result, published in 1963 as "Deterministic Nonperiodic Flow" in the Journal of the Atmospheric Sciences, was almost completely ignored. It got three citations in the next ten years.

Then in 1972, a colleague convinced him to give a talk at the American Association for the Advancement of Science. The title: "Does the Flap of a Butterfly's Wings in Brazil Set Off a Tornado in Texas?" The idea caught on, and the name stuck.

The Equations

Three variables, three equations:

  • dx/dt = σ(y - x)
  • dy/dt = x(ρ - z) - y
  • dz/dt = xy - βz

The classic parameter values are σ = 10, ρ = 28, β = 8/3. Originally these corresponded to physical properties of atmospheric convection: σ is the Prandtl number (ratio of viscosity to thermal diffusivity), ρ relates to the temperature difference driving convection, and β is a geometric factor. The equations were later studied well beyond meteorology.

Why It Matters

The Lorenz system is completely deterministic, with no randomness anywhere. Given exact initial conditions, the future is fixed. In practice, though, two starting points separated by one part in a million will trace similar paths for a while, then suddenly diverge onto completely different trajectories. There's no gradual drift: the paths track each other closely, then split.

This is why long-range weather forecasting is impossible in principle. The atmosphere is a chaotic system, and the precision required for multi-week predictions exceeds what any measurement can provide. Current weather models are reliable to about 10 days, and chaos puts a hard ceiling on how far that can go.

The attractor also has a specific geometric property: it's a strange attractor. All trajectories get pulled toward it and stay on it, but no trajectory ever repeats. The path loops around one wing, switches to the other, and loops again. The number of times it circles each wing before switching is effectively unpredictable. Yet every possible trajectory stays within the same bounded, butterfly-shaped region.

Exploring It

Classic Trajectory

Draws the path through 3D phase space step by step, with glowing heads at the drawing front, while the camera slowly orbits. The path spirals around one lobe, switches to the other at irregular intervals, and never retraces itself.

What You're Seeing

The visualization plots the system's state as a point in three dimensions (x, y, z) and draws the trail it leaves behind. The two "wings" correspond to two unstable equilibrium points that the trajectory orbits without settling on. Each loop tightens toward the center of a wing, then gets flung across to the other one.

The switching pattern looks random but isn't. It's governed entirely by the equations. If you ran two simulations with initial conditions differing by 0.0001, they'd look identical at first, then abruptly diverge into completely different switching sequences.

Technical Implementation

The visualizer integrates the Lorenz equations in JavaScript with a fourth-order Runge-Kutta method and a time step of 0.005, which keeps the trajectory accurate over long runs. (Simpler methods like Euler integration accumulate error quickly in chaotic systems, which defeats the point.) It follows three trajectories from different starting points and discards the first 1,500 steps of each, so only the attractor itself is drawn. Changing σ, ρ or β recomputes the whole attractor.

Depending on the quality setting, between 12,000 and 200,000 points are kept in a fixed-size buffer that is reused whenever the attractor is recomputed. They are drawn with Three.js (WebGL) as thin lines with a soft glow, blended additively so that dense regions shine brighter. Each point takes its colour from the active palette according to how fast the system is moving there, so the slow wing centres and the fast outer swings stand apart.

Further Reading