|
|
||
|
This note provides an interactive, visual simulation of the Hodgkin-Huxley model of neuron action potentials. The Hodgkin-Huxley model, developed by Alan Hodgkin and Andrew Huxley in 1952, describes how electrical signals are generated and propagated in neurons through the opening and closing of ion channels. The simulation visualizes three neurons connected in a chain (A → B → C). Each neuron is modeled using the four-variable Hodgkin-Huxley equations, which describe the dynamics of membrane potential (V) and three gating variables: sodium activation (m), sodium inactivation (h), and potassium activation (n). When you click "Inject Stimulus", a current pulse is injected into Neuron A, triggering an action potential that propagates through the chain. The membrane animation shows ion channels (Na+ and K+) embedded in the lipid bilayer. The channels open and close based on the gating variables: Na+ channels open when m³h is high, and K+ channels open when n⁴ is high. Ions flow through open channels, and you can see this visually as colored dots moving through the channels. Numerics: the simulation uses Forward Euler numerical integration to solve the differential equations. The time step is kept small (0.01 ms) for numerical stability, and multiple physics steps are computed per frame to maintain smooth animation. The synaptic coupling between neurons converts voltage from one neuron into input current for the next neuron in the chain.
Sections Math behind the SimulationThe simulation implements a chain of three Hodgkin-Huxley neurons (A → B → C), where each neuron is modeled by four coupled differential equations. The complete system consists of 12 coupled differential equations (4 per neuron × 3 neurons) that are integrated simultaneously each time step. State Variables Each neuron has four state variables:
For the three-neuron chain, we have 12 state variables total:
Ionic Currents The total ionic current through the membrane is the sum of three components: Iion = INa + IK + IL
where:
The channel openness probabilities are:
Differential Equations for a Single Neuron For each neuron, the membrane potential evolves according to: Cm · dV/dt = Iinput − Iion
where Cm is the membrane capacitance and Iinput is the input current (injected stimulus or synaptic input). The gating variables evolve according to: dm/dt = αm(V) · (1 − m) − βm(V) · m
dh/dt = αh(V) · (1 − h) − βh(V) · h dn/dt = αn(V) · (1 − n) − βn(V) · n where α and β are voltage-dependent rate constants that determine how fast the gates open and close. Complete System: 12 Coupled Differential Equations The simulation integrates all 12 equations simultaneously. Here are the explicit equations for all three neurons:
Neuron A:
Cm · dVA/dt = Iinput,A − Iion,A dmA/dt = αm(VA) · (1 − mA) − βm(VA) · mA dhA/dt = αh(VA) · (1 − hA) − βh(VA) · hA dnA/dt = αn(VA) · (1 − nA) − βn(VA) · nA Neuron B: Cm · dVB/dt = Iinput,B − Iion,B dmB/dt = αm(VB) · (1 − mB) − βm(VB) · mB dhB/dt = αh(VB) · (1 − hB) − βh(VB) · hB dnB/dt = αn(VB) · (1 − nB) − βn(VB) · nB Neuron C: Cm · dVC/dt = Iinput,C − Iion,C dmC/dt = αm(VC) · (1 − mC) − βm(VC) · mC dhC/dt = αh(VC) · (1 − hC) − βh(VC) · hC dnC/dt = αn(VC) · (1 − nC) − βn(VC) · nC where Iion,i = INa,i + IK,i + IL,i is the total ionic current for neuron i (i ∈ {A, B, C}). How the Neurons Get Coupled The coupling constant κ appears in the input current terms Iinput,B and Iinput,C, which directly affect the voltage equations for neurons B and C:
This makes the 12 equations coupled: while each neuron's gating variables (m, h, n) depend only on that neuron's own voltage, the input currents Iinput,B and Iinput,C depend on the voltages of other neurons, creating interdependencies across all 12 equations. Synaptic Coupling Between Neurons The neurons are coupled through synaptic connections in a chain (A → B → C). The input current for each neuron is:
Iinput,A = Istimulus (injected stimulus current)
Iinput,B = κ · max(0, VA − Vrest) / 15.0 (if VA > −55 mV) Iinput,C = κ · max(0, VB − Vrest) / 15.0 (if VB > −55 mV) where:
This creates a unidirectional chain where:
The coupling makes the system of 12 equations coupled: while each neuron's internal dynamics (m, h, n) depend only on its own voltage Vi, the input currents Iinput,i depend on the voltages of other neurons, creating interdependencies. Rate Constants The rate constants are functions of voltage:
Numerical Integration The simulation uses the Forward Euler method to integrate all 12 differential equations simultaneously. Here are the explicit update equations for all three neurons at each time step:
Neuron A:
VA(t + Δt) = VA(t) + Δt · (Iinput,A − Iion,A) / Cm mA(t + Δt) = mA(t) + Δt · (αm(VA) · (1 − mA) − βm(VA) · mA) hA(t + Δt) = hA(t) + Δt · (αh(VA) · (1 − hA) − βh(VA) · hA) nA(t + Δt) = nA(t) + Δt · (αn(VA) · (1 − nA) − βn(VA) · nA) Neuron B: VB(t + Δt) = VB(t) + Δt · (Iinput,B − Iion,B) / Cm mB(t + Δt) = mB(t) + Δt · (αm(VB) · (1 − mB) − βm(VB) · mB) hB(t + Δt) = hB(t) + Δt · (αh(VB) · (1 − hB) − βh(VB) · hB) nB(t + Δt) = nB(t) + Δt · (αn(VB) · (1 − nB) − βn(VB) · nB) Neuron C: VC(t + Δt) = VC(t) + Δt · (Iinput,C − Iion,C) / Cm mC(t + Δt) = mC(t) + Δt · (αm(VC) · (1 − mC) − βm(VC) · mC) hC(t + Δt) = hC(t) + Δt · (αh(VC) · (1 − hC) − βh(VC) · hC) nC(t + Δt) = nC(t) + Δt · (αn(VC) · (1 − nC) − βn(VC) · nC) where Δt = 0.01 ms is the time step. The integration order each time step is:
Multiple steps (5 steps) are computed per frame for numerical stability, giving an effective time resolution of 0.05 ms per frame. Action Potential Mechanism When a stimulus current is injected:
Chain Propagation In the chain (A → B → C), the 12 differential equations are coupled through the synaptic connections:
The synaptic coupling strength (κ) determines how effectively the spike propagates. With strong coupling, even small voltage changes in the source neuron can trigger action potentials in the target neuron. The coupling creates a unidirectional flow of information through the chain, with no feedback from downstream neurons to upstream ones. SimulationThe interactive simulator is below. Use the controls to explore the concepts described above. Usage ExampleFollow these steps to explore the Hodgkin-Huxley action potential:
Key insight: action potentials emerge from the interaction between voltage-dependent ion channels. The positive feedback loop (depolarization → Na+ channels open → more depolarization) creates the rapid upstroke of the spike, while the slower K+ channels and Na+ inactivation create the downstroke and refractory period.
ParametersThe simulation uses standard Hodgkin-Huxley parameters from the original 1952 paper:
Buttons and Controls
Interaction and Visualization
Limitations
|
||