HomeArticlesHeart Rhythm

Heart Rhythm: FitzHugh-Nagumo, Spiral Waves and the ECG

How a two-variable excitable-medium model produces a normal heartbeat, reentrant arrhythmias and a recognisable ECG trace.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

The heart as an excitable medium

Cardiac tissue is an excitable medium: at rest each cell sits at a stable voltage, but a strong enough stimulus fires an all-or-nothing action potential — a fast depolarization followed by a slower recovery — after which the cell is briefly refractory and cannot fire again no matter how hard it is stimulated. This simulation models that behaviour with the FitzHugh-Nagumo (FHN) equations, a two-variable simplification of the much more detailed Hodgkin-Huxley ion-channel model that keeps the essential excitable dynamics while staying cheap enough to run across a whole 2D sheet of tissue in real time.

live demo · an excitation wave sweeping across cardiac tissue● LIVE
dv/dt = v - v³/3 - w + I     // fast variable: membrane voltage
dw/dt = ε(v + a - b·w)       // slow variable: recovery/refractoriness
// ε ≪ 1 makes w evolve much slower than v — that separation of
// timescales is what produces a sharp spike followed by a slow reset

Excitation, propagation, refractoriness

The fast variable v plays the role of transmembrane voltage: near rest it sits on a stable branch, but once a stimulus pushes it past a threshold, the cubic nonlinearity v − v³/3 makes it shoot up almost instantly — the upstroke of the action potential. The slow variable w then catches up and pulls v back down, and while w is elevated the cell is refractory: it cannot be re-excited, which is exactly what stops a wavefront from immediately re-triggering the tissue behind it and turning a single beat into runaway chaos. Diffusively coupling FHN cells to their neighbours (adding a Laplacian term to the voltage equation) turns a single oscillator into a medium that supports travelling excitation waves — the electrical wavefront that makes real heart muscle contract in a coordinated sequence rather than each cell twitching independently.

Normal pacing vs. reentry

In healthy tissue, a pacemaker region (modelling the sinoatrial node) fires periodically and each wave sweeps across the sheet, followed by the refractory period that guarantees it cannot double back on itself — this produces the regular, single-source rhythm of a normal heartbeat. If tissue is damaged or a wave is fragmented (for instance by hitting an obstacle or a region with altered conductivity) it can curl around into a self-sustaining spiral wave, or reentry: instead of extinguishing after one pass, the wavefront chases its own refractory tail around a loop indefinitely. A single stable spiral corresponds to a fast, regular arrhythmia such as ventricular tachycardia; when a spiral wave itself becomes unstable and breaks up into many small, chaotic wavelets, the tissue-level result is fibrillation — the electrical equivalent of turbulence, and the reason a fibrillating heart cannot pump blood effectively.

From the FHN sheet to an ECG trace

An electrocardiogram doesn't measure any single cell's voltage — it measures the sum of electrical activity across the whole heart as seen from electrodes on the body surface. This simulation approximates that by summing (a weighted version of) the simulated tissue's voltage field over time, which is enough to reproduce the characteristic QRS-like spike each time a wave sweeps through, and to show how a normal periodic sinus rhythm becomes a fast, irregular trace once the tissue tips into spiral-wave reentry or fibrillation — the same qualitative signature that shows up on a real clinical ECG.

Frequently asked questions

What is the FitzHugh-Nagumo model actually simplifying?

It is a two-variable reduction of the four-variable Hodgkin-Huxley model of ion channel currents in a real neuron or cardiac cell. It drops the biophysical detail of individual sodium and potassium channels but keeps the essential fast-spike, slow-recovery structure, which is why it can be diffused across a whole tissue sheet cheaply.

What causes a cardiac arrhythmia in this model?

A normal beat is a single wave from a pacemaker region that dies out after sweeping the tissue once, protected by the refractory period. An arrhythmia appears when a wave breaks and curls into a self-sustaining spiral (reentry); if that spiral itself destabilises into many chaotic wavelets, the result is fibrillation.

Why does the tissue need a refractory period at all?

Without it, a wavefront could immediately re-excite the tissue it just passed through, and a single stimulus would never stop propagating. The slow recovery variable w keeps a just-fired region unresponsive for a short window, which is what allows a wave to travel in one direction and then extinguish instead of looping forever.

Try it live

Everything above runs in your browser — open Heart Rhythm and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Heart Rhythm simulation

What did you find?

Add reproduction steps (optional)