Complexity & Emergence — Chaos, Attractors and Self-Organisation

Why does a double pendulum become unpredictable after a few seconds? Why does a logistic map produce fractal structure from a one-line equation? Complexity science reveals how deterministic systems produce apparent randomness — and how order emerges from disorder.

What is Complexity?

A complex system is one in which simple rules at a local level produce rich, unpredictable behaviour at a global level. The rules are deterministic — run the same starting conditions twice and you get the same output. But tiny changes in input produce wildly different outputs after a short time. This is sensitive dependence on initial conditions, the hallmark of chaos.

Complexity is not the same as complication. A complicated system (like a car engine) has many parts but is predictable and reducible. A complex system (like weather, or the brain) has emergent properties that cannot be inferred from the parts alone.

Chaos: The Lorenz System

In 1963, Ed Lorenz discovered that his simple three-ODE weather model could never be predicted beyond ~2 weeks. The system is deterministic but chaotic:

Lorenz equations (weather convection model)
dx/dt = σ(y − x)
dy/dt = x(ρ − z) − y
dz/dt = xy − βz

Classic parameters: σ = 10 · ρ = 28 · β = 8/3

Despite being fully deterministic, two trajectories starting 10−14 apart diverge exponentially — within ~35 time units they are completely decorrelated. The Lyapunov exponent λ ≈ 0.9 for the Lorenz system quantifies this divergence rate.

// Lorenz system — integrated with RK4 function lorenzDerivatives({ x, y, z }) { const sigma = 10, rho = 28, beta = 8/3; return { dx: sigma * (y - x), dy: x * (rho - z) - y, dz: x * y - beta * z }; } // Two nearly identical initial conditions diverge completely by t ≈ 35 const A = { x: 0.1, y: 0.1, z: 0.1 }; const B = { x: 0.1, y: 0.1001, z: 0.1 }; // 0.01% difference in y

Strange Attractors

Lorenz's system never repeats — it traces the famous butterfly shape in 3D state space forever without crossing itself. This is a strange attractor: a fractal set that all nearby trajectories converge toward, regardless of starting point, yet never settle into periodic orbits. Its fractal dimension is approximately 2.06.

Lorenz Attractor
3D butterfly orbit in (x,y,z) state space. Trajectories never repeat; the attractor has fractal dimension ~2.06. Represents convective weather rolls.
Lyapunov Exponent
Measures how fast nearby trajectories diverge. λ > 0 means chaotic (exponential divergence); λ < 0 means stable (trajectories converge). Hard to measure in noisy data.
Fractal Dimension
Attractors occupy between dimensions — the Lorenz attractor is 2D enough to fill space but 3D in parts. Fractal dimension = log(N)/log(1/ε) box-counting formula.
Phase Space
A space where each axis is a state variable (position, velocity, etc.). Instead of tracking time, you track the system's trajectory through all possible states simultaneously.

Bifurcation: How Chaos Is Born

The logistic map x_{n+1} = r·x_n·(1 − x_n) is the simplest equation that produces chaos. It models population with a limited resource: x is fraction of carrying capacity, r is growth rate.

The bifurcation diagram plots stable attractors versus r — it reveals the Feigenbaum constant δ ≈ 4.669, a universal ratio governing how quickly period doubling converges to chaos, found in hundreds of physical systems.

// Bifurcation diagram data generation for (let r = 2.5; r <= 4.0; r += 0.001) { let x = 0.5; for (let i = 0; i < 500; i++) x = r * x * (1 - x); // transient for (let i = 0; i < 200; i++) { x = r * x * (1 - x); plot(r, x); // record attractor points } }

Self-Organised Criticality

Per Bak's sandpile model (1987) shows that many natural systems spontaneously organise into a critical state — without any external tuning. Drop sand grains onto a pile; when the local slope exceeds a threshold, grains avalanche. The avalanche size distribution follows a power law: many tiny avalanches, fewer large ones, and rare catastrophic collapses.

This power-law distribution (1/f noise) appears in earthquakes (Gutenberg-Richter law), forest fires, traffic jams, financial crashes and evolutionary history (extinctions). The system is always near the critical point because sub-critical states attract more input (more sand) and super-critical states collapse back.

Where Complexity Appears on the Site

Interactive logistic map bifurcation diagram. Zoom into the Feigenbaum tree — every period-doubling branch is a self-similar copy of the whole.
Elastic collisions in a bounded arena with a circular obstacle. Trajectories are chaotic — a 10⁻¹⁵ radian difference in launch angle produces completely different long-term paths.
Reynolds' three rules (separation, alignment, cohesion) produce lifelike murmuration from zero global coordination. Global structure emerges entirely from local agent decisions.
Iterated function systems generate exact fractal shapes (ferns, trees) via repeated random affine transformations. The attractor appears regardless of starting point.
Each ant follows local pheromone gradients. The colony collectively finds shortest paths — a self-organised solution to the TSP — with no central controller.
The SIR model has a critical threshold R₀ = 1. Below it, epidemics die; above it, they grow exponentially. This is a phase transition — the hallmark of criticality.

The deep insight: Chaos is not the same as randomness. Chaotic systems are 100% deterministic — but their long-term state is impossible to predict because we will always lack perfect knowledge of initial conditions. This is a fundamental limit on predictability, not a failure of our equations.