Coding Example: Reaction-Diffusion

This lesson covers another case study called "Reaction-Diffusion" based on the Gary Scott model.

Problem Description

Reaction and diffusion of chemical species can produce a variety of patterns, reminiscent of those often seen in nature. The Gray-Scott equations model such a reaction. For more information on this chemical system see the article Complex Patterns in a Simple System (John E. Pearson, Science, Volume 261, 1993).

Let’s consider two chemical species U and V with respective concentrations u and vand diffusion rates Du and Dv.

V is converted into P with a rate of conversion k. f represents the rate of the process that feeds U and drains U, V and P. This can be written as:

Chemical reaction Equations
U+2V3VU + 2V \rightarrow 3V u˙=Du2uuv2+f(1u)\dot{u} = Du \nabla^2 u - uv^2 + f(1-u)
VPV \rightarrow P v˙=Dv2v+uv2(f+k)v\dot{v} = Dv \nabla^2 v + uv^2 - (f+k)v

Based on the Game of Life example, we will try to implement such reaction-diffusion system. Here is a set of interesting parameters to test:

Name Du Dv f k
Bacteria 1 0.16 0.08 0.035 0.065
Bacteria 2 0.14 0.06 0.035 0.065
Coral 0.16 0.08 0.060 0.062
Fingerprint 0.19 0.05 0.060 0.062
Spirals 0.10 0.10 0.018 0.050
Spirals Dense 0.12 0.08 0.020 0.050
Spirals Fast 0.10 0.16 0.020 0.050
Unstable 0.16 0.08 0.020 0.055
Worms 1 0.16 0.08 0.050 0.065
Worms 2 0.16 0.08 0.054 0.063
Zebrafish 0.16 0.08 0.035 0.060

Get hands-on with 1400+ tech skills courses.