HomePhysics & MechanicsAbelian Sandpile — Self-Organised Criticality

⛰️ Abelian Sandpile — Self-Organised Criticality

Drop grains onto a grid: when a cell reaches 4 grains it topples, triggering avalanches with power-law size distribution — the hallmark of self-organised criticality.

Physics & Mechanics3DModerate60 FPS🌍 Earth
sand-pile-model ↗ Open standalone

About this simulation

This simulation models the Abelian sandpile (Bak–Tang–Wiesenfeld) automaton: grains fall onto an 80×80 grid by default, and any cell that reaches 4 grains topples, handing one grain to each of its four orthogonal neighbours in a breadth-first cascade. Repeated grain drops push the grid towards a self-organised critical state, where avalanches span every scale from a single toppling to a cascade covering almost the whole grid. The live histogram bins avalanche sizes on log-log axes, and as the pile matures the bars settle onto the straight line that marks a power-law distribution — the statistical fingerprint of criticality.

🔬 What it shows

Grains are dropped at the centre of the grid; once a cell reaches 4 grains it loses 4 and each neighbour gains 1, and any neighbour this pushes to 4+ topples next, in a breadth-first chain. Grains that would leave the grid edge are simply lost (open boundaries). Colour tracks grain count — near-black for empty cells, brown-grey through steel blue as height rises, white on a cell mid-topple — while four live counters track grains dropped, avalanches, the largest avalanche so far, and total topplings.

🎮 How to use

Drag Size (40–160) to resize and restart the grid. Drop rate (1–20 grains/frame) sets how fast new grains land at the centre, and Topple steps/frame (50–5000) caps how many topplings run per frame, trading speed for smoothness on large avalanches. Click or tap the canvas to dump a cluster of 8 grains at that spot and trigger a localised avalanche there. Pause, Reset and Info sit in the left panel, next to a switch to the Ukrainian version.

💡 Did you know?

The same toppling rule mirrors real cascading events: earthquake magnitudes follow the Gutenberg–Richter power law, forest fires and neuronal firing avalanches in the brain show comparable scale-free statistics, and solar flare intensities cluster the same way. Self-organised criticality is one of the few known mechanisms that produces this behaviour without anyone tuning a control parameter — the system finds its own critical point.

Frequently asked questions

What actually happens when a cell reaches 4 grains?

The cell's count drops by 4 and each of its four orthogonal neighbours gains 1 grain. If that push takes a neighbour to 4 or more, it topples too, in a breadth-first chain that keeps running until every affected cell holds fewer than 4 grains — the whole chain counts as a single avalanche.

Why does moving the grid size slider reset my progress?

Changing Size rebuilds the grid array at the new dimensions (40–160 cells per side), so all statistics — grains dropped, avalanche count, largest avalanche and total topplings — are zeroed and the pile starts empty again.

What's the difference between Drop rate and Topple steps/frame?

Drop rate sets how many new grains land on the centre cell each animation frame (1–20). Topple steps/frame is a processing budget that caps how many individual topplings can run that same frame (50–5000), so a very large avalanche spills its remaining topplings into later frames instead of freezing the page.

Why do clicks on the canvas add 8 grains instead of 1?

Clicking or tapping drops a small cluster of 8 grains at that exact cell in one go, which reliably pushes the local area over the toppling threshold and produces a visible, localised avalanche rather than a single quiet grain that might not topple anything at all.

What should I look for in the avalanche histogram?

The panel bins avalanche sizes on a log2 scale and draws the bars on log-log axes. Early on the bars are ragged and uneven; as more grains accumulate and the pile approaches self-organised criticality, the bar heights line up into a straight line — exactly what a power-law size distribution looks like on that scale.

⚙ Under the hood

Drop grains onto a grid: when a cell reaches 4 grains it topples, triggering avalanches with power-law size distribution — the hallmark of self-organised criticality.

sandpileBTW modelself-organised criticalityavalancheCanvas 2D

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)