Abstract. The sandpile model [1] is a cellular automaton, that, in spite of its trivial update scheme, shows behaviour present in a multitude of biological relevenat systems. Prominently, the system exhibits self-organized criticality.
Consider a finite 2d-grid, where grains of sand are droppped on one of the cells. If a cell crosses a threshold value of grains it can hold, like a real sandpile, it topples and distributes one grain of sand to each neighbouring cell.
At first introducing some notation: The whole grid consists of $N \times N$ cells with $z_{n,m}$, $n, m \isin [1, N]$, sand grains on them. The threshold value is $z_{c}=3$ for the 2d-grid. The whole system is then updated as follows:
Each step, one grain of sand is dropped on a cell,
\[
z_{n,m} \rightarrow z_{n,m}+1
\]
If $z_{n,m}>z_{c}$, the pile topples and sand grains are spread to the nearest neighbouring cells,
\[
z_{n,m} \rightarrow z_{n,m}-4 \\
z_{n \pm 1,m} \rightarrow z_{n \pm 1,m}+1 \\
z_{n,m \pm 1} \rightarrow z_{n,m \pm 1}+1
\]
The total amount of sand in the system is not conserved, because of open boundary conditions: A cell toppling at the boundary drops grains of sand out of the system.
The system reaches critical configurations on its own, meaning the next addition of a grain leads to the pile toppling over, creating potentially an avalanche
of sand that travels through the system until the system reaches another stable configuration. The size of these avalanches differ from only one cell topppling over
to sand travelling over the whole system in a chain of topplings. These critical configurations are reached starting from arbitrary starting conditions,
which can be visualized with the following simulation of the model. Thus the sandpile model exhibits self-organized criticality.
Clicking on one of the cells of the grid lets you choose the position on which the sand is added to the system, turning the chosen cell grey until the simulation starts.
If no cell is chosen, the sand is added to the center cell by default. The color of the cells determine the amount of grains they hold: white, yellow, orange, red for zero, one, two, three grains respectively.
If the grains of sand should be added manually one at a time, switch the corresponding checkbox: Now each click on a cell adds one grain to that cell.
If the grains of sand should be added to random cells, switch the corresponding checkbox: The added grains are now distributed randomly over the grid.
Note: If both boxes are checked, clicking the grid anywhere adds a grain of sand randomly to one of the cells.
Instead of starting with an empty grid, it can be advantageous to either start with a random state, where every cell has a random amount of sand grains by checking the
third checkbox, or to speed up the simulation. For that, it is possible to skip the drawing simulation steps by adjusting the slider: skip = 1 is the default setting, where
every simulation step is shown. For higher skip values, only every specified simualtion step is explicitly drawn on the grid. Both possibilities enable the observation of
later states of the system.