Bak–Tang–Wiesenfeld Sandpile
Drop grains of sand on a 192 × 192 lattice. When a column reaches four grains it topples — one grain to each of its four neighbours, four grains lost. Sometimes the cascade dies in a single step; sometimes it rips across the entire grid. With no parameter to tune, the system organises itself onto a critical state where avalanche sizes follow a clean power law spanning many decades. Self-organised criticality, live.
The rule
The lattice is a square grid with open boundaries. Each cell holds an integer number of grains $h \in \{0, 1, 2, \dots\}$. Time advances by one of two moves:
Toppling is iterated until no site exceeds the threshold. Grains that spill past the boundary leave the system — this dissipation balances the input and is what allows the pile to reach a stationary state. Everything you see follows from these two lines.
Self-organisation, no tuning
Drive the pile faster and the average height climbs; drive it slower and the height drops. But once you wait long enough at any input rate, the height settles at a single value — roughly h̄ ≈ 2.125 for the open 2D lattice — and stays there. Above this, every added grain is more likely to trigger a system-spanning cascade that dumps mass off the edges; below it, cascades fizzle out and grains accumulate. The critical state is an attractor.
That is the surprise Bak, Tang, and Wiesenfeld pointed out in 1987: ordinary critical phenomena (the Ising model, percolation, the liquid– gas point) require an experimenter to dial temperature or density to a razor-thin value. The sandpile gets there on its own. Self-organised criticality — SOC — is the name they coined.
The exponent
Once the pile is critical, count the cells that topple in each avalanche. Let s be that total. The probability of seeing an avalanche of size s scales as
with no characteristic scale below the finite-size cutoff $s_{\text{cut}}$ $\sim L^D$. The slope $\tau$ for the 2D BTW model is close to 1.2; the live fit on the right starts to lock in once a few thousand avalanches have been recorded. The fit deliberately discards the smallest bin (raw counts) and the last two bins (finite-size cutoff) to avoid the two regimes where the power law breaks down.
The same shape — long-tailed, no preferred scale — shows up in earthquake magnitudes (Gutenberg–Richter), forest-fire areas, neuronal avalanches in cortex, solar flares, and the size of cascading failures in power grids. The sandpile is the simplest model that produces it from local, parameter-free dynamics.
The Abelian property
Dhar showed in 1990 that the order in which you topple unstable cells does not matter: the final stable configuration is identical regardless of toppling order. The simulation here uses parallel relaxation (every cell currently above threshold topples once per round) because that gives a well-defined avalanche duration; sequential relaxation gives the same size and the same final state but a meaningless lifetime.
What you are looking at
The base colour encodes height — dark for empty cells, accent cyan for h = 3 (one grain shy of toppling). Cells that toppled in the most recent avalanches glow warm; the colour decays each frame, leaving a ghost of the cascade footprint. After a few minutes the pile looks almost uniformly bright cyan with sparse dark cracks: the SOC attractor is densely packed near the toppling threshold, exactly as a critical system should be.