Click canvas to inject chemical B
Explore self-organizing patterns using the Gray-Scott model. Adjust just two parameters — feed rate and kill rate — to generate leopard spots, zebra stripes, spirals, and labyrinthine structures. Click the canvas to seed new patterns.
Click canvas to inject chemical B
This simulator numerically solves the Gray-Scott model. Two chemical species — A (concentration u) and B (concentration v) — react and diffuse through space.
The reaction term u·v² represents an autocatalytic reaction: A and B react in a 2:1 ratio to produce more B. The feed rate f controls how fast A is replenished from outside; the kill rate k controls the removal of B.
Because Du > Dv, species A spreads quickly and stays dilute, while B remains locally concentrated. This asymmetry — slow activator, fast inhibitor — is the hallmark of Turing instability. It causes a spatially uniform state to buckle into periodic concentration waves.
Reaction-diffusion equations are used in combustion front analysis, localized corrosion modeling, solidification interface stability, and tissue engineering. Turing instability also serves as a canonical benchmark for testing numerical solvers, and topology optimization researchers exploit the mechanism to generate regular porous lattices.
The Gray-Scott model simulates the concentrations of two chemicals, U (activator) and V (inhibitor), over time. The core idea is that U activates itself and V, while V consumes U. The equations govern how these concentrations change due to reaction and diffusion.
$$ \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 $$$U, V$: Concentrations of activator and inhibitor.
$D_U, D_V$: Diffusion rates (how fast each chemical spreads). Typically $D_V > D_U$.
$F$: Feed rate of the base chemical into U.
$K$: Kill rate, the removal rate of V.
The term $UV^2$ is the nonlinear reaction where V consumes U.
The pattern emerges from an instability. A small, random fluctuation in concentration can grow if the inhibitor diffuses away fast enough to not suppress the activator locally. This is called diffusion-driven instability.
$$ \text{Pattern Condition: } D_V / D_U > 1 $$This condition means the inhibitor must diffuse significantly faster than the activator. It creates a feedback loop: a slight bump in U grows, V is produced and diffuses away, which allows U to grow further in the center but suppresses it at the edges, leading to a defined spot or stripe.
Developmental Biology: Turing's original hypothesis was for morphogenesis—how embryos develop patterns. For instance, the spacing of hair follicles in mammals or the stripes on a zebrafish are believed to be governed by reaction-diffusion mechanisms similar to this model.
Materials Science & Chemistry: Certain chemical reactions, like the Belousov-Zhabotinsky (BZ) reaction, produce oscillating concentric rings and spirals in a petri dish, which are direct experimental examples of reaction-diffusion patterns.
Computer Graphics & Texturing: The algorithms behind this simulator are used to generate realistic-looking animal fur, leopard spots, and zebra stripes in movies and video games procedurally, rather than painting each pattern by hand.
CAE & Simulation: Engineers use these principles to model and understand pattern formation in new materials, such as the self-assembly of nanostructures or the corrosion patterns on metals, which can inform better design and material selection.