Reaction Diffusion | Diana's Domain

Reaction Diffusion


Reaction diffusion equations describe dynamical systems which consist of reactive substances moving around a space. This page is a home for my interactive RD sim (still under development), as well as some useful project resources.

Interactive Gray-Scott
Reaction Diffusion System

This simulation uses WebGL, with the heavy lifting being done within the fragment shader. A distributed process like this one benefits from the parallelism afforded by the GPU. Because the rules of the system's development are locally applied, having separate processing threads dedicated to these small areas is especially useful.

The immediate future state of each cell/pixel depends not only on its current state and the parameters of the system, but the states of its neighbors as well. While this would be trivial to handle on a CPU, it is a little more complicated to have some kind of memory within a GPU shader. In order to have information about the system's current state while calculating the next one, this simulation uses WebGL Framebuffer Objects to write the color information of the states to textures which can be both sampled and displayed.

The simulation currently has behavior similar to the 'canonical' Gray-Scott parameter scheme as first detailed by Pearson, but doesn't recreate many of the popular RD patterns expected at certain values. Presumably the problem involves some kind of numerical error. Debugging shaders is tricky since you can't exactly query the variables.


Parameter Maps
Left: Current simulation results
Right: Expected behavior in Pearson's scheme (source: Robert Munafo)

As can be seen by the parameter map comparison, there is some discrepancy between the system's behavior and what would be expected. While unstandard in the meantime, the system still reacts, diffuses, and makes its own interesting patterns:




About Reaction-Diffusion Systems

The earliest reaction diffusion systems dealt with the movement of advantageous genetic mutations through organismic populations. See Fisher's 1937 paper, "The Wave of Advantageous Genes" (Fisher 1937). Turing's 1952 paper "The Chemical Basis of Morphogenesis" looked at reaction diffusion systems as they might relate to embryological development. Today, a commonly implemented formulation of reaction diffusion systems is the Gray-Scott model, found in a 1984 paper. The complex patterns of the Gray-Scott model were looked at in detail in Pearson, 1993.

The Gray-Scott equations are as follows:

$$ \frac{\partial U}{\partial t} = D_U \nabla^2U + UV^2 + f(1-U) $$ $$ \frac{\partial V}{\partial t} = D_V \nabla^2V - UV^2 - V(f+k) $$

where \(U\) is the concentration of the "substrate" chemical and \(V\) is the concentation of the "activator". \(D_U\) and \(D_V\) are the diffusion rates of each substance, while \(f\) and \(k\) are the "feed" rate and "kill" rate respectively. With the diffusion rates and temporal and spatial discretizations held at some favorable constant, \(f\) and \(k\) are typically used as the main changeable parameters to produce a wide variety of patterns

Reaction diffusion systems have been touted as successful models of surface pigmentation, as simulations are able to produce striking resemblances to biological patterns of coloration while also offering a plausible mechanistic explanation (whether they also have a part to play in body-plan development is less clear).

As a timely example, a species of North-American salamander newly documented in 2018 shows surface pigmentation strikingly similar to patterns which arise in reaction-diffusion simulations. Behold Siren reticulata, the Reticulated Siren:


Thanks, Florida!

Resources

Links to relevant resources mostly for my own edification:

Shader Programming
Reaction-Diffusion Systems and Pattern Formation

References

to format
  1. Fischer 1937
  2. Turing 1952
  3. Gray, Scott 1984, 1990
  4. Pearson, Complex Patterns in a Simple System (1993)
  5. Graham SP, Kline R, Steen DA, Kelehear C (2018) Description of an extant salamander from the Gulf Coastal Plain of North America: The Reticulated Siren, Siren reticulata. PLoS ONE 13(12): e0207460. https://doi.org/10.1371/journal.pone.0207460