/ Turing Pattern Simulator
JA EN ZH
Back
Reaction-Diffusion Simulator

Turing Pattern
Reaction-Diffusion Simulator

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.

Gray-Scott Model Float32Array performance Click to interact 5 color schemes
Pattern Presets
Parameters
Feed rate f0.035
Kill rate k0.065
Diffusion Du0.2097
Diffusion Dv0.1050
Speed (steps/frame)8
Color Scheme
Statistics
Step
0
Avg v conc.
0.000
Pattern type
Spots
FPS
--
Actions

Click canvas to inject chemical B

Theory: Turing's Reaction-Diffusion Equations

The Gray-Scott Model

This simulator numerically solves the Gray-Scott model. Two chemical species — A (concentration u) and B (concentration v) — react and diffuse through space.

∂u/∂t = Du · ∇²u − u·v² + f·(1−u)
∂v/∂t = Dv · ∇²v + u·v² − (f+k)·v

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.

Intuition for Pattern Formation

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.

Engineering Applications

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.

💬 Why does Turing's idea still fascinate engineers?

🧑‍🎓
Professor, leopard spots and zebra stripes look completely different — but this simulator uses the same equation for both?
🎓
Exactly. You only tweak f and k by a tiny amount and the whole pattern switches from spots to stripes. Think of it this way: the leopard embryo's skin cells operate in the "spot zone" of parameter space, and the zebra's cells land in the "stripe zone." Same math, different parameter point.
🧑‍🎓
So an animal's genome essentially encodes those two numbers?
🎓
More precisely, genes control the ratio of diffusion speeds of the melanin-inducing molecules during embryonic skin development. Turing predicted this whole mechanism purely mathematically in 1952 — before digital computers existed — and we only confirmed it experimentally with zebrafish in the 2010s.
🧑‍🎓
What about in actual engineering? It feels very biology-oriented.
🎓
It shows up everywhere. Corrosion pitting? That's localized activation vs. passivation — reaction-diffusion. Combustion finger instabilities? Same math. There's even a trend in topology optimization to deliberately trigger Turing instability to design porous scaffold structures for bone implants. The pattern forms itself — you just tune f and k.

What is a Turing Pattern?

🧑‍🎓
What exactly is a Turing pattern? I've heard of leopard spots and zebra stripes, but how can a chemical reaction create something like that?
🎓
Basically, it's a self-organizing pattern that emerges from a simple reaction-diffusion system. In practice, imagine two chemicals—an "activator" and an "inhibitor"—diffusing and reacting. If the inhibitor diffuses faster, it can suppress the activator in some areas, creating spots or stripes. Try moving the "Feed Rate" and "Kill Rate" sliders above to see how tweaking the reaction changes the pattern from a blank state.
🧑‍🎓
Wait, really? So the sliders control the "recipe" for the chemicals? What happens if I crank up the "Feed Rate" all the way?
🎓
Exactly! The "Feed Rate" (F) controls how much of the basic "food" chemical is added. A common case is that a very high feed rate overwhelms the system, and you get a uniform, stable state—no patterns. For instance, in the simulator, set F high and K low, and you'll see the color go solid. The patterns only emerge in a specific "Goldilocks zone" of parameters.
🧑‍🎓
That's fascinating. So the "Kill Rate" is for the inhibitor? How do these two rates work together to decide between spots and stripes?
🎓
Great question! The "Kill Rate" (K) determines how quickly the inhibitor removes the activator. In practice, their ratio is key. A moderate F with a slightly higher K might give you wandering spots, while a different combination creates stable stripes. Try adjusting them slowly together in the simulator. You'll see the pattern morph through phases—it's like tuning into different "channels" of natural design.

Physical Model & Key Equations

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.

Real-World Applications

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.