HomeArticlesMathematics

The Sandpile Model: Self-Organised Criticality & Power-Law Avalanches

A grid slowly fed with grains of sand tunes itself, with no outside help, to the exact tipping point where avalanches of every size become possible.

mysimulator teamUpdated July 2026≈ 8 min read▶ Open the simulation

A grid that tunes itself to the edge of chaos

Drop grains of sand, one at a time, onto a flat grid. Most land quietly and nothing happens. Occasionally a single addition triggers an avalanche that cascades across the entire pile. Nobody tunes the system to behave this way — it tunes itself, driving towards a delicate critical state where avalanches of every conceivable size can occur. This is self-organised criticality, introduced in 1987 by physicists Per Bak, Chao Tang and Kurt Wiesenfeld in a paper that became one of the most cited in physics. The same statistical fingerprint shows up throughout nature: in earthquakes, forest fires, financial crashes and bursts of neural activity, which is why the humble sandpile became a unifying lens for understanding why complex systems so often live on the edge of instability rather than settling into quiet equilibrium.

The toppling rule and the critical height K

Each cell of the grid holds an integer number of grains, its height. Grains are added one at a time to a chosen cell. Whenever a cell's height reaches a critical threshold K, it becomes unstable and topples: it loses K grains and passes one to each of its four orthogonal neighbours. A single toppling can push a neighbour over its own threshold, which then topples too, and a chain reaction — an avalanche — propagates outward until every cell is stable again. Grains that topple off the edge of the grid simply fall away, dissipating the energy injected by each new grain and stopping the pile from filling up indefinitely.

if z(x,y) >= K:
    z(x,y)   -= K
    z(x±1,y) += 1   (each of the 4 orthogonal neighbours)
    z(x,y±1) += 1

P(s) ~ s^(-tau)      avalanche-size distribution, tau ≈ 1–1.5 in 2D

Raising or lowering K changes how much a cell can accumulate before it releases energy to its neighbours, which reshapes the avalanche statistics without changing the qualitative picture: whatever K is set to, sustained random dropping still drives the grid toward its own critical point.

live demo · a system relaxing toward a critical, scale-free state● LIVE

Power laws: why there is no "typical" avalanche

Once the pile settles into its steady state, the size of the next avalanche — measured by the number of toppling events or the area affected — is fundamentally unpredictable, and if you plot how often each size occurs, the distribution follows a power law: P(s) ~ s^(-tau). On a log-log plot this is a straight line spanning many orders of magnitude, and its consequence is profound: there is no characteristic scale. Tiny events involving a single topple are common, while system-spanning catastrophes are rare but never impossible. That scale-invariance is the hallmark of a system sitting precisely at a critical point — the kind of state that, in equilibrium physics, normally demands careful fine-tuning of a parameter like temperature. The sandpile's slow drive of adding grains, balanced against fast relaxation and dissipation at the boundaries, holds the system at criticality automatically, with no external knob turned.

Where the same statistics reappear

Self-organised criticality has been proposed as an explanatory framework across a remarkable range of disciplines. Earthquakes obey the Gutenberg-Richter law, a power-law relationship between magnitude and frequency, mirroring the sandpile's drive-and-avalanche cycle as tectonic stress builds slowly and releases in slips of all sizes. Forest fires often show a power-law relationship between frequency and burnt area, as vegetation accumulates slowly while fire spreads quickly. Research suggests cascades of activity in cortical networks — neuronal avalanches — can follow similar power-law size distributions, prompting the hypothesis that the brain operates near a critical point to maximise information processing. Large price movements in financial markets and the formation of traffic jams have also been studied through this same lens of small local interactions occasionally triggering system-wide cascades.

What the model does not claim

A frequent misunderstanding is that the sandpile model accurately describes a real pile of sand — it does not. Genuine granular materials involve inertia, friction and humidity and tend to produce large quasi-periodic slides rather than clean power-law statistics. Self-organised criticality is also not a single universal law explaining all complex systems; it is one mechanism among several, and a power-law fit alone is not proof of criticality, since other processes can mimic such distributions. Finally, criticality should not be confused with chaos: a self-organised critical system is a statistically stationary state with scale-free fluctuations, not deterministic chaos in the sense of the logistic map or the Lorenz attractor.

Frequently asked questions

What is self-organised criticality?

Self-organised criticality is the tendency of certain slowly-driven dissipative systems to evolve, without any external tuning, towards a critical state poised between order and disorder, where events of all sizes occur following power-law statistics.

Why do sandpile avalanches follow a power law?

Once the pile reaches its critical steady state there is no longer any typical avalanche size. The probability of an avalanche of size s scales as P(s) ~ s^(-tau), so small topples are common and system-spanning cascades are rare but never impossible — the signature of a system sitting exactly at a critical point.

Does the sandpile model describe real sand?

Not precisely. Real granular piles involve inertia, friction and humidity and tend to produce large quasi-periodic slides rather than clean power-law statistics. The model is an abstract metaphor for criticality, not a physical simulation of grains.

Try it live

Everything above runs in your browser — open Sand Pile Model, adjust the critical height K, and watch avalanches of every size ripple across the grid as the system finds its own edge of stability. Nothing is installed, nothing is uploaded.

▶ Open Sand Pile Model simulation

What did you find?

Add reproduction steps (optional)