FitzHugh-Nagumo excitable medium · SA node → AV delay → ventricular depolarisation · live ECG trace
This simulation models the electrical activity of the human heart using the FitzHugh-Nagumo (FHN) equations, a canonical model of excitable media. The heart is represented as a 2D grid divided into anatomical zones: SA node (upper right), atria, an AV node barrier with configurable delay, and ventricles. Each cell obeys
dv/dt = v(v−a)(1−v) − w + I + D·∇²v and dw/dt = ε(v − γw),
where v is the fast membrane voltage variable, w is the slow recovery (refractory) variable, D is the diffusion coefficient controlling conduction velocity, and ε governs refractoriness. The SA node is driven by a periodic current I at the user-selected pacing rate. The impulse travels through the atria, pauses at the AV barrier, then spreads through the ventricular mass via faster conduction analogous to the His-Purkinje system.
The ECG-like trace below the grid is generated by spatially integrating the activator variable over atrial cells (producing the P wave), then over ventricular cells (producing the QRS complex and T wave). This approximates the body-surface potential in a single lead. You can explore clinically relevant rhythms using the preset buttons: reducing refractoriness allows re-entrant spiral waves analogous to atrial flutter; further reducing it with low conduction velocity generates multiple chaotic wavelets resembling fibrillation. Increasing the AV delay above 300 ms mimics a third-degree AV block, decoupling atrial and ventricular rhythms entirely.
The atrioventricular (AV) node introduces a physiological delay of ~120–200 ms before the impulse reaches the ventricles. This pause ensures the atria finish contracting and emptying blood into the ventricles before ventricular systole begins, optimising cardiac output. In this simulation the AV delay is modelled as a refractory barrier between atrial and ventricular zones.
Conduction velocity governs how quickly the excitation wavefront spreads through cardiac tissue. In real hearts it ranges from ~0.05 m/s in the AV node to ~4 m/s in the His-Purkinje system. In the simulator the diffusion coefficient D scales conduction velocity. Slower conduction allows wavefronts to curve more sharply and can produce re-entrant spiral waves mimicking atrial flutter or fibrillation.
After each action potential, cardiac cells enter an absolute refractory period during which they cannot be re-excited. This prevents a new wave from following immediately behind the previous one, ensuring the heart relaxes between beats. In the FitzHugh-Nagumo model, the recovery variable w acts as the refractory gate. Reduced refractoriness allows waves to re-enter recovering tissue, a mechanism underlying ventricular tachycardia.
The ECG-like trace is computed by summing the activator variable v across the atrial region (producing the P wave), then across the ventricular region (QRS complex and T wave). The signal is scaled, slightly smoothed, and scrolled in real time to approximate the appearance of a single-lead ECG strip.
By reducing refractoriness or slowing conduction velocity you can observe re-entrant spiral waves analogous to atrial flutter, atrial fibrillation (multiple chaotic wavelets), and ventricular tachycardia. Increasing the AV delay beyond 300 ms reproduces AV block. High pacing rates beyond tissue recovery time produce 2:1 block, where every second stimulus fails to propagate.
The QRS complex reflects ventricular depolarisation. Because the ventricular mass is much larger than the atrial mass — the left ventricle pumps blood to the entire systemic circulation at ~120 mmHg — the sum of electrical dipoles is far greater, producing a higher-amplitude ECG deflection. The T wave then represents ventricular repolarisation.
The FitzHugh-Nagumo model is a qualitative simplification. Quantitatively accurate models (Hodgkin-Huxley, Luo-Rudy, ten Tusscher) include dozens of ion channels and are far more computationally expensive. The value of FHN is educational: it captures wavefront curvature, refractory collisions, and re-entry with minimal parameters, making it ideal for interactive real-time exploration in a web browser.