Sandpile ModelBeta

Pile up sand grains and watch power-law avalanches grow a fractal

This tool is a beta version still being stabilized. Please let us know if a result looks off.

Like the bottom of an hourglass, dry sand falls one grain at a time onto one spot. The pile grows to a fixed slope — the angle of repose, about 35° for dry sand — and from then on a single grain may simply stop, or set off an avalanche that drags hundreds of grains down.

Goal Witness one big avalanche with more than 200 grain slides. Try dumping a bucket and tapping the pile too.

You can prepare with the tools before starting. Press ▶ Start pouring when ready.

Loading the simulation…

Poured
Avalanche size distributionAcross: avalanche size (grain slides) · Up: how often · both log scale
just now
Recent avalanches (bar height = size)
Why avalanches of every size? — Self-organized criticality

① Every grain you pour makes the slope steeper.

② Where the slope passes the steepest it can hold (the angle of repose), a grain slides down; if that grain tips the next patch over its limit too, you get a chain reaction — an avalanche.

③ Avalanches shave the slope, pouring builds it back… With nobody tuning anything, the pile keeps returning to the edge of collapse by itself. That is self-organized criticality.

④ So you can't tell whether the next grain will just stop or bring down the whole slope. Small avalanches are very common and big ones rare, and their frequencies fall on a straight line on a log-log plot (a power law) — the same shape seen in earthquakes, landslides, wildfires and blackouts.

About Sandpile Model

This is a one-dimensional sandpile seen from the side. The floor is divided into columns, and the number of grains in a column is its height. When the height difference (the local slope) between a column and its neighbour exceeds a threshold, one grain slides toward the lower side; if that grain pushes the neighbour past its own threshold, the chain continues. The whole chain is one avalanche, and its size is counted as the number of individual grain slides.

The threshold is the “base threshold” plus a random 0 or 1, redrawn every time a grain leaves that column. With the defaults (base 1, irregularity 0.5) the threshold is 1 or 2 with equal odds — the rule of the Oslo model, which researchers at the University of Oslo built in 1996 to explain their rice-pile experiment. The difference is that grains in the Oslo model only move one way; here they slide toward the steeper side, and either end of the pile can be opened or walled off.

The 1987 Bak–Tang–Wiesenfeld sandpile

The term self-organized criticality (SOC) comes from a 1987 paper by Per Bak, Chao Tang and Kurt Wiesenfeld. They proposed a simple cellular automaton: drop grains one at a time onto a grid, and whenever a cell holds more than a limit, it hands grains to its neighbours. Without anyone tuning a parameter, the system drives itself into a critical state in which avalanches of every size occur, and the avalanche sizes follow a power law with no typical scale. As the paper's title says, the original aim was to explain the 1/f noise seen throughout nature.

Critical behaviour in physics usually needs a parameter such as temperature to be set exactly right. The sandpile is interesting because slow pouring alone keeps the system at that point. If the slope is too gentle, grains pile up and steepen it; if it is too steep, avalanches cut it back down.

Why real sand disappointed and rice worked

Experiments looking for SOC in actual sand mostly failed to find clean power laws. In 1996, Frette and colleagues dropped rice grains one by one into a narrow gap between two glass plates. Elongated rice showed power-law avalanches; rounder rice did not. Long grains lock together in many different ways, so the slope a patch can hold keeps changing.

The same group introduced the Oslo model to capture this: instead of a fixed threshold, each site's critical slope is redrawn as 1 or 2 every time it topples. They reported an avalanche size exponent of about 1.55 (±0.10). Setting this tool's irregularity slider to 0 gives every grain the same threshold, and the pile settles into a regular sawtooth. Comparing the avalanche statistics before and after shows why the randomness matters.

Reading the log–log plot

Each dot on the plot is one size bin, and the bins double in width: [1, 2), [2, 4), [4, 8) and so on. Because the bins differ in width, the tool divides each count by the bin width and plots a density. That makes the dashed line's slope an estimate of −τ directly. Had the raw counts per bin been plotted, the slope would be −(τ − 1) and look much flatter.

