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 known for chaotic behavior, first discovered by Edward Lorenz 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 form circular convection currents. What is surprising is that even though these equations are short, they can behave in very 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. You can think of them as a rough model of how air moves in a simplified weather system. Each equation depends on the current state and on a few constants that shape the behavior. Since the equations are nonlinear and tightly connected, tiny differences in starting values can grow into very different outcomes.

To simulate the system on a computer, we do not solve everything in one shot. Instead, we move through time in small steps and update the values repeatedly. This process is called numerical integration. One 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 is 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 quickly 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 were not picked at random. They place the system in what many people call the "chaotic zone," where behavior is neither stable nor repetitive. The system does not settle into a fixed point, and it does not loop in a perfect cycle. That is what makes the attractor so interesting 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." The pattern never repeats exactly, even if you let it run for a very long time. At the same time, it does not shoot off to infinity. It stays within a bounded shape. That is what we call a "strange attractor": the motion is confined to a shape, but what happens inside that shape remains endlessly complex.

The Demo

I built this demo so you can experiment with the Lorenz system directly in your browser. Try changing the parameters and initial values, then watch how the trajectory shifts. It is the fastest way to get an intuitive feel for how sensitive and beautiful this system can be.

Closing Thoughts

The Lorenz Attractor is a classic example of how simple equations can produce complex behavior. You do not need randomness to get unpredictability, and that is what makes it so fascinating. It has inspired countless studies in chaos theory, weather prediction, and even philosophy. I hope this demo helps you see the beauty hidden in those equations and sparks your curiosity to explore more about dynamical systems and chaos theory.