A Visual Guide
Strange Attractors
Chaos, beauty, and the mathematics of deterministic systems
← Back to visualizationIntroduction
In dynamical systems, an attractor is a set of states toward which a system tends to evolve. Drop a marble into a bowl, and it settles at the bottom—that resting point is an attractor. But some systems never settle. They wander forever through a bounded region of space, never repeating, never escaping.
A strange attractor is one with fractal structure. Fractals exhibit self-similarity: zoom in and you find structure resembling the whole, ad infinitum. This is distinct from simple geometric shapes like circles or lines. Zoom in, and you find ever more intricate detail. These attractors arise in chaotic systems: deterministic rules that produce unpredictable behavior. The same equations, run twice with nearly identical starting points, will diverge exponentially over time.
Chaos: when the present determines the future, but the approximate present does not approximately determine the future.
Deterministic Chaos
The systems visualized here contain no randomness. Given precise initial conditions, they produce the exact same trajectory every time. Yet tiny differences—a perturbation in the fifteenth decimal place—grow exponentially, making long-term prediction impossible in practice.
This sensitivity is quantified by the Lyapunov exponent. Named after Aleksandr Lyapunov (1857–1918), who developed the mathematical theory of stability. A positive exponent means nearby trajectories separate exponentially—the hallmark of chaos.
The Attractors
Clifford Attractor
The Clifford attractor is a two-dimensional discrete map, discovered by Clifford Pickover. Unlike continuous flows, it jumps from point to point:
yn+1 = sin(b · xn) + d · cos(b · yn)
Four parameters (a, b, c, d) control the shape. Small changes can dramatically alter the attractor's character—from delicate tendrils to dense clouds.
Lorenz Attractor
Edward Lorenz discovered this attractor in 1963 while modeling atmospheric convection. It became the icon of chaos theory—the famous "butterfly" whose wing-beats might seed a distant hurricane. The "butterfly effect" name comes both from the attractor's shape and from Lorenz's 1972 talk: "Does the Flap of a Butterfly's Wings in Brazil Set Off a Tornado in Texas?"
dy/dt = x(ρ − z) − y
dz/dt = xy − βz
The classic parameters (σ = 10, ρ = 28, β = 8/3) produce the iconic two-lobed shape. The trajectory spirals around one lobe, then unpredictably switches to the other.
Chen Attractor
Guanrong Chen introduced this system in 1999 as a "dual" to Lorenz—similar structure, different dynamics:
dy/dt = (c − a)x − xz + cy
dz/dt = xy − bz
Where Lorenz has two symmetric lobes, Chen often produces a more asymmetric, scroll-like structure.
Reading the Visualization
Lyapunov Exponent (λ₁)
The rate at which nearby trajectories diverge. Positive values indicate chaos—small uncertainties grow exponentially. The larger the exponent, the faster the divergence.
We compute this by evolving a tangent vector alongside the trajectory, tracking how much it stretches over time. For continuous flows, this requires integrating the variational equation—a linearization of the system around the current state.
Correlation Dimension (D₂)
The fractal dimension of the attractor—a measure of its geometric complexity. Values between 1 and 2 indicate a structure more complex than a line but simpler than a filled plane.
Computed via the Grassberger-Procaccia algorithm: Peter Grassberger and Itamar Procaccia, "Characterization of Strange Attractors," Physical Review Letters, 1983. we count how many pairs of points lie within distance r of each other, then see how this count scales as r shrinks.
Color Mapping
Points are colored by a blend of two quantities: velocity magnitude (how fast the trajectory moves through that region) and visit density (how often the trajectory passes nearby).
The "Color Mix" slider controls the balance. High velocity regions tend toward warmer colors; high density regions glow brighter.
How It Works
Numerical Integration
The continuous systems (Lorenz, Chen) are integrated using the fourth-order Runge-Kutta method (RK4). This classic algorithm evaluates the derivative at four points per step, combining them to achieve high accuracy:
k₁ = f(t, y)
k₂ = f(t + dt/2, y + k₁·dt/2)
k₃ = f(t + dt/2, y + k₂·dt/2)
k₄ = f(t + dt, y + k₃·dt)
y_next = y + (k₁ + 2k₂ + 2k₃ + k₄) · dt/6
Kernel Density Estimation
Rather than simply plotting points, we estimate the continuous density of the trajectory using kernel density estimation (KDE). Each point contributes a Gaussian "blob" to a density field; overlapping blobs accumulate to reveal the attractor's invariant measure. The invariant measure describes the long-term statistical distribution of the trajectory—where it spends its time, weighted appropriately.
The bandwidth parameter controls the blob size—smaller values reveal finer structure but more noise; larger values smooth the result.
The Variational Equation
To compute Lyapunov exponents for a continuous flow, we track how infinitesimal perturbations evolve. If δ is a small displacement from the trajectory, it evolves according to:
where J is the Jacobian matrix—the matrix of partial derivatives of the flow. This linear equation is integrated alongside the main trajectory using the same RK4 scheme.
References
- Nonlinear Dynamics and Chaos. Westview Press, 2015.
- "Deterministic Nonperiodic Flow." Journal of the Atmospheric Sciences, 1963.
- "Characterization of Strange Attractors." Physical Review Letters, 1983.
- Chaos and Time-Series Analysis. Oxford University Press, 2003.
- "Yet Another Chaotic Attractor." International Journal of Bifurcation and Chaos, 1999.