HomeArticlesNeural Spike Train

Neural Spike Trains: The Hodgkin-Huxley Model, Gate by Gate

The circuit equations behind a real neuron's action potential — sodium and potassium gating variables, refractory periods and the phase portrait of a spike.

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

The membrane as an electrical circuit

Alan Hodgkin and Andrew Huxley's 1952 model of the squid giant axon is the biophysical ground truth that simpler excitable-medium models like FitzHugh-Nagumo are simplifying. It treats the neuron's membrane as an electrical circuit: a capacitor (the lipid bilayer) in parallel with several variable conductances, one per type of ion channel, each driving current toward its own reversal potential.

C·dV/dt = -[ gNa·m³h·(V-ENa) + gK·n⁴·(V-EK) + gL·(V-EL) ] + I_ext
dm/dt = αm(V)(1-m) - βm(V)m     // Na+ activation gate
dh/dt = αh(V)(1-h) - βh(V)h     // Na+ inactivation gate
dn/dt = αn(V)(1-n) - βn(V)n     // K+  activation gate
live demo · a Hodgkin-Huxley neuron firing a spike train● LIVE

Three gates, one spike

The variables m, h and n are gating variables between 0 and 1, each representing the fraction of a particular type of channel gate that is open, and each relaxes toward a voltage-dependent steady state at its own voltage-dependent rate. A spike unfolds in a strict sequence: depolarisation opens the fast sodium activation gate m, sodium rushes in and drives the voltage up explosively (the upstroke); on a slightly slower timescale the sodium inactivation gate h closes, shutting off that inward current; meanwhile the potassium activation gate n, slower still, opens and drives an outward current that repolarises and briefly hyperpolarises the membrane below rest. That hyperpolarisation, combined with h being closed and slow to recover, produces the refractory period — a short window where the neuron cannot fire again regardless of stimulus strength, which caps the maximum spike rate and enforces the roughly one-directional propagation of a spike down an axon.

From single spikes to a spike train

A constant injected current I_ext above threshold makes the neuron fire repeatedly rather than once, because after each spike's refractory period ends the depolarising current is still there to trigger the next. The Hodgkin-Huxley equations reproduce a well-known experimental relationship called the frequency-current (f-I) curve: firing rate rises roughly monotonically with input current above a threshold — a graded rate code for stimulus intensity built out of all-or-nothing, identical-looking spikes. This is one of the central ideas in neural coding: the shape of every spike is essentially the same, so information is carried in when spikes occur — their timing and rate — not in how big any individual spike is.

Reading the phase portrait

Because the full model has four coupled variables, it's common to visualise its dynamics in a reduced phase portrait — typically voltage V plotted against the recovery variable n (or a similar combination). At rest the trajectory sits at a stable fixed point; a superthreshold stimulus kicks it onto a large excursion — the loop traced out is the spike — before it relaxes back. For sustained superthreshold current the trajectory settles onto a closed loop, a limit cycle, and the neuron fires periodically for as long as the current is applied. Watching the phase portrait alongside the raw voltage trace makes the otherwise abstract idea of an excitable system's threshold and refractory period into something you can literally see as geometry: the shape and size of the loop.

Why the squid axon, and why it still matters

Hodgkin and Huxley worked on the squid giant axon because its unusually large diameter (up to about 1 mm) made it possible to insert electrodes and voltage-clamp it with 1950s equipment — no smaller vertebrate axon could have been measured with the tools available. The mathematical framework they derived from that one species, and the 1963 Nobel Prize it earned, turned out to generalise far beyond it: essentially the same gating-variable structure, with different channel kinetics, underlies action potentials in human neurons, cardiac cells and many other excitable tissues, which is why the equations are still the reference model for spiking neurons today.

Frequently asked questions

What do m, h and n represent physically?

They are gating variables between 0 and 1 for the sodium activation gate (m), sodium inactivation gate (h) and potassium activation gate (n) — each one the fraction of that gate type currently open, evolving toward a voltage-dependent steady state at its own rate.

Why can't a neuron fire again immediately after a spike?

The refractory period. Right after a spike, the sodium inactivation gate h is closed and slow to reopen, and the potassium current has hyperpolarised the membrane below rest, so a second stimulus — even a strong one — cannot trigger another spike until those gates recover.

Why does firing rate, not spike shape, carry information?

Every Hodgkin-Huxley spike has essentially the same amplitude and shape regardless of how far above threshold the stimulus was — it's an all-or-nothing event. What varies with stimulus strength is how often spikes occur, so the nervous system encodes intensity in spike timing and rate rather than in spike size.

Try it live

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

▶ Open Neural Spike Train simulation

What did you find?

Add reproduction steps (optional)