Scatter and a drop-off at the right end are expected. With a finite number of columns, no avalanche can be larger than the pile allows (a finite-size cutoff), and the largest bins contain only a handful of events. You need hundreds to thousands of avalanches before the slope settles, which is why the rice-pile scenario asks for 1,000.

The “angle of repose” readout comes from the steady-state slope measured by running this model for a long time. With the defaults the mean threshold is 1.5, but the pile settles at a steeper slope of about 1.71. Sites that draw a low threshold (1) topple right away and redraw, while sites that draw a high one (2) hold the slope up for longer — a known property of the Oslo model, whose slope approaches about 1.73 for large piles. One grain height is half a column width, so the tool shows arctan(1.71 × 0.5) ≈ 40.5°. Pouring 120,000 grains onto a 100-column ramp gives an average slope that matches this, 3–4 degrees steeper than the 37° you would get from the mean threshold. The “Slope” readout measures the pile at this instant, so it swings a degree or two either side just before and after avalanches.

What each scenario is testing

“Hourglass” drops one grain at a time on one spot and asks you to witness a big avalanche of 200 or more slides. “Snowy slope” and “Construction stockpile” reverse the goal: keep material from spilling onto the road. A fence (a column with a raised floor) props up the slope above it, and wetting a column raises its threshold so it holds a steeper face — the same reason damp sand makes a sandcastle.

The “Poke” tool briefly drops the threshold to zero within a radius, forcing loose grains to slide. It is the same idea as the controlled avalanches mountain road crews trigger on purpose so that a small release happens before a large one can build up.

Worked examples

What a slope of −1.55 means in practice

Input
τ = 1.55; compare the 8–15 bin with the 128–255 bin (16× larger sizes)
Output
Density ratio 16^−1.55 ≈ 1/73; count-per-bin ratio 16^−0.55 ≈ 1/4.6

If 460 avalanches of size 8–15 are recorded, expect roughly 100 in the 128–255 range. “Rare” big events turn up far more often than intuition suggests, which is the practical meaning of a power law. The raw counts differ much less than the densities because the larger bin is 16 times wider.

The default angle-of-repose readout

Input
Base threshold 1, irregularity 0.5
Output
Steady slope 1.71 (steeper than the mean threshold of 1.5) → arctan(1.71 × 0.5) = arctan(0.855) ≈ 40.5°

Raise the base threshold to 2 and the steady slope becomes 2.71: arctan(1.355) ≈ 53.6°. One step of threshold is worth about 13 degrees of slope.

How to use it

  1. Choose a scenario and, if allowed, place fences, water or the pour point first.
  2. Press ▶ Start pouring and watch avalanche sizes and the log–log plot.
  3. In Free play, change irregularity and base threshold and compare the distributions.

Key terms

Self-organized criticality
The tendency of a slowly driven system to settle into a critical state on its own, with event sizes following a power law.
Avalanche size
Here, the total number of grain slides between dropping one grain and the pile coming to rest.
Exponent τ
If avalanches of size s occur with frequency proportional to s^−τ, τ is the exponent — the magnitude of the slope on a log–log density plot.
Oslo model
A one-dimensional rice-pile model in which each site's threshold is randomly redrawn as 1 or 2 after every toppling (Christensen et al., 1996).

Frequently asked questions

Are earthquakes and wildfires really like a sandpile?

Earthquake magnitudes (the Gutenberg–Richter law) and wildfire areas also show roughly power-law distributions, so they are often compared with SOC. But a power law alone does not prove a shared mechanism, and the question is still debated in each field.

My slope comes out as −1.3 or −1.8.

With few avalanches the fitted slope swings a lot, and the finite pile truncates the largest events. After several thousand avalanches it tends to drift toward the Oslo model's reported 1.55. This tool is a two-directional variant, so an exact match is not guaranteed.

Can I predict when the next big avalanche will come?

Not in this model. The whole pile sits at the edge of collapse, so an identical grain can stop dead or trigger a large slide. Only the statistical distribution is stable; individual events are not predictable.

What happens if irregularity is 0?

Every column shares the same threshold, the pile becomes a regular staircase, and avalanches turn into orderly runs of grains down the face. A fixed-threshold one-dimensional pile does not produce a power law, which is exactly why the random threshold was introduced.

Sources

Last reviewed:

Privacy and how data is handled