How it Works
The Gray-Scott model describes two reacting chemicals U and V on a discrete grid. U diffuses faster and is fed from an external reservoir; V diffuses more slowly and is produced by the reaction U + 2V → 3V. The competition between local activation (V catalyzes its own production) and global inhibition (U is depleted faster than it diffuses back) creates self-organizing spatial patterns.
Each step: compute the Laplacian of each cell using a 9-point weighted stencil, then update U and V simultaneously using the forward Euler method. Multiple steps are taken per animation frame to accelerate pattern formation.
∂v/∂t = Dv∙∇²v + u∙v² - (f+k)∙v
∇²u[i,j] = 0.2∙(u[i±1,j]+u[i,j±1]) + 0.05∙diag - u[i,j]
The color of each pixel encodes the concentration of chemical V: low V appears dark blue, high V appears bright amber or white depending on the selected color map. Clicking on the canvas seeds a small patch of high V concentration, triggering new pattern growth from that point.
Frequently Asked Questions
What is the Gray-Scott reaction-diffusion model?
The Gray-Scott model describes two chemical species U and V that react and diffuse. U is converted to V when they meet: U + 2V → 3V, and V decays at rate k. U is replenished at feed rate f. Depending on f and k, the system produces spots, stripes, spirals, or labyrinthine patterns.
What are Turing patterns?
Turing patterns are spatial patterns that emerge from a reaction-diffusion system where an activator and an inhibitor diffuse at different rates. Alan Turing proposed in 1952 that this mechanism could explain biological pattern formation such as animal coat markings, fish stripe patterns, and organ development.
What do the feed rate f and kill rate k control?
The feed rate f controls how fast chemical U is replenished from an external reservoir. The kill rate k controls how fast chemical V is removed. Different (f,k) pairs produce dramatically different patterns: low f/k gives spots, intermediate gives stripes, high gives worms or mazes.
What are the Gray-Scott PDEs?
∂u/∂t = Du∙∇²u - u∙v² + f∙(1-u); ∂v/∂t = Dv∙∇²v + u∙v² - (f+k)∙v. Here Du and Dv are diffusion coefficients (Du > Dv), ∇² is the Laplacian, f is feed rate, and k is kill rate.
How is the Laplacian computed on a discrete grid?
On a 2D grid, the 9-point stencil with diagonal weights 0.05 and cardinal weights 0.2 is used: ∇²u ≈ 0.2∙(N+S+E+W) + 0.05∙(NE+NW+SE+SW) - u[i,j]. This gives smoother results than the basic 4-neighbor stencil.
Why does reaction-diffusion produce animal coat patterns?
During embryonic development, morphogens diffuse through tissue and react according to activator-inhibitor kinetics. The local-activation long-range-inhibition principle creates regular spacing in spots or stripes that mirror real animal markings like cheetah spots or zebra stripes.
What is morphogenesis?
Morphogenesis is the biological process by which an organism develops its shape. Reaction-diffusion systems are one mathematical model for how simple chemical gradients can create complex, reproducible spatial patterns without any top-down blueprint.
How do diffusion coefficients affect the pattern?
The ratio Du/Dv is critical. If both species diffuse equally, patterns cannot form. The activator (V) must diffuse more slowly than the inhibitor (U). Typically Du ≈ 2∙Dv. A larger ratio produces finer patterns; a smaller ratio makes patterns coarser.
Can reaction-diffusion systems produce chaos?
Yes. Near bifurcation points, reaction-diffusion systems can exhibit spatio-temporal chaos — patterns that continually break up and reform in unpredictable ways. This is related to chemical chaos in the Belousov-Zhabotinsky reaction.
What is the Belousov-Zhabotinsky reaction?
The Belousov-Zhabotinsky (BZ) reaction is a real chemical oscillator where concentrations oscillate between oxidized and reduced states. In a thin layer of liquid, it produces expanding spiral waves — a vivid physical demonstration of reaction-diffusion dynamics.