patterns & shapes · reaction-diffusion
Reaction-Diffusion
(Gray-Scott)
Two chemicals on a flat plate. One feeds, one decays, and the catalyst eats the substrate to make more of itself. Move two sliders across the phase diagram and the same equation produces dots, stripes, mazes, dividing cells, or travelling waves.
source notes
Model level and refs
- Two-chemical Gray-Scott model, not a literal lab simulation. The original reaction-diffusion math goes back to Turing's 1952 morphogenesis paper.
- Update equations and the F/k phase diagram follow Pearson 1993 ("Complex Patterns in a Simple System", Science 261). Diffusion coefficients fixed at Du = 1.0, Dv = 0.5.
- Periodic (toroidal) boundaries: patterns wrap around the canvas edges. Real plates have walls; the periodic version is cleaner for showing pattern stability.
- Internal grid is 192 × 108 cells. Eight substeps per visual frame keep the evolution real-time without dropping resolution.
- Cyan-magenta colour scheme is brand-aligned, not a literal chemistry view. Cyan signals U presence, magenta signals V presence.
- "How zebras get their stripes" is the same class of math, not the same equation. Murray's Mathematical Biology II is the standard cross-link to biological pattern formation.
deeper dive
Two chemicals, five different worlds
Drop two chemicals onto a flat plate. Let them diffuse. Let one eat the other and make more of itself. Then keep adding fresh substrate and slowly removing the catalyst. That's it. Two reactants, four parameters, and the plate spontaneously develops dots, stripes, labyrinths, or travelling waves depending on which corner of the parameter space you're sitting in.
How the rule works
Call the substrate U and the catalyst V. The reaction term is U times V squared: V eats U in proportion to how much V is already nearby. That's the autocatalytic part. The feed rate F slowly tops up U everywhere on the plate. The kill rate k slowly removes V everywhere. Diffusion smears both, but V diffuses slower than U.
In the simulation above, the F slider is replenishment and k is decay. The two sliders together pick a point on what's called the Pearson phase diagram. Move the point and the plate reorganises into a different stable pattern within a few seconds. Try Spots first, then Stripes, then Labyrinth. The transitions are the visual you came for.
Why this model is simpler than reality
Real chemistry runs in three dimensions, with many species, with temperature gradients, with walls. This sim runs in two dimensions on a small grid with periodic boundaries (patterns that walk off one edge come back from the other). The diffusion ratio is fixed. The colour scheme isn't a real chemistry view, just a way to show U and V at the same time. Source notes above carry the full list of cuts.
Where the same pattern shows up elsewhere
The same class of math appears wherever local activation meets longer-range inhibition. Animal coats: zebra stripes, leopard spots, giraffe networks. Seashell pigmentation: travelling-pulse traces frozen in calcium. Sand ripples on a windy beach. Vegetation patches in dryland ecosystems where plants compete for water. Embryonic limb formation: the gradient that decides where fingers go. Different equations in each case, but the same family of mechanism. Local feedback plus diffusion produces structure.
Things to try
Start in Spots. Watch the plate settle into stable dots. Now drag the F slider down past 0.025 and the dots dissolve into wavy stripes within seconds. Drop k below 0.045 and the stripes grow into a labyrinth. Pick the Mitosis preset and watch single dots grow until they split in two. Click and drag on the canvas to paint fresh V; the catalyst will spread into whatever pattern the current parameters allow. Browse the full library for other systems where small parameter shifts cross qualitative boundaries.