All models

MathPets source

Sandpile

multi-phase stepsstaged topplingguarded patch-at defsmemory random dropsfield color ramp
Open in VS Code

The abelian sandpile of Bak, Tang, and Wiesenfeld is the original model of self-organized criticality. Each site holds up to three grains; a fourth makes it unstable, so it sheds one grain to each of its four neighbors, possibly destabilizing them in turn. Without any tuning parameter, the slow drip of grains drives the whole pile to a critical state where avalanche sizes follow a power law.

Here every tick drops grains on the center patch (or a random one, per the drop-mode selector), then a staged pass topples every overloaded patch synchronously: a patch loses four grains if it is toppling and gains one for each toppling four-neighbor, with grains falling off the box edge vanishing forever. Toppling patches flash bright against the indigo-to-sand grain ramp, so avalanches ripple visibly across the board over many ticks.

board · 920 × 920grid · on