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 \gt 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 \gt 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.
Model assumptions: The mathematical model used here relies on simplifying assumptions such as linearity, homogeneity, and isotropy. Always verify that your real system satisfies these assumptions before applying results directly to design decisions.
Units and scale: Many calculation errors arise from unit conversion mistakes or order-of-magnitude errors. Pay close attention to the units shown next to each parameter input.
Validating results: Always sanity-check simulator output against physical intuition or hand calculations. If a result seems unexpected, review your input parameters or verify with an independent method.
Gray-Scott model with F=0.055, K=0.062, Du=1.0, Dv=0.5 produces leopard-spot patterns within 3000 iterations on a 256×256 grid. Setting F=0.045, K=0.031 instead yields labyrinthine stripe patterns (like zebra coat). Reaction equations: ∂U/∂t = Du·∇²U − U·V² + F·(1−U); ∂V/∂t = Dv·∇²V + U·V² − (F+K)·V. Varying F±0.005 dramatically shifts pattern wavelength; K controls pattern stability.