The Hodgkin-Huxley Model
Computational Neuroscience
A neuron fires action potentials — sharp, stereotyped, all-or-nothing voltage spikes that propagate along its membrane. The reason it does that, and the math of how, was worked out by Hodgkin and Huxley in 1952 from voltage-clamp experiments on the giant axon of a squid. They got the Nobel Prize. The model they wrote down is still the canonical starting point for computational neuroscience, and most of what comes later in this section is going to build on it.
This post is on the longer side. The payoff at the end is an interactive simulator of the 1952 equations and an understanding of why each piece of the model is there.
The biological starting point
A neuron's membrane is a phospholipid bilayer studded with proteins. The proteins that matter for HH are voltage-gated ion channels — pores that open and close depending on the local membrane voltage. Two channel types do most of the work: sodium channels (carry from outside into the cell, depolarizing the membrane), and potassium channels (carry from inside out, repolarizing). A small "leak" current handles everything else the model isn't tracking explicitly.
The membrane itself behaves like a capacitor — charge accumulates on its faces, separated by a thin insulating layer of lipid. Current flowing across the membrane changes the voltage across it. That's the entire physical setup. The rest of the model is quantifying the conductances.
The voltage equation
Treat the membrane as a capacitor in parallel with three conductances (one per ion species, plus leak). Kirchhoff's current law says current in = current out:
is the membrane capacitance, about for biological membranes. is whatever current is being injected — in an experiment, through a microelectrode; in a real neuron, from synaptic input. , , are the three ion currents. The entire game is figuring out how those currents depend on .
The three currents
Each current is Ohmic in form. Conductance times the voltage difference from that ion's reversal potential — the voltage at which the diffusion-driven flux exactly cancels the electric-field-driven flux for that ion:
For the leak channel, which doesn't gate, is just a constant — about . The interesting case is sodium and potassium, where the conductance itself depends on voltage. That's what makes the action potential possible.
Gating variables
HH's central move was the introduction of gating variables. Each channel population's conductance is written as a maximum conductance (when every channel is open) multiplied by the fraction of channels currently open — a fraction that is itself a function of voltage and time.
For the sodium channel, two gating variables. is an activation variable — opens with depolarization. is an inactivation variable — closes with depolarization, but more slowly. The sodium conductance is:
The cube on reflects the empirical fit — activation curves match a third power much better than first or second power. The mechanistic interpretation, which came later, is that the sodium channel has three subunits each of which has to flip independently for the channel to open. The variable is the brake: once the channel has been open for a while drops, closing the channel even though is still depolarized. That inactivation is the reason action potentials are brief instead of plateaus.
For the potassium channel, one gating variable. is an activation variable — opens with depolarization, no inactivation:
Each gating variable obeys first-order kinetics — relaxing toward a voltage-dependent steady state with a voltage-dependent time constant. With and as voltage-dependent forward and backward rate constants, the equation for is:
and obey analogous equations with their own rate functions. HH measured the rate constants empirically — voltage-clamp the membrane to various potentials, watch the channel populations relax, fit functional forms (exponentials, sigmoids, ratios of linear and exponential functions). The fits aren't pretty, but they're what the squid axon actually does.
The full system
Four coupled ordinary differential equations:
That's the entire model. Standard squid-axon parameters: , , , , , , . Voltage in mV, time in ms.
Try it
The simulator below integrates this four-equation system with forward Euler at . The top panel shows ; the bottom panel shows the gating variables , , and . Use the slider to dial the applied current up and down, or click through the preset buttons for the canonical regimes.
No applied current. The membrane sits at the resting potential around -65 mV — sodium channels mostly closed (m ≈ 0.05), potassium channels partly open (n ≈ 0.32), leak current matched against the rest. Nothing fires.
A few things worth watching for. Click "Repetitive firing" and follow the cycle once. depolarizes, shoots up almost instantly, sodium current pulls toward , crashes (sodium inactivates), rises and the potassium current pulls back down, slowly recovers, the next spike fires. About 10 ms per cycle at this current.
Then drag the slider slowly upward from the "Subthreshold" preset. Below about , the membrane depolarizes but doesn't fire — settles to a slightly elevated steady state. Once you cross the firing threshold (the "rheobase" in neuroscience-speak), regular spiking emerges and the firing rate grows with current. Push the slider all the way to the "Depolarization block" range and the spikes disappear again, because doesn't get time to recover between attempts and the sodium channels stay inactivated. That counterintuitive failure mode is real — it shows up in epileptic neurons under abnormally strong drive.
Numerical considerations
HH is stiff in the technical sense: the gating-variable time constants span about two orders of magnitude across the relevant voltage range. The fastest piece is 's activation, which can have a time constant under during a spike. Forward Euler at works fine for visualization, but at much larger the fastest kinetics get integrated incorrectly and the spike waveform distorts. For research-grade work, people use either explicit methods at smaller , or implicit / exponential integrators that can take larger steps.
A subtle technicality: the rate functions and have the form , which is at and respectively. The L'Hôpital limit gives the right value; the simulator above handles this with an epsilon check. Naive implementations of HH that don't notice this end up with silent NaN propagation at exactly the voltages where the channels are most active.
What HH gets right, and what came after
HH was published in 1952 — three years before the structure of DNA. Hodgkin and Huxley didn't know what an ion channel looked like as a molecule. They inferred its existence and its kinetics from voltage-clamp measurements alone, fit functional forms by hand, and the resulting four-equation system reproduced almost every feature of the action potential they had measured. That the model still holds up, qualitatively and often quantitatively, is one of the achievements of the field.
What the original gets right out of the box: action potential shape, threshold behavior, refractory period, repetitive firing, the firing-rate-vs-current curve, depolarization block. Modern voltage-clamp work has filled in details on top of this — more channel types (calcium, mixed-cation, voltage-dependent leak), more state variables per channel (the simple two-state / picture misses some closed-state dynamics), temperature dependence terms. The HH skeleton accepts all of these as extensions.
What HH doesn't capture without extensions: subthreshold oscillations, spike-frequency adaptation, calcium dynamics coupling to other ion channels, dendritic compartments and spatial propagation, synaptic input. The standard approach in modern computational neuroscience is to start from HH and bolt on whichever extensions the specific question demands. Compartmental simulators like NEURON and Brian use this same backbone with hundreds of channel types and thousands of spatial compartments per cell.
For this section of the site, HH is the foundation. Posts to come will build outward from here: leaky integrate-and-fire as the radical simplification (good enough for network-scale modeling), compartmental models for spatial dynamics along the dendrite and axon, population-level descriptions like Wilson-Cowan, and the biophysics behind synaptic transmission and plasticity. The four-ODE system above is the smallest piece of machinery that captures the spike. Everything bigger uses it as a building block.