SimulatorEducationEntertainmentDeveloper

Reaction-Diffusion Simulator

Run the Gray-Scott reaction-diffusion equation in your browser. Two chemicals react and diffuse on a periodic grid to grow corals, spots, stripes, mazes, and dividing cells from a single seed.

Presets

Feed (F)0.0545
Kill (k)0.0620

Palette

Speed6× / frame

Click or drag on the canvas to inject chemicals.

The Gray-Scott model

Two chemicals — U and V — share a grid and obey a simple rule: U is constantly fed in, V is constantly removed, and where they meet, V eats U in an autocatalytic reaction. The result is wildly varied life-like patterns from one toy equation.

∂U/∂t = Du∇²U − U·V² + F·(1 − U)

∂V/∂t = Dv∇²V + U·V² − (F + k)·V

F is the feed rate for U, k is the kill rate for V. The Laplacian terms ∇² diffuse each chemical across neighbors. The whole zoo of patterns emerges from the (F, k) plane — small changes here flip the system from stripes to mazes to dividing spots.

Where each preset lives

PresetFkLooks like
Coral0.05450.0620Branching reef
Spots0.03670.0649Leopard print
Maze0.02900.0570Labyrinth walls
Stripes0.02200.0510Zebra bands
Mitosis0.02820.0541Dividing cells
Worms0.05800.0650Wriggling filaments
Bubbles0.09800.0570Soap-like cells

Why it matters — Turing patterns

In 1952 Alan Turing showed mathematically that two diffusing chemicals with very different rates can spontaneously form stable patterns. He proposed it as a mechanism for how a uniform embryo could grow stripes, spots, or limbs. The Gray-Scott model is the most studied modern descendant of that idea, and the same equations describe coral growth, fish skin, and corrosion fronts.

The simulator runs on a periodic torus — what leaves the right edge re-enters on the left — so patterns are seamless and never run out of room to grow.

Things to try

  • Poke the canvas mid-run — click and drag to inject fresh V. Stable patterns will swallow it; unstable ones explode.
  • Sweep F up in tiny steps from a Spots preset and watch the dots stretch into worms.
  • Slow it down to 1×/frame to see individual reaction events; crank to 14× to fast-forward minutes of growth.
  • Switch palette after a pattern settles — same chemistry, different aesthetic, useful for understanding what V level the colours represent.