This simulation implements the classic 1952 Hodgkin-Huxley (HH) model, a landmark achievement in computational neuroscience that earned Alan Hodgkin and Andrew Huxley the 1963 Nobel Prize in Physiology or Medicine. The model describes how a patch of squid giant axon membrane generates action potentials through the interplay of three ionic currents: a fast inward sodium current (Na+) gated by activation variable m and inactivation variable h, a slower outward potassium current (K+) gated by variable n, and a passive ohmic leak current. These currents are combined via the cable equation Cm dV/dt = Iext − INa − IK − IL, integrated here using the fourth-order Runge-Kutta method with a 0.02 ms time step for numerical accuracy. Switch between Voltage, Gates, and Phase views using the buttons in the control bar, and drag the sliders to explore how injected current, temperature, and conductance magnitude govern neuronal excitability.
The three display modes reveal complementary facets of the dynamics. The Voltage view shows the spike train in a scrolling 150 ms window — raise Iext above roughly 6 µA/cm² to see regular firing, and notice how frequency increases with current (the F-I curve). The Gates view plots all three gating variables simultaneously: m (fast, gold) leaps up during the depolarising upstroke, h (pink) dips to enforce the refractory period, and n (green) rises more slowly to drive repolarisation. The Phase view renders the V–n phase portrait with nullclines: the amber n-nullcline traces where dn/dt = 0, and the pink V-nullcline where dV/dt = 0; their intersection marks the fixed point (resting state), and during repetitive spiking the trajectory circles this point as a stable limit cycle.
What is the Hodgkin-Huxley model?
The Hodgkin-Huxley model (1952) is a set of four coupled differential equations describing how the membrane potential of a neuron changes due to fast sodium (Na+) and delayed-rectifier potassium (K+) currents plus a passive leak conductance. It earned Hodgkin and Huxley the Nobel Prize in 1963 and remains the gold standard of single-neuron modelling.
What are the gating variables m, h, and n?
m is the fast sodium activation gate (opens rapidly on depolarisation), h is the slow sodium inactivation gate (closes after a spike, causing the refractory period), and n is the potassium activation gate (opens slowly to repolarise the membrane). Each follows first-order kinetics with voltage-dependent rate constants alpha and beta derived from the original squid axon voltage-clamp experiments.
How does injected current I_ext trigger spikes?
Below the rheobase threshold (~6 µA/cm²) the membrane returns to rest after a sub-threshold deflection. Above this threshold, depolarisation accelerates Na+ activation faster than inactivation can shut it down, producing a regenerative spike of about 100 mV peak. Increasing I_ext above threshold raises firing frequency — this relationship is the frequency-current (F-I) curve, a fundamental characterisation of neuronal excitability.
Immediately after a spike the h gate (Na+ inactivation) closes and the n gate (K+) is maximally open, so a second spike cannot be triggered no matter how large the stimulus. This absolute refractory period lasts about 1–2 ms and ensures unidirectional propagation of action potentials along axons.
Temperature is incorporated via Q10 scaling: gating rate constants multiply by 3^((T−6.3)/10), where 6.3 °C is the original experimental temperature. Higher temperatures speed up gating kinetics, shortening spike width and increasing maximum firing rate, but they also raise the rheobase threshold. Above about 31 °C the model can enter depolarisation block.
The V–n phase portrait plots membrane voltage against the K+ activation variable n, tracing the limit-cycle orbit during repetitive spiking. The V-nullcline (dV/dt = 0) and n-nullcline (dn/dt = 0) intersect at the resting fixed point. When I_ext is above threshold the fixed point becomes unstable and the trajectory circles around it as a stable limit cycle, representing periodic spike generation.
Na+ conductance provides the inward regenerative current driving the action potential upstroke. Reducing gNa lowers the maximum inward current. Below a critical gNa value the depolarisation can no longer overcome K+ and leak outward currents, converting the excitable state to a stable node — no spikes fire regardless of I_ext.
If current is ramped slowly rather than applied as a step, the h gate has time to inactivate at sub-threshold voltages before the threshold is reached. This progressive Na+ channel inactivation raises the effective threshold, so a slowly rising stimulus can fail to trigger a spike even though the same final current as a step would produce spiking.
The simulation uses the fourth-order Runge-Kutta (RK4) method with a fixed 0.02 ms time step, which is well below the fastest gating time constants (~0.1 ms for m). RK4 provides fourth-order accuracy and excellent stability for the stiff HH equations, giving results indistinguishable from published analytical benchmarks.
Yes. It is the foundation of all conductance-based neuron models. Extensions include multi-compartment models (dendrites + soma + axon), calcium channels, M-currents, and thousands of ion channel types in simulators such as NEURON and Brian2. Large-scale brain projects (Blue Brain, Human Connectome) ultimately trace their single-neuron dynamics back to HH-type equations.