Percolation

Send questions or comments about the Percolate Program to Jan Tobochnik jant@kzoo.edu

Click on Percolate Program to see an example of the kind of program students in Phys/CS 705 are seeing and writing. This program simulates a simple model of geometric disorder(such as composite materials, porous rocks, and other mixtures). It begins with a lattice of cells which are either occupied or not occupied. The user enters a value for the occupation probability, p. The default value is p = 0.5, which means half the cells will be occupied. Then each time the New Lattice button is pushed a new set of random numbers is chosen for each cell in the lattice. When the Draw Sites button is pushed, the occupied cells are shown in black. Now the user can click on any occupied cell and see the cluster to which this cell belongs. In this way the user can see how the size and number of clusters change as p is changed. At some value of p, there will be one cluster which spans the lattice. Can you guess what value it is? Play with the program and see. Whenever you change p or the lattice size L be sure to press return after making your change. Enjoy!

In the following files you can find all the code used to create this Java Applet as well as the code to convert to a Java Application. The Applet uses the simphyPackage. The classes PercolateApplet (for the Applet) and Percolate (for the application) set up the simulation by providing direction to any buttons pressed on numbers entered into any TextField. The class Lattice then does all the work of drawing pictures of the site percolation lattices, and filling in clusters.

The Applet does not work on my version of Netscape for the Macintosh, but works fine using Internet Explorer and Netscape for Windows. Below are the source listings.

Percolate Class(for application)

PercolateApplet Class()

Lattice Class