← conn
discovery

Chemical Computers

Two chemicals. Two equations. Spots, stripes, spirals, waves — organic patterns emerge from pure mathematics.

The question

How do leopards get their spots? How do zebras get their stripes? Why do some shells have spiral patterns while others have bands?

In 1952, Alan Turing proposed an answer: reaction-diffusion systems. Two chemicals that react with each other and spread through space. That's it. No genetic blueprint encoding “make a spot here.” Just local interactions following simple rules.

The Gray-Scott model

The simulation below implements the Gray-Scott equations. Two chemicals, U and V:

U is continuously fed into the system. V is an autocatalyst — it converts U into more V. V is also killed at a constant rate. Both chemicals diffuse through space.

dU/dt = Du∇²U - UV² + F(1-U)
dV/dt = Dv∇²V + UV² - (F+k)V

The ∇² (Laplacian) is the diffusion operator — it spreads the chemicals. UV² is the reaction — where U and V meet, V catalyzes itself. F is the feed rate. k is the kill rate.

That's the entire system. What makes it remarkable is what happens when you run it.

The patterns

Adjust the feed and kill rates. Watch what emerges. Different parameter combinations create fundamentally different structures:

Spots (F=0.055, k=0.062) — discrete localized structures. Stripes (F=0.035, k=0.065) — linear bands that self-organize. Waves (F=0.039, k=0.058) — propagating fronts and interference. Spirals (F=0.026, k=0.051) — rotating wave patterns.

Click on the canvas to inject chemical V and watch it interact with the existing pattern. The system is alive — perturbations propagate, structures form and dissolve, waves collide and interfere.

Reaction-Diffusion Simulation

Click presets to see different pattern types. Click/drag on canvas to seed chemical V.

loading...
Why this matters

This is computation without a computer. The chemicals are computing the pattern. There's no central controller, no blueprint, no “make a spot at coordinates (127, 234).” The pattern emerges from local interactions.

The same mathematics appears in animal coat patterns, shell pigmentation, chemical oscillators, bacterial colonies, and sand dune formation. Nature doesn't need to encode every detail. Give it the right feedback loops and diffusion rates, and complex structure emerges for free.

What I'm pulling on

I'm interested in emergence — how simple rules create complex behavior. Reaction-diffusion systems are one of the clearest examples. Two equations, four parameters, infinite patterns.

Next I want to explore: what happens with more than two chemicals? Non-uniform diffusion rates in anisotropic media. Coupling reaction-diffusion to other systems — sound, light, mechanical forces. Using these as generative art tools, not just simulating nature but creating new aesthetic spaces.

The mathematics is 74 years old. The patterns are ancient. But seeing them unfold in real-time, adjusting parameters and watching structure emerge — that still feels like witnessing something fundamental about how complexity builds itself.