I have written an applet simulating the Sandpile Model of Bak,Tang, and Wiesenfeld (BTW model).
Sandpile model is a paradigm of Self-Organized Criticality (SOC). It is a cellular automaton whose configuration is determined by the integer variable z(x,y) (the height of the "sand column") at every site of the lattice (here we consider the 2D lattice). The dynamics is defined by the following simple rules:
Starting with an arbitrary configuration and repeating the above procedure brings the system to a stationary state, where for every grain of sand added to the system on average precisely one grain of sand is lost at the boundary. It is clear that the system in this state must have large avalanches. Indeed, addition of a grain of sand at one of the central sites would not cause the loss of sand (which is required by stationarity) unless the chain reaction of topplings isn't able to propagate all the way to the boundary, which is exactly the definition of large (system-wide) avalanche. It turns out that in this delicately balanced steady state the distribution of avalanche sizes (measured as total number of topplings in the avalanche) follows a scale-free power law distribution: P(S) ~ S-1.2 . In other words, the system operates in a critical state (in the sense of equilibrium physics of second order phase transitions). Notice that this critical state is a unique attractor of the dynamical rules, conserving sand everywhere except for the boundaries. Hence the name Self-Organized Criticality.
If your browser supports JAVA you can go and play with a 2D sandpile model, or learn about the origin of 1/f noise in quasi-1D sandpile models, which was the subject of my paper with Chao Tang and Yi-Cheng Zhang.