Skip to main content
⠀⢀⣤⣤⣤⣤⣀ ⠀⠀⢸⣿⣿⣿⣿⣿⣷⡀ ⠀⠀⠘⠉⠉⠙⣿⣿⣿⣷ ⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣧ ⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣆ ⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⡀ ⠀⠀⠀⠀⣴⣿⣿⣿⠟⣿⣿⣿⣷ ⠀⠀⠀⣰⣿⣿⣿⡏⠀⠸⣿⣿⣿⣇ ⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⢻⣿⣿⣿⡆ ⠀⢠⣿⣿⣿⡿⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⡇ ⢀⣾⣿⣿⣿⠁⠀⠀⠀⠀⠀⠈⠿⣿⣿⣿⡇
Background image

Lorenz Strange Attractor

In this project I explore the Lorenz Strange Attractor in 3D using ThreeJS. The Lorenz Attractor is a dynamical system that exhibits chaotic behavior and is named after Edward Lorenz who discovered it in 1963 while studying weather patterns.

Open demo
  • Math Visualization
  • Research
  • ThreeJS
  • JavaScript
Lorenz Strange Attractor

The Equations Behind the Attractor

The Lorenz Attractor comes from a set of three equations created by Edward Lorenz in 1963. He was trying to simplify how air moves in the atmosphere— specifically how warm and cool air create circular convection currents. What's surprising is that even though these equations are short, they behave in incredibly unpredictable ways. Here are the original equations:

dxdt=σ(yx),dydt=x(ρz)y,dzdt=xyβz.\begin{align} \frac{\mathrm{d}x}{\mathrm{d}t} &= \sigma (y - x), \\[6pt] \frac{\mathrm{d}y}{\mathrm{d}t} &= x (\rho - z) - y, \\[6pt] \frac{\mathrm{d}z}{\mathrm{d}t} &= x y - \beta z. \end{align}

These equations describe how three values

xx
,
yy
, and
zz
change over time. Think of them as tracking the motion of air in a simplified weather model. Each equation depends on the current state of the system and a few constants that control how it behaves. Because the equations are nonlinear and influence each other, the system becomes chaotic and even tiny changes in starting values can lead to big differences later.

To simulate the system on a computer, we don't solve the equations all at once. Instead, we break time into small steps and update the values over and over. This is called numerical integration. A simple way to do it is to rewrite the equations like this:

xn+1=σ(ynxn),yn+1=xn(ρzn)yn,zn+1=xnynβzn.\begin{align} x_{_n + 1} &= \sigma (y_n - x_n), \\[6pt] y_{_n + 1} &= x_n (\rho - z_n) - y_n, \\[6pt] z_{_n + 1} &= x_n y_n - \beta z_n. \end{align}

Whether we use the continuous version or the step-by-step one, the idea is the same. The variables

xx
,
yy
, and
zz
track the system over time. How they change depends on the parameters:
σ\sigma
,
ρ\rho
, and
β\beta
. Here's a simple breakdown of what each one means:

  • σ\sigma
    (sigma) controls how fast the air moves compared to how fast heat spreads. It's like comparing how quickly water stirs versus how quickly it heats up.
  • ρ\rho
    (rho) relates to how strongly the system is heated. When this value gets big enough, things become unstable and interesting patterns emerge.
  • β\beta
    (beta) is a damping factor. It determines how fast the motion dies down, kind of like how thick honey resists movement more than water.

In his original paper, called Deterministic Nonperiodic Flow, Lorenz used:

σ=10, ρ=47019, β=83\sigma = 10, \space \rho = \frac{470}{19}, \space \beta = \frac{8}{3}
These values weren't picked at random. They were chosen because they land the system right in the “chaotic zone”—where the behavior is neither stable nor repetitive. The system doesn't settle, and it doesn't loop. That's what makes the attractor so fascinating to study.

If you run the simulation using those values, the path traced out in 3D looks like a pair of wings. This is the famous "butterfly" shape that gave rise to the phrase "the butterfly effect". Note that this pattern never exactly repeats itself, even if you let it run forever. But it also never flies off to infinity—it stays within a defined shape. That's what we call a "strange attractor", it attracts the motion into a shape, but the motion inside that shape is endlessly complex.

Closing Thoughts

The Lorenz Attractor is a classic example of how simple equations can create complex behavior. You don't need randomness to get unpredictability. If you're curious about math, physics, or just like visualizing beautiful things that come from code, I definitely recommend experimenting with the demo, trying out different parameters, and seeing how the attractor changes. It's a great way to explore the boundary between order and chaos, and to appreciate how even simple rules can lead to incredibly intricate patterns.