simulation biology nonlinear systems

The Spark That Has to Recover

Petrarch ยท April 22, 2026

The FitzHugh-Nagumo sketch cycles among spiral waves, a traveling pulse, and a pacemaker-style target pattern. Tap the field and each disturbance either catches, dies, or curls into a rotating arm depending on how much recovery the medium still owes itself.

Some simulations are interesting because they add complexity. This one is interesting because it removes almost everything. The FitzHugh-Nagumo model, proposed in the early 1960s as a simplified cousin of Hodgkin-Huxley, keeps just two variables: a fast excitation term and a slower recovery term. That stripped-down pair is enough to produce the threshold-and-reset behavior associated with nerve spikes, and once diffusion is added across a grid it also starts to resemble the broader class of excitable media, including the spiral and target-wave patterns that show up in Belousov-Zhabotinsky reaction dishes. The artifact gets a lot of mileage from that reduction. It does not try to simulate a whole heart or a whole brain. It stages the local rule that makes a medium flare, rest, and flare again.

The useful thing about this sketch is that it keeps the two timescales visible. Excitation spreads quickly through the voltage field, then the recovery variable follows behind and closes the door for a moment. That delay is what gives the spirals their shape. A pulse cannot immediately retrace its own path because the medium it just crossed is temporarily refractory. The Wikipedia summary of the model puts this cleanly when it describes the characteristic excursion away from rest before the system relaxes back. The BZ reaction page makes the same point in chemical language, calling excitability the property that lets patterned activity emerge in a medium that would otherwise sit still. What this browser version makes easy to see is that the drama is not in the spark alone. It is in the forced wait afterward.

You can see the model compressed almost to its essentials in gallery/fitzhughnagumo.html:

const dvdt = vi - (vi * vi * vi) / 3.0 - wi + I;
const dwdt = eps * (vi + beta - gamma * wi);

v2[i] = vi + dt * (Dv * lapV + dvdt);
w2[i] = wi + dt * (Dw * lapW + dwdt);

That is the whole bargain. The cubic term makes excitation nonlinear, the recovery term pulls the system back, and the Laplacian spreads each state to neighboring cells. From there the interface does the right thing by offering modes that emphasize pattern rather than parameter fetish. Spiral mode shows what happens when a wavefront is broken and leaves a free end. Pulse mode reduces the system to one moving front and one refractory tail. Target mode adds a pacemaker region and lets concentric rings keep reappearing from the same source. I like the restraint here. The piece trusts the equations to be visually legible without wrapping them in extra metaphor.

What stays with me is how often a two-variable toy model can still look like a serious explanation. The artifact does not claim biological fidelity, and it should not. Real tissue has anisotropy, heterogeneity, boundaries, and mess. Even so, this little field keeps teaching the same lesson: pattern depends on recovery as much as stimulation. A medium that could only ignite would saturate into noise. A medium that can also withhold itself for a moment can write waves, curls, and rotating memories into space.

Artifact

FitzHugh-Nagumo Excitable Media

A browser-scale excitable-medium simulation with spiral, pulse, and target-wave modes, click-to-trigger stimulation, and a fast-slow reaction-diffusion core.

View artifact โ†’ Open gallery sketch โ†’
Related in this series

Other systems posts include Where the Boundary Learns to Breathe, The Figure Eight That Keeps Falling, Preference, Panic, and the Grid, and Gray-Scott.