Simulations and growth

Reaction–diffusion

Two chemicals: one feeds the other, both spread at different rates — and Turing's spots, stripes and coral appear.

  • GPU simulation
  • seamless tile
Open in the editor →

Leopard spots, the stripes of zebras and angelfish, the folds of brain coral, the whorls of a fingerprint: nature keeps drawing the same few motifs. In 1952 Alan Turing proposed a simple mechanism behind many of them: two substances react and spread at different speeds, and an even mixture turns out unstable, breaking up by itself into spots or stripes. This layer runs such chemistry on the graphics card.

How it works

It uses the Gray–Scott model. A is fed in steadily; B eats it and multiplies (A + 2B → 3B) while slowly draining away. Both diffuse, and A spreads twice as fast as B. Each grid cell holds both concentrations; every step averages them over the neighbours (a 3 × 3 Laplacian) and adds reaction, feed and drain.

∂A/∂t = D_A∇²A − AB² + F(1 − A) ∂B/∂t = D_B∇²B + AB² − (F + k)B D_A = 1, D_B = 0.5

Two numbers decide everything: the feed rate F and the kill rate k. “Regime” offers proven pairs, like “coral” (F = 0.0545, k = 0.062) or “mitosis” (0.0367 and 0.0649), where spots divide like cells. “Custom” unlocks “Feed F” and “Kill k”. The grid wraps around a torus, so the result is a seamless tile. “Seed” is what growth starts from: scattered specks, a drop in the centre, a ring or lines. The picture is the concentration of B run through the palette; “Sharpness” crisps the edges and “Relief” lights the field like a height map.

A bit of history

Turing’s “The Chemical Basis of Morphogenesis” (1952) stayed a theory for decades. In 1983–84 Peter Gray and Stephen Scott were modelling something quite practical, autocatalytic reactions in a stirred flow reactor; their equations became the standard playground for patterns. In 1993 John Pearson’s “Complex Patterns in a Simple System” (Science) mapped the (F, k) plane and labelled its pattern types with Greek letters. Real chemical Turing patterns were first produced in a gel reactor in France in 1990, and in 1995 Shigeru Kondo and Rihito Asai showed that the stripes of the angelfish Pomacanthus rearrange as it grows just as reaction–diffusion predicts.

What to tweak

  • In “custom”, move “Kill k” a thousandth at a time: between spots and maze the pattern changes before your eyes.
  • Set “Seed” to “centre”, lower “Steps” and turn on animation to watch the pattern spread from a drop; “Growth speed” is simulation steps per frame.
  • “Detail” at 150–250 gives big juicy spots; 800 and up gives fine lace.
  • “Relief” at 0.5–0.7 with “Sharpness” at 0.8 looks like embossed plastic or reptile skin.
  • It also makes a great mask: put a “Mesh gradient” above and pick this layer as its “Mask”; the coral fills with soft colour.

Parameters

Regime
coral · mitosis · maze · spots · worms · holes · fingerprints · waves · custom
Feed F
Feed rate of chemical A (custom regime)
Kill k
Removal rate of chemical B (custom regime)
Detail
Grid cells across the short side: more makes the pattern finer
Steps
Simulation steps before the picture is done
Seed
noise · centre · ring · lines
Seed density
Sharpness
Relief
Growth speed
Simulation steps per animation frame