Reaction-Diffusion Pattern Simulator



0.65
0.25
0.01
0.045
1.0

Purpose

Reaction-diffusion systems are well-studied in the fields of mathematics, physics, chemistry, and biology. This is not intended to be an authoritative treatment of the topic, but rather a simulator that allows users to explore the effect of different parameters towards the end result of pattern formation, for the purpose of building intuition for how these systems work. For some really in-depth discussion of the effects of parameter choices on pattern formation, as well as a decidedly superior simulator (but with less access to parameter variants), please see this site with classifications of different model outputs, as well as this simulator from Robert Munafo.

Mathematical Model

The simulation is based on the reaction-diffusion system introduced by Alan Turing. It describes two interacting chemical species \( U \) and \( V \), diffusing and reacting according to:

\[ \frac{\partial U}{\partial t} = D_u \nabla^2 U - UV^2 + F(1 - U) \]

\[ \frac{\partial V}{\partial t} = D_v \nabla^2 V + UV^2 - (F + k)V \]

Key Terms

Reaction Conditions

The "activator" \(U\) does two things:

The "inhibitor" \(V\) does two things:

For each time step \(dt\), at each position in the grid (\(i ,j\)), the concentrations of \(U\) and \(V\) are calculated according to the chosen parameters through the equations above. The colormap for this simulation is grayscale, corresponding to low \(U\) = black, high \(U\) = white.

The initial state is a field of random values for \(U\) and \(V\), with a central enrichment for \(V\) > \(U\).

Numerical Approximation

The Laplacian \( \nabla^2 \) for \(U\) and \(V\) is approximated using a 9-point stencil that models for a central position (\(i,j\)) at time n, the redistribution of \(U\) or \(V\) due to diffusion at time n + 1:

\[ \nabla^2 U_{i,j} \approx \frac{1}{\Delta x^2} \left[ 0.2 \left( U_{i+1,j} + U_{i-1,j} + U_{i,j+1} + U_{i,j-1} \right) + 0.05 \left( U_{i+1,j+1} + U_{i+1,j-1} + U_{i-1,j+1} + U_{i-1,j-1} \right) - 1.0 U_{i,j} \right] \]

The system is evolved using the Euler method with a time step \( \Delta t \).

Pattern Formation

By adjusting \( D_u, D_v, F, k \), we can generate stripe, spot, or labyrinth patterns. These emerge when the diffusion and reaction terms compete to create instability.

Some Example Parameters

Note, this script is not optimized to be amazing. There are conditions that will cause the simulation to freak out. Freak outs include a rapidly-expanding black diamond, as well as stuff that looks like a pulsating checkerboard pattern. If this happens, reset the simulation (reload the page) and try a different set of parameters.

It is a well known feature of reaction-diffusion models that the acceptable parameter space for forming 'neat' patterns is limited. Small changes in \(F\) or \(k\) can yield major changes in patterns given a fixed \(D_u\) and \(D_v\). What follows is an example exploration of this parameter space, given the initial default conditions. We will hold the diffusion (\(D_u, D_v\)) parameters constant, and just introduce adjustments to \(F\) and \(k\) to see how that affects the system. Users can do this, but it is also suggested that users explore different diffusion constants and try to find similar (or unique) behaviors.

The simulation defaults to conditions that yield unstable waves of V, initiating with an expanding ring that degrades to wavelets when it hits the boundary of the simulation. (\(D_u\): 0.650, \(D_v\): 0.250, \(F\): 0.010, \(k\): 0.045).

Next, if you add five to each of the parameters \(F\) and \(k\) (0.015, 0.050), then this generates a pulsating collection of beans. This is still an 'unstable' pattern.

If you next adjust \(F\) to 0.020, then we begin to get more stable, 'lined' patterns.

However, further adjustment of \(F\) to 0.025 results in a highly unstable pulsating pattern.

Next, adjusting \(k\) to 0.055 yields a slow-developing 'labyrinth' pattern.

Subsequently, adjusting \(F\) to 0.030 yields a set of concentric rings that compress into mostly concentric squares with a few break-throughs.

Adjusting \(k\) to 0.060 now gives a new pattern, a mixture of dots and worms that appear stable on short timescales, but are probably oscillating between fusion and fission over longer timescales.

((And so on and so forth))... The point is, one way to informally explore this patterning system is to find an operable set of diffusion constants, and to increment between small changes to \(F\) or \(k\) to yield different patterning outputs.

We begin to get dot patterns with (\(F, k\)) of (0.035, 0.065). Upping the \(k\) parameter to 0.070 will yield a slow developing "cell division" pattern.