Sand#

Extra Credit

This page is 10 points extra credit

On this page you will simulate a model of sand building up on a table (and the resulting avalanches that it causes).

In this model, sand will be placed on a table which has \(N \times N\) spaces for granules of sand. The granules of sand can be stacked up into columns. Once a column becomes larger then \(k\) granules high, 4 granules of sand slide off the pile with one granule ending up on each of the four neighbors. If the column of sand is on the edge of the table without four neighbors it still ends up with 4 less pieces of sand; the extra sand just falls off the table.

For the first part of this problem, we are going to have sand rain from the sky onto random spots on the table.

This gives us essentially a cellular automata with four rules:

  • Choose a random spot on the table and add a new piece of sand

  • While some column of sand has more then \(k\) pieces:

    • choose a random such column and replace it with \(k-4\) pieces of sand and increase the sand on each of its neighbors by one.

This is not only a cellular automata but also a markov chain (the probability of a new configuration is independent of anything but the current configuration).

Write a simulation which performs this cellular automata. Use \(N=25\) and \(k=4\).

Grading

Measure the following two properties using a window averaging of 100 steps:

  • the number of pieces of sand as a function of time.

  • the size of each avalanch as a function fo time.

  • a snapshot of the sand in equilibrium (i.e. after 2000 steps).

You should get results that look something like this:

sand1.png

Grading

Also choose a single prototype avalanch (preferably a large one) and visualize it.

You should see something like this

sand2.png

(it would be fun to turn this into a video - it shouldn’t be too hard if you look up how animations work in pylab)

The number of avalanches actually follow a power law - i.e. the probability of an avalanch goes as \(s^{-b}\) where \(s\) is the size of the avalanch. You should attempt to figure out the exponent \(b\). The trick to do this is to look at the size \(s\) versus the number of such avalanches on a log-log plot. The slope will be \(-b\).

My graph looks like this:

sand3.png

Grading

Produce this plot and compute \(b\)

There are various other fun (not graded) activities you can do with this model:

  • For the two dimensional system, you can not have sand rain from the sky. Instead, just start with a large lattice (say 200x200) with an extremely tall pile of grains on the center pixel (say 30,000 grains) and just let the avalanches happen. You will get a pretty interest pattern (shown below)

sand4.png

  • You can also go ahead and do a sand-pile model for 1-dimension instead of 2-dimensions. In many ways this is easier to visualize.