An example in Chapter 7 of the scipython book describes the numerical solution of the two-dimensional heat equation for a flat plate with edges held at a fixed temperature. The code below extends this example by considering the solution of the heat equation on the …
Cellular automata (CA) can be used to generate mazes, as described on the LifeWiki. A commonly used algorithm operates like John Conway's Game of Life in that a cell is born if it has exactly 3 neighbours but the survival rule is more liberal: a …
The Belousov-Zhabotinsky (BZ) reaction is a classical example of a non-equibrium chemical oscillator in which the components exhibit periodic changes in concentration. The model The BZ reaction mechanism is complex and still not fully understood, but its essential features can be captured in a simple …
A very simple diffusion simulation can be constructed in two dimensions by following the positions of a number of "particles" which all start off at the centre of a grid of cells. Time is assumed to progress in a series of "ticks": at each tick, …
Wa-Tor is a population dynamics simulation described by Alexander Dewdney in Scientific American (1984): "Computer Recreations: Sharks and fish wage an ecological war on the toroidal planet Wa-Tor". In the above animation, fish (prey) are pink and sharks (predators) are yellow. In this case, the …
A simple model of a forest fire is defined as a two-dimensional cellular automaton on a grid of cells which take one of three states: empty, occupied by a tree, or burning. The automaton evolves according to the following rules which are executed simultaneously for …
Foraminifera are a phylum of mostly marine protists which produce a shell or "test" in the form of a series of linked chambers. One approach to modelling the morphology of foraminifera shells [Tyszka and Topa, Paleobiology 31(3), 522 (2005)] in two dimensions treats the chambers …
A simple model of a polymer in solution treats its monomer units as totally uncorrelated in position (each monomer unit adopts a random orientation with respect to all the others): this is the random flight model. In the following code, a random flight polymer with …