Cellular automata (CA) is a interesting mathematical tool that is used to model many natural phenomena such as biological behaviors. One prime example of CA models is it’s use in mathematical biology to model cellular interactions and behaviors by studying cells on a molecular level. In a CA model an individual square may represent a cell or particle on a grid/lattice. These elements can only take up a discrete number of states such as on or off and in a biological sense this can be interpreted as alive or empty.

Like all mathematical models, we want to begin with something simple. One of the most basic cell function is movement or motility. Let’s consider the simplest example where there is only one cell on the lattice and it can move randomly up, down, left or right with equal probability as shown below. For example, the image below shows 1 blue (live/on) cell in the center and 8 empty (off) or unoccupied grids.

This is known as a random walk with no bias. If we let the cell move long enough we see the random cell generate (walk) different random patterns. One example is given below. This simulation was implementation using examples algorithms provided by (Binder, Ross, and Simpson 2012) and (Simpson, Hughes, and Landman 2009).

However, in real life there are normally more than one cell. So let’s increase the number of cells and populate them on the grid. Below is a animated simulation showing random movement of a collection of cells on a lattice.

What is surprising is that by tracking the position of the cells at each column of lattice, Simpson and Binder (Binder, Ross, and Simpson 2012), (Simpson, Hughes, and Landman 2009) showed that at each time step, the averaged density of the cells closely follows the diffusion equation

\[\frac{\partial \rho(x,t)}{\partial t} = D\frac{\partial^2 \rho(x,t)}{\partial x^2}.\]

Here, \(\rho\) is the density of the cells at time, \(t\) and position \(x\). \(D\) is the diffusion coefficient or controls how fast the cells diffuse over time with \(D = 0.25\) in this case.

This equation can be solved numerically using the method of lines with the aid of Matlab’s ODE solvers. The result is given below show that the simulation aligns very closely to the theoretical prediction .

In a later blog we will explore how to solve the diffusion equation numerically using the method of lines in Matlab.

References

Binder, Benjamin J, Joshua V Ross, and Matthew J Simpson. 2012. “A Hybrid Model for Studying Spatial Aspects of Infectious Diseases.” The ANZIAM Journal 54 (1-2): 37–49.
Simpson, Mat J, Barry D Hughes, and Kerry A Landman. 2009. “Diffusing Populations: Ghosts or Folks?” Australasian Journal of Engineering Education 15 (2): 59–68.