percolation_simulation, a Python code which simulates a percolation system. A rectangular region is decomposed into a grid of MxN squares. Each square may be porous or solid. We are interested in a path of porous squares connecting the top and bottom, or the left and right boundaries. The original MATLAB code was written by Ian Cooper.
Both percolation and diffusion consider systems in which mixing occurs. Diffusion tends to ignore spatial variations in system properties, and concentrates on transport over time due to random fluctuations in position. Percolation concerns properties of an underlying substrate, which may or may not be conducive to fluid transfer through randomly existing channels, or the existence of large connected voids.
Variations of the percolation model can be applied to oil and gas exploration, underground water flow, the transmission of rumors, the spread of a forest fire, the spatial progress of an epidemic, or the chances that an object made of a combination of transmitting and insulating metals will pass a current from one side to the other.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
percolation_simulation is available in a MATLAB version and a Python version.
brownian_motion_simulation, a Python code which simulates Brownian motion in an M-dimensional region.
chuckaluck_simulation, a Python code which simulates the Chuck-a-Luck gambling game.
duel_simulation, a Python code which simulates N repetitions of a duel between two players, each of whom has a known firing accuracy.
fire_simulation, a Python code which simulates a forest fire over a rectangular array of trees, starting at a single random location.
full_deck_simulation, a Python code which simulates a process in which a random card is drawn from a deck of 52, and then replaced, continuing until every card has been seen at least once.
high_card_simulation, a Python code which simulates a game in which you have one chance to select the highest card from a deck.
sir_simulation, a Python code which simulates the spread of a disease through a hospital room of M by N beds, using the SIR (Susceptible/Infected/Recovered) model.
snakes_and_ladders_simulation, a Python code which simulates the game of Snakes and Ladders.
truel_simulation, a Python code which simulates N repetitions of a duel between three players, each of whom has a known firing accuracy.
The original MATLAB code was written by Ian Cooper. This Python version by John Burkardt.