The Bak-Tang-Wiesenfeld (BTW) sand pile model, introduced in 1987, is the canonical example of self-organised criticality (SOC): a drive-dissipation system that spontaneously tunes itself to a critical state without any external parameter tuning. Grains are added one at a time to random cells on a grid; whenever a cell accumulates four or more grains it topples, redistributing one grain to each of its four neighbours (grains at the boundary are lost). A single added grain can trigger an avalanche that affects just one cell or propagates across the entire grid — and the distribution of avalanche sizes follows a power law P(s) ∝ s−3/2, with no characteristic scale.
Add grains manually or continuously and watch the colour-coded topple cascades spread across the grid. A log-log plot of avalanche sizes accumulates in real time, revealing the power-law signature of criticality. Compare the fractal-like activity patterns with and without boundary losses.
What is self-organised criticality (SOC)?
SOC describes a class of dynamical systems that naturally evolve towards a critical state — the boundary between order and chaos — without any fine-tuning of external parameters. At criticality, fluctuations of all sizes occur with power-law frequency: no single scale dominates. SOC was proposed by Per Bak, Chao Tang, and Kurt Wiesenfeld in 1987 as a unifying explanation for power-law distributions observed in nature, from earthquake magnitudes (Gutenberg-Richter law) to solar flares and neural avalanches in the brain.
What are the toppling rules in the BTW model?
Each cell (i, j) on the grid holds an integer number of sand grains z(i,j). Whenever z(i,j) ≥ 4, the cell topples: z(i,j) → z(i,j) − 4 and each of its four nearest neighbours gains 1 grain. Boundary cells lose grains that would fall off the edge (this dissipation is essential for the system to reach a steady state). Toppling is repeated iteratively — one topple can trigger its neighbours in a cascade — until all cells have fewer than 4 grains. The entire cascade counts as one avalanche.
Why does the avalanche-size distribution follow a power law?
At the self-organised critical state, the system is scale-invariant: there is no characteristic avalanche size. Small perturbations can be amplified indefinitely because the pile is poised at the edge of stability everywhere simultaneously. This scale-invariance is the hallmark of a second-order phase transition — except that here the system arrives at criticality automatically, without tuning a control parameter. The exponent τ ≈ 1.5 (P(s) ∝ s−τ) is universal for the BTW model in 2D.
The BTW sand pile on a finite grid with open boundaries can be analysed using abelian group theory (the model's toppling rules commute, making it an "abelian sand pile"). Dhar's burning algorithm (1990) efficiently determines whether a configuration is recurrent. In the thermodynamic limit, the model's critical exponents and correlation functions have been derived using conformal field theory, identifying it with a c=−2 logarithmic CFT — one of the most mathematically rich aspects of SOC.
SOC has been proposed for: earthquakes (Gutenberg-Richter law: log N ∝ −bM with b ≈ 1); solar flares (energy distribution power law over 8 orders of magnitude); neural avalanches in cortex (cascades of neuron firing follow P(s) ∝ s−3/2); forest fires (fire size distribution); stock market volatility; and extinction events in palaeontology (Raup's kill curve). In each case the power law spans several decades of size, suggesting a shared underlying mechanism — though whether SOC is the correct explanation remains debated for some cases.
Real sand piles have periodic avalanches with a characteristic size determined by grain shape, friction, and pile geometry — they do not show broad power-law distributions in simple experiments. Physicists sometimes say the BTW "sand pile" is a misnomer. However, a rice-pile experiment by Frette et al. (1996) using elongated rice grains — which have greater geometric complexity — did observe power-law avalanches, providing the closest real-world realisation of BTW SOC.
SOC was originally proposed partly to explain 1/f (pink) noise — power spectra where the power density scales as 1/f^α (α ≈ 1) across many decades of frequency. 1/f noise appears in voltage fluctuations in resistors, heartbeat intervals, music, and river flow levels. The BTW model produces 1/f-like temporal fluctuations as an emergent consequence of its scale-free avalanche dynamics, linking the spatial power law (avalanche size) to a temporal one (frequency spectrum).
The abelian sand pile group has a remarkable identity element: a unique configuration zid such that adding zid to any recurrent state, then stabilising, returns the same state. In 2D the identity configuration displays intricate fractal-like patterns with exact triangular symmetry that emerge purely from the algebraic structure — they are not put in by hand. Generating and visualising the identity on large grids is a serious computational challenge and produces some of the most aesthetically striking images in mathematical physics.
Neuronal avalanches — cascades of local field potentials in cortical slice cultures — obey power laws remarkably consistent with SOC (P(s) ∝ s−3/2), first reported by Beggs and Plenz in 2003. The cortex may self-organise to criticality because the critical state maximises information transmission, dynamic range, and sensitivity to inputs. Disruption of the power law has been associated with seizures (super-critical) and anaesthesia (sub-critical), making SOC a potential neural biomarker.
In ordinary equilibrium phase transitions (e.g., the Ising ferromagnet), criticality occurs at a single precisely tuned temperature Tc. Perturbing T away from Tc destroys criticality. SOC systems instead have a slow drive (adding grains) balanced by dissipation (boundary losses), which acts as an automatic feedback loop: if the system is sub-critical, grains accumulate and increase connectivity until it reaches the critical point; if super-critical, large avalanches rapidly dissipate grains back to criticality.
Yes — a rich family: the Manna model (random toppling direction) has different critical exponents and is thought to be in a different universality class; forest-fire models (Drossel-Schwabl) exhibit SOC through tree growth and lightning ignition; Olami-Feder-Christensen (OFC) model uses continuous real-valued stresses and is the standard SOC model for earthquakes. Each exhibits broad-scale-free dynamics but with distinct exponents, geometry, and universality classes.
This simulator recreates the Bak–Tang–Wiesenfeld sandpile model, the standard example of self-organised criticality. Grains accumulate on a grid, and any cell that reaches a critical height K topples, spilling one grain to each of its four neighbours — an event that can cascade into an avalanche of any size, from a single toppling to one that sweeps across the whole grid. The distribution of avalanche sizes settles into a power law with no natural scale, the hallmark of a system that has organised itself to the edge of stability.
Each cell is colour-coded by its grain count, from near-black (empty) through green, amber and red as it nears the critical height. Toppling cascades ripple outward as bursts of colour, and a live log–log plot beneath the grid tallies every avalanche's size — its roughly straight line is the visual signature of the power law.
Pick a Drop Mode — Centre, Random or Click — to choose where grains land. The Critical height K slider (2–8) sets the toppling threshold, Drop rate (1–50 grains/frame) sets how fast sand is added, and Grid (30×30 to 120×120) resizes the lattice. Use Run/Pause and Reset below, or click the canvas in Click mode to drop a small pile exactly where you point.
When Per Bak, Chao Tang and Kurt Wiesenfeld introduced this model in 1987, they proposed self-organised criticality to explain power laws seen throughout nature — from earthquake magnitudes to solar flares — arising without anyone tuning a parameter.
K sets how many grains a cell can hold before it topples. Raising K delays toppling, letting grains build up locally before an avalanche starts, while lowering it (down to 2) makes toppling — and cascades — begin much sooner.
The simulation uses an open boundary: when a topple sends a grain past the edge, that grain simply leaves the system rather than wrapping around. This dissipation is what lets the pile settle into a steady critical state instead of growing without limit.
Centre always adds grains to the single cell in the middle of the grid, the classic way to grow a sandpile from a point source. Random scatters grains across the whole grid each frame, and Click lets you drop a small pile of twenty grains wherever you point, so you can trigger avalanches on demand.
The plot tracks how often avalanches of each size occur, with both axes on a logarithmic scale. Because avalanche sizes follow a power law, plotting count against size on log-log axes produces something close to a straight line — proof that avalanches of very different sizes obey the same simple toppling rule.
A larger grid gives avalanches more room to spread, so the biggest cascades recorded on a 120×120 grid can dwarf those on a 30×30 grid, though the underlying power-law exponent stays the same. Resizing the grid resets the simulation, since the grain configuration only makes sense at its original size.