[an error occurred while processing this directive]

Sample simulation programs

Much insight can be gained from the examination of relatively simple two-dimensional model systems. The programs in this directory are written to illustrate the evolution of a 2D system of two-state (Ising) or a multi-state (Potts) interacting spins, as well as a "forest fires" model that is well-suited to describing the spatio-chemical Belousov-Zhabotinsky reactions (in the wake of a fire, there is no wood to burn again, until new forest grows in).

The programs are written for the most generic X graphics and should compile on any Unix/Linux systems as is. Simply type make to compile all the executables.

Michael Creutz, creutz at bnl dot gov, is the author of this code.


xising - a two-dimensional Ising model simulator

This program illustrates a Monte Carlo simulation of a simple statistical mechanical system. The Ising model demonstrates ferromagnetism, displaying a second order phase transition from a disordered state at high temperature to an ordered state when cool. The program allows dynamical observation of this system under two simple microcanonical Monte Carlo algorithms.

The system is a two dimensional array of spins, each of which is represented by a bit in a bit map displayed on the screen. Black and white represent the two possible states of a given spin. The energy of the system is entirely determined by nearest neighbor pairs. If two neighbors are the same, then the energy has one value, and if they differ, it is higher by two units.

The display shows the spins in the image labeled "spins." This is above another bit map labeled "changes," representing the spins being changed under the current algorithm. The display has a thermometer to indicate the temperature and various buttons for controlling the updating. The inverse temperature, beta, is displayed above the thermometer. The critical value for beta is exactly known to be 0.5*log(1+sqrt(2))=.44068.... The critical temperature is marked on the thermometer.

See here for more details.

xpotts - for the two-dimensional Potts model

This program illustrates a Monte Carlo simulation of the Potts model. If you have trouble understanding what is going on here, look at xising first. This program allows dynamical observation of the Potts system under a simple microcanonical Monte Carlo algorithms.

The system is a two dimensional array of spins, each of which is represented by one of q possible states. The states are represented by various colors displayed on the screen. The energy is determined by nearest neighbor pairs as well as the value of an applied field. If two neighbors are the same, then the energy has one value, and if they differ, it is higher by one unit. The applied field acts only on color 0, which is red, and gives it a slightly different energy.

See here for more details.

xfires - a simple forest fire automaton

This program simulates forest fires.

On each site of a lattice is either nothing, a tree, or a fire. In one time step a fire spreads to adjacent trees and leaves an empty space. Trees are born in a random matter with a probability of approximately 1/32 per time step. If no fires are active, one is started at a random location. Fires can also be started with the mouse button.

See here for more details.

[an error occurred while processing this directive]