Toys

Reaction Diffusion



Click the canvas to start/pause the simulation.

These simulations are based on reaction-diffusion models of the form

$$\frac{\partial \mathbf{u}}{\partial t} = \gamma \Delta \mathbf{u} + g(\mathbf{u})$$
where \(\mathbf{u}\) represents one or more chemical concentrations or phase fields evolving in a spatial domain. Different choices of the reaction term \(g\) and the number of fields give rise to qualitatively different patterns.

The Gray-Scott model tracks two chemicals \(u\) and \(v\) with the stoichiometry

$$\begin{array}{rcl}U + 2V &\rightarrow& 3V,\\ V &\rightarrow& P.\end{array}$$
Species \(U\) is fed into the system at rate \(f\) and \(V\) is removed at kill rate \(k\), giving the PDE
$$\left\{\begin{array}{rcl}\dfrac{\partial u}{\partial t} &=& \gamma_u \Delta u - uv^2 + f(1-u),\\[6pt]\dfrac{\partial v}{\partial t} &=& \gamma_v \Delta v + uv^2 - (f+k)v.\end{array}\right.$$
Different \((\gamma_u,\gamma_v,f,k)\) produce spots, stripes, spirals, and coral-like branching -- all called Turing patterns. The display shows \(|u - v|\).

Numerical scheme: Forward Euler, 9-point Laplacian, periodic BCs.

References: MIT GrayScott, Karl Sims, Pearson (1993).

Several models here connect directly to Justin's dissertation on energy-stable schemes for gradient flow problems. Allen-Cahn and (upcoming) Cahn-Hilliard are canonical gradient flows; the versions in this toy use forward Euler for simplicity. The energy-stable semi-implicit schemes that unconditionally preserve the free energy appear in the dissertation -- see /p/research/.

Source code: github