Electrical Circuit Model of the Plasma Membrane

A comprehensive guide to understanding the cell membrane as an electrical circuit, featuring interactive simulations, mathematical derivations, and Python code.

Learning Objectives

  • โ€ขModel the plasma membrane as a parallel RC circuit with ion-specific conductances
  • โ€ขDerive the Thรฉvenin equivalent circuit and understand its physical meaning
  • โ€ขApply Kirchhoff's laws to calculate membrane potential and ionic currents
  • โ€ขUnderstand the Hodgkin-Huxley model and its Nobel Prize-winning implications
  • โ€ขImplement numerical simulations of action potentials using Python

โšกInteractive Membrane Circuit Diagram

Channel Conductances

g_Naโบ1.0 mS/cmยฒ

E_Na = +61 mV โ€ข I = -145.72 ยตA/cmยฒ

g_Kโบ36.0 mS/cmยฒ

E_K = -89 mV โ€ข I = 154.05 ยตA/cmยฒ

g_Clโป0.3 mS/cmยฒ

E_Cl = -70 mV โ€ข I = -4.42 ยตA/cmยฒ

g_Leak0.3 mS/cmยฒ

E_Leak = -70 mV โ€ข I = -4.42 ยตA/cmยฒ

C_m (Membrane)1.0 ยตF/cmยฒ
I_pump (Naโบ/Kโบ-ATPase)0.50 ยตA/cmยฒ

Calculated Values

Membrane Potential:-84.72 mV
Total Conductance:37.60 mS/cmยฒ
Input Resistance:26.6 ฮฉยทcmยฒ
Time Constant (ฯ„):0.03 ms
Try this: Increase g_Na to 120 mS/cmยฒ (simulating action potential peak) and watch Vm shift toward +61 mV. Then increase g_K to see repolarization back toward -89 mV.

Thรฉvenin Equivalent Circuit Derivation

The complex membrane circuit with multiple ion channels can be simplified to a single voltage source (Vth) in series with a single resistance (Rth). This Thรฉvenin equivalent captures the essential electrical behavior of the membrane.

Step-by-Step Derivation

Step 1: Apply Kirchhoff's Current Law

At steady state, all ionic currents sum to zero:

$$I_{\text{Na}} + I_{\text{K}} + I_{\text{Cl}} + I_{\text{Leak}} + I_{\text{pump}} = 0$$

Step 2: Express Each Current Using Ohm's Law

$$I_{\text{Na}} = g_{\text{Na}}(V_m - E_{\text{Na}})$$$$I_{\text{K}} = g_{\text{K}}(V_m - E_{\text{K}})$$$$I_{\text{Cl}} = g_{\text{Cl}}(V_m - E_{\text{Cl}})$$

Step 3: Substitute and Solve for $V_m$

Collecting terms:

$$V_m \cdot \sum_i g_i = \sum_i g_i E_i - I_{\text{pump}}$$

Step 4: Final Thรฉvenin Voltage

$$V_{\text{th}} = \frac{\sum_i g_i E_i}{\sum_i g_i}$$

This is the Goldman-Hodgkin-Katz equation!

Step 5: Thรฉvenin Resistance

$$R_{\text{th}} = \frac{1}{g_{\text{Na}} + g_{\text{K}} + g_{\text{Cl}} + g_{\text{Leak}}} = \frac{1}{g_{\text{total}}}$$

Numerical Example: Resting Neuron

Given Values (typical neuron)

g_Na = 1 mS/cmยฒE_Na = +61 mVg_K = 36 mS/cmยฒE_K = -89 mVg_Cl = 0.3 mS/cmยฒE_Cl = -70 mVg_Leak = 0.3 mS/cmยฒE_Leak = -70 mV

g_total = 1 + 36 + 0.3 + 0.3 = 37.6 mS/cmยฒ

V_th = (1ร—61 + 36ร—(-89) + 0.3ร—(-70) + 0.3ร—(-70)) / 37.6

V_th = (61 - 3204 - 21 - 21) / 37.6

V_th = -84.7 mV

R_th = 1000/37.6 = 26.6 ฮฉยทcmยฒ

Physical Interpretation

The resting potential (-70 mV) is close to E_K (-89 mV) because Kโบ conductance dominates at rest (36 out of 37.6 mS/cmยฒ). The small Naโบ conductance pulls V_m slightly positive from E_K.

Circuit Schematic Representations

Full Membrane Circuit

     EXTRACELLULAR (0 mV reference)
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚
          โ”‚         โ”Œโ”ดโ”        โ”Œโ”ดโ”        โ”Œโ”ดโ”        โ”Œโ”ดโ”
         โ”€โ”ผโ”€        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚
        โ”€โ”€โ”ผโ”€โ”€       โ”‚ โ”‚gNa     โ”‚ โ”‚gK      โ”‚ โ”‚gCl     โ”‚ โ”‚gLeak
         โ”€โ”ผโ”€        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚
          โ”‚         โ””โ”ฌโ”˜        โ””โ”ฌโ”˜        โ””โ”ฌโ”˜        โ””โ”ฌโ”˜
          โ”‚  Cm      โ”‚          โ”‚          โ”‚          โ”‚
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚
          โ”‚        โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€
          โ”‚       +โ”‚   โ”‚-    -โ”‚   โ”‚+    -โ”‚   โ”‚+    -โ”‚   โ”‚+
          โ”‚        โ”‚ E โ”‚      โ”‚ E โ”‚      โ”‚ E โ”‚      โ”‚ E โ”‚
          โ”‚        โ”‚Na โ”‚      โ”‚ K โ”‚      โ”‚Cl โ”‚      โ”‚ L โ”‚
          โ”‚        โ”‚+61โ”‚      โ”‚-89โ”‚      โ”‚-70โ”‚      โ”‚-70โ”‚
          โ”‚       โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
     INTRACELLULAR (Vm โ‰ˆ -70 mV)

     Cm = Membrane Capacitor (1 ยตF/cmยฒ)
     gX = Ion Channel Conductance (variable resistor)
     EX = Nernst Equilibrium Potential (battery/EMF)

Thรฉvenin Equivalent

     EXTRACELLULAR (0 mV)
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
               โ”‚
               โ”‚
              โ”Œโ”ดโ”
              โ”‚ โ”‚  Rth = 1/gtotal
              โ”‚ โ”‚      = 26.6 ฮฉยทcmยฒ
              โ”‚ โ”‚
              โ””โ”ฌโ”˜
               โ”‚
             โ”€โ”€โ”ดโ”€โ”€
            +โ”‚   โ”‚-
             โ”‚Vthโ”‚  Vth = ฮฃgiEi/ฮฃgi
             โ”‚   โ”‚      = -70 mV
            โ”€โ”€โ”ฌโ”€โ”€
               โ”‚
               โ”‚
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
     INTRACELLULAR (Vm)


     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚  Time Constant:             โ”‚
     โ”‚  ฯ„ = Rth ร— Cm               โ”‚
     โ”‚    = 26.6 ร— 1 ยตF            โ”‚
     โ”‚    = 26.6 ms                โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Complete Circuit with Naโบ/Kโบ-ATPase Pump

     EXTRACELLULAR
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚              โ”‚
          โ”‚         โ”Œโ”ดโ”        โ”Œโ”ดโ”        โ”Œโ”ดโ”        โ”Œโ”ดโ”            โ”‚
         โ”€โ”ผโ”€        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚         โ”Œโ”€โ”€โ”ดโ”€โ”€โ”
        โ”€โ”€โ”ผโ”€โ”€       โ”‚ โ”‚gNa     โ”‚ โ”‚gK      โ”‚ โ”‚gCl     โ”‚ โ”‚gL       โ”‚PUMP โ”‚ 3Naโบ OUT
         โ”€โ”ผโ”€        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚        โ”‚ โ”‚         โ”‚     โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–บ
          โ”‚         โ””โ”ฌโ”˜        โ””โ”ฌโ”˜        โ””โ”ฌโ”˜        โ””โ”ฌโ”˜         โ”‚ ATP โ”‚
          โ”‚  Cm      โ”‚          โ”‚          โ”‚          โ”‚          โ”‚     โ”‚ 2Kโบ IN
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚     โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€
          โ”‚        โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€      โ”€โ”€โ”ดโ”€โ”€        โ””โ”€โ”€โ”ฌโ”€โ”€โ”˜
          โ”‚       +โ”‚   โ”‚-    -โ”‚   โ”‚+    -โ”‚   โ”‚+    -โ”‚   โ”‚+          โ”‚
          โ”‚        โ”‚ENaโ”‚      โ”‚ EKโ”‚      โ”‚EClโ”‚      โ”‚ ELโ”‚          โ”€โ”ผโ”€  Current
          โ”‚        โ”‚+61โ”‚      โ”‚-89โ”‚      โ”‚-70โ”‚      โ”‚-70โ”‚         โ”€โ”€โ”ผโ”€โ”€ Source
          โ”‚       โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€      โ”€โ”€โ”ฌโ”€โ”€          โ”€โ”ผโ”€  (Ipump)
          โ”‚          โ”‚          โ”‚          โ”‚          โ”‚              โ”‚
     โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
     INTRACELLULAR (Vm)

     Naโบ/Kโบ-ATPase: Electrogenic pump that maintains ion gradients
     โ€ข Exports 3 Naโบ ions โ†’ Creates outward current
     โ€ข Imports 2 Kโบ ions  โ†’ Net charge movement = hyperpolarizing
     โ€ข Ipump โ‰ˆ 0.5-1.0 ยตA/cmยฒ (contributes ~5 mV to resting potential)

Action Potential Waveform & Conductance Changes

    Vm (mV)
    +40 โ”ค                    โ•ญโ”€โ•ฎ
        โ”‚                   โ•ฑ   โ•ฒ
    +20 โ”ค                  โ•ฑ     โ•ฒ
        โ”‚                 โ•ฑ       โ•ฒ
      0 โ”ค                โ•ฑ         โ•ฒ
        โ”‚               โ•ฑ           โ•ฒ
    -20 โ”ค              โ•ฑ             โ•ฒ
        โ”‚             โ•ฑ               โ•ฒ
    -40 โ”ค            โ•ฑ                 โ•ฒ
        โ”‚           โ•ฑ                   โ•ฒ
    -55 โ”คโ”€ โ”€ โ”€ โ”€ โ”€โ•ฑโ”€Thresholdโ”€ โ”€ โ”€ โ”€ โ”€ โ”€โ•ฒโ”€ โ”€ โ”€ โ”€ โ”€ โ”€ โ”€ โ”€ โ”€
        โ”‚        โ•ฑ                       โ•ฒ
    -70 โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฑ                         โ•ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Resting
        โ”‚      โ†‘                           โ•ฒ_____โ•ฑ
    -90 โ”ค    Stimulus                    Undershoot (AHP)
        โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ–บ Time (ms)
             0    1    2    3    4    5    6    7    8

    Conductances:
    โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
    gNa         โ”Œโ”€โ”€โ”€โ”€โ•ฎ                      (Fast activation, fast inactivation)
    (red)  โ”€โ”€โ”€โ”€โ”€โ”˜    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
    gK              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ        (Slow activation, no inactivation)
    (green) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

    PHASES:
    1. REST:       gK >> gNa  โ†’  Vm near EK (-89 mV), but modified by other channels
    2. RISING:     gNa >> gK  โ†’  Vm rushes toward ENa (+61 mV)
    3. PEAK:       Naโบ inactivation begins (h gate closes)
    4. FALLING:    gK increases, gNa decreases โ†’ Vm returns toward EK
    5. UNDERSHOOT: gK still elevated โ†’ Vm briefly more negative than rest

Conductance State Comparison

โ‘  Resting State

gK dominates โ†’ Vm โ‰ˆ โˆ’70 mV

gNa โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  1 mS/cmยฒ
gK  โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“  36 mS/cmยฒ
gCl โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  0.3 mS/cmยฒ

Vm = (1ร—61 + 36ร—(โˆ’89) + 0.3ร—(โˆ’70)) / 37.3 โ‰ˆ โˆ’70 mV

โ‘ก Depolarized (AP Peak)

gNa dominates โ†’ Vm โ‰ˆ +40 mV

gNa โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“  120 mS/cmยฒ
gK  โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“  36 mS/cmยฒ
gCl โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  0.3 mS/cmยฒ

Vm = (120ร—61 + 36ร—(โˆ’89)) / 156 โ‰ˆ +26 mV

โ‘ข Repolarizing (AHP)

gK elevated โ†’ Vm โ†’ โˆ’89 mV

gNa โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  ~0 mS/cmยฒ
gK  โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“  72 mS/cmยฒ
gCl โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  0.3 mS/cmยฒ

Vm โ‰ˆ EK = โˆ’89 mV (undershoot)

Complete Circuit Theory

Batteries (E_ion)

Each ion's Nernst potential acts as an EMF source. The "battery" drives ions toward equilibrium.

E_Na = +61 mV (pulls positive)

E_K = -89 mV (pulls negative)

Resistors (g_ion)

Conductance (g = 1/R) represents how easily ions flow. Higher g means more current.

g_K at rest โ‰ˆ 36 mS/cmยฒ

g_Na at rest โ‰ˆ 1 mS/cmยฒ

Capacitor (C_m)

The lipid bilayer acts as a dielectric, storing charge and slowing voltage changes.

C_m โ‰ˆ 1 ยตF/cmยฒ

d โ‰ˆ 7-8 nm thickness

Current Source (Pump)

The Naโบ/Kโบ-ATPase is an electrogenic pump, contributing a small outward current.

3 Naโบ out / 2 Kโบ in

Contributes ~-10 mV

Key Equations

Nernst Equation

$$E_X = \frac{RT}{zF} \ln \frac{[X]_{\text{out}}}{[X]_{\text{in}}}$$

At 37ยฐC: $E_X = \frac{61.5}{z} \log_{10} \frac{[X]_o}{[X]_i}$ mV

Ohm's Law for Ion Channels

$$I_{\text{ion}} = g_{\text{ion}} \cdot (V_m - E_{\text{ion}})$$

Current flows when $V_m \neq E_{\text{ion}}$ (driving force exists)

Kirchhoff's Current Law

$$\sum I_{\text{in}} = \sum I_{\text{out}}$$

At steady state: $I_{\text{Na}} + I_{\text{K}} + I_{\text{Cl}} + I_{\text{Leak}} = 0$

Goldman-Hodgkin-Katz Equation

$$V_m = \frac{\sum_i g_i E_i}{\sum_i g_i} = \frac{g_{\text{Na}} E_{\text{Na}} + g_{\text{K}} E_{\text{K}} + g_{\text{Cl}} E_{\text{Cl}}}{g_{\text{Na}} + g_{\text{K}} + g_{\text{Cl}}}$$

Weighted average of equilibrium potentials, weighted by conductances

RC Time Constant

$$\tau = R_m \cdot C_m = \frac{C_m}{g_{\text{total}}}$$

$\tau \approx 2\text{-}5$ ms for neurons. Time for $V_m$ to reach 63% of final value.

Membrane Capacitor Equation

$$I_c = C_m \frac{dV_m}{dt}$$

Capacitive current only flows during voltage changes

Hodgkin-Huxley Gating Variables

The Nobel Prize-winning Hodgkin-Huxley model (1952) introduced voltage-dependent gating variables that describe how ion channel conductances change during an action potential.

Naโบ Channel

$$g_{\text{Na}} = \bar{g}_{\text{Na}} \cdot m^3 \cdot h$$

m: activation gate (fast)
h: inactivation gate (slow)

Kโบ Channel

$$g_{\text{K}} = \bar{g}_{\text{K}} \cdot n^4$$

n: activation gate (slow)
Delayed rectifier current

Gating Kinetics

$$\frac{dm}{dt} = \alpha_m(V)(1-m) - \beta_m(V)m$$

$\alpha$ and $\beta$ are voltage-dependent rate constants

Complete Hodgkin-Huxley Equation

$$C_m \frac{dV}{dt} = -\bar{g}_{\text{Na}} m^3 h (V - E_{\text{Na}}) - \bar{g}_{\text{K}} n^4 (V - E_{\text{K}}) - \bar{g}_L (V - E_L) + I_{\text{ext}}$$

Experimental Measurement Techniques

Voltage Clamp

Developed by Cole (1949) and perfected by Hodgkin & Huxley (1952). The technique uses negative feedback to hold V_m constant while measuring the current required.

  • โ€ข Measures ionic currents at fixed potentials
  • โ€ข Separates Naโบ and Kโบ currents pharmacologically
  • โ€ข Used to determine g-V relationships

Patch Clamp

Invented by Neher & Sakmann (1976, Nobel Prize 1991). Records currents through individual ion channels with pA resolution.

  • โ€ข Cell-attached, whole-cell, inside-out, outside-out
  • โ€ข Single channel conductances: 10-50 pS typical
  • โ€ข Reveals channel gating kinetics

Nobel Prize Recognition

โ€ข 1963: Hodgkin & Huxley (ionic mechanisms of action potentials)
โ€ข 1991: Neher & Sakmann (patch clamp technique)

Key Circuit Insights

The Weighted Average Principle

The plasma membrane circuit reveals that the resting potential (โˆ’70 mV) is simply a weighted average of all open ion pathways:

$$V_m = \frac{g_{\text{Na}} E_{\text{Na}} + g_{\text{K}} E_{\text{K}} + g_{\text{Cl}} E_{\text{Cl}} + g_{\text{Leak}} E_{\text{Leak}}}{g_{\text{total}}}$$

Naโบ at +61 mV

Pulls membrane positive (depolarizing). Opening Naโบ channels shifts V_m toward +61 mV.

Kโบ at โˆ’89 mV

Pulls membrane negative (hyperpolarizing). Kโบ dominates at rest because g_K >> g_Na.

Demystifying the Action Potential

The action potential requires no mystical propertiesโ€”just parallel resistors and batteries!

  1. 1Depolarization: Voltage-gated Naโบ channels open, increasing g_Na from 1 to ~120 mS/cmยฒ. V_m shifts from โˆ’70 toward +61 mV.
  2. 2Peak: V_m reaches ~+40 mV (not quite E_Na because g_K is still present). Naโบ channels begin inactivating (h โ†’ 0).
  3. 3Repolarization: Kโบ channels open (delayed), increasing g_K. V_m returns toward โˆ’89 mV as Kโบ conductance dominates.
  4. 4Afterhyperpolarization: Kโบ channels remain open briefly, pushing V_m below resting (โˆ’80 to โˆ’90 mV) before returning to rest.

"Opening more Naโบ channels repels the potential away from E_K toward E_Na. This beautifully explains action potential generation without invoking any mystical propertiesโ€”just parallel resistors and batteries!"

Video Lectures

Comprehensive video series covering membrane electrophysiology, circuit models, and the Hodgkin-Huxley framework.

Featured: Hodgkin-Huxley Model Explained

Electrophysiology Basics

Simulation Code

Run simulations directly in your browser using Pyodide (Python in WebAssembly), or download to run locally.

Simple Membrane Potential Calculator

Calculate membrane potential using the parallel conductance model. Click 'Run in Browser' to execute.

# Simple Membrane Potential Calculator
# Using the parallel conductance model

import numpy as np

def calculate_membrane_potential(conductances, potentials, I_pump=0):
    """
    Calculate membrane potential using the Goldman-Hodgkin-Katz equation.

    Parameters:
    -----------
    conductances : dict
        Dictionary of ion conductances in mS/cmยฒ
        e.g., {'Na': 1, 'K': 36, 'Cl': 0.3, 'Leak': 0.3}
    potentials : dict
        Dictionary of equilibrium potentials in mV
        e.g., {'Na': 61, 'K': -89, 'Cl': -70, 'Leak': -70}
    I_pump : float
        Pump current in ยตA/cmยฒ (default 0)

    Returns:
    --------
    dict : Contains Vm, Rth, tau, and individual currents
    """

    # Calculate total conductance
    g_total = sum(conductances.values())

    # Calculate membrane potential (weighted average)
    numerator = sum(conductances[ion] * potentials[ion]
                   for ion in conductances) - I_pump
    Vm = numerator / g_total

    # Calculate individual currents
    currents = {ion: conductances[ion] * (Vm - potentials[ion])
               for ion in conductances}

    # Thรฉvenin equivalent
    Rth = 1000 / g_total  # ฮฉยทcmยฒ

    # Time constant (assuming Cm = 1 ยตF/cmยฒ)
    Cm = 1.0
    tau = Cm * Rth / 1000  # ms

    return {
        'Vm': Vm,
        'g_total': g_total,
        'Rth': Rth,
        'tau': tau,
        'currents': currents
    }

# Example: Resting neuron
conductances = {'Na': 1, 'K': 36, 'Cl': 0.3, 'Leak': 0.3}
potentials = {'Na': 61, 'K': -89, 'Cl': -70, 'Leak': -70}

result = calculate_membrane_potential(conductances, potentials)

print("=== Resting Membrane Analysis ===")
print(f"Membrane Potential: {result['Vm']:.2f} mV")
print(f"Total Conductance: {result['g_total']:.2f} mS/cmยฒ")
print(f"Thรฉvenin Resistance: {result['Rth']:.2f} ฮฉยทcmยฒ")
print(f"Time Constant: {result['tau']:.2f} ms")
print("\nIndividual Currents (ยตA/cmยฒ):")
for ion, current in result['currents'].items():
    print(f"  I_{ion}: {current:.3f}")

# Example: Action potential peak (high Na+ conductance)
print("\n=== Action Potential Peak ===")
conductances_ap = {'Na': 120, 'K': 36, 'Cl': 0.3, 'Leak': 0.3}
result_ap = calculate_membrane_potential(conductances_ap, potentials)
print(f"Membrane Potential: {result_ap['Vm']:.2f} mV")

Complete Hodgkin-Huxley Simulation

Full implementation with RK4 integration and gating kinetics. Runs in browser without matplotlib plotting.

import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint

# Hodgkin-Huxley Model Parameters (Giant Squid Axon)
C_m = 1.0      # Membrane capacitance (ยตF/cmยฒ)
g_Na_max = 120.0  # Max Na+ conductance (mS/cmยฒ)
g_K_max = 36.0    # Max K+ conductance (mS/cmยฒ)
g_L = 0.3         # Leak conductance (mS/cmยฒ)
E_Na = 50.0       # Na+ reversal potential (mV)
E_K = -77.0       # K+ reversal potential (mV)
E_L = -54.4       # Leak reversal potential (mV)

# Rate constants (alpha and beta functions)
def alpha_m(V): return 0.1 * (V + 40) / (1 - np.exp(-(V + 40) / 10))
def beta_m(V):  return 4.0 * np.exp(-(V + 65) / 18)
def alpha_h(V): return 0.07 * np.exp(-(V + 65) / 20)
def beta_h(V):  return 1.0 / (1 + np.exp(-(V + 35) / 10))
def alpha_n(V): return 0.01 * (V + 55) / (1 - np.exp(-(V + 55) / 10))
def beta_n(V):  return 0.125 * np.exp(-(V + 65) / 80)

# Hodgkin-Huxley differential equations
def hodgkin_huxley(y, t, I_ext):
    V, m, h, n = y

    # Ionic currents
    I_Na = g_Na_max * m**3 * h * (V - E_Na)
    I_K = g_K_max * n**4 * (V - E_K)
    I_L = g_L * (V - E_L)

    # Membrane potential derivative
    dVdt = (I_ext - I_Na - I_K - I_L) / C_m

    # Gating variable derivatives
    dmdt = alpha_m(V) * (1 - m) - beta_m(V) * m
    dhdt = alpha_h(V) * (1 - h) - beta_h(V) * h
    dndt = alpha_n(V) * (1 - n) - beta_n(V) * n

    return [dVdt, dmdt, dhdt, dndt]

# Simulation parameters
T = 50.0      # Total time (ms)
dt = 0.01     # Time step (ms)
t = np.arange(0, T, dt)

# Initial conditions (resting state)
V0 = -65.0    # Resting potential (mV)
m0 = alpha_m(V0) / (alpha_m(V0) + beta_m(V0))
h0 = alpha_h(V0) / (alpha_h(V0) + beta_h(V0))
n0 = alpha_n(V0) / (alpha_n(V0) + beta_n(V0))
y0 = [V0, m0, h0, n0]

# External current stimulus
def I_stim(t):
    return 10.0 if 10 < t < 40 else 0  # 10 ยตA/cmยฒ from t=10-40 ms

# Solve using RK4 (via odeint)
I_ext_array = [I_stim(ti) for ti in t]
solution = odeint(lambda y, ti: hodgkin_huxley(y, ti, I_stim(ti)), y0, t)

# Extract results
V = solution[:, 0]
m = solution[:, 1]
h = solution[:, 2]
n = solution[:, 3]

# Calculate conductances
g_Na = g_Na_max * m**3 * h
g_K = g_K_max * n**4

# Plot results
fig, axes = plt.subplots(3, 1, figsize=(10, 8), sharex=True)

axes[0].plot(t, V, 'b-', linewidth=1)
axes[0].set_ylabel('V_m (mV)')
axes[0].set_title('Hodgkin-Huxley Action Potential Simulation')
axes[0].axhline(-65, color='gray', linestyle='--', alpha=0.5)

axes[1].plot(t, m, 'r-', label='m (Na activation)')
axes[1].plot(t, h, 'r--', label='h (Na inactivation)')
axes[1].plot(t, n, 'g-', label='n (K activation)')
axes[1].set_ylabel('Gating variables')
axes[1].legend()

axes[2].plot(t, g_Na, 'r-', label='g_Na')
axes[2].plot(t, g_K, 'g-', label='g_K')
axes[2].set_xlabel('Time (ms)')
axes[2].set_ylabel('Conductance (mS/cmยฒ)')
axes[2].legend()

plt.tight_layout()
plt.savefig('hodgkin_huxley_simulation.png', dpi=150)
plt.show()

Fortran 90 Implementation (High Performance)

For large-scale neural network simulations. Download and compile locally with gfortran.

! Hodgkin-Huxley Model in Fortran 90
! Simulates action potential propagation in squid giant axon
! Author: Cell Physiology Course
! Compile: gfortran -O3 -o hh hodgkin_huxley.f90

program hodgkin_huxley
    implicit none

    ! Physical constants (double precision for accuracy)
    real(8), parameter :: C_m = 1.0d0       ! Membrane capacitance (ยตF/cmยฒ)
    real(8), parameter :: g_Na_max = 120.0d0 ! Max Na+ conductance (mS/cmยฒ)
    real(8), parameter :: g_K_max = 36.0d0   ! Max K+ conductance (mS/cmยฒ)
    real(8), parameter :: g_L = 0.3d0        ! Leak conductance (mS/cmยฒ)
    real(8), parameter :: E_Na = 50.0d0      ! Na+ reversal potential (mV)
    real(8), parameter :: E_K = -77.0d0      ! K+ reversal potential (mV)
    real(8), parameter :: E_L = -54.4d0      ! Leak reversal potential (mV)

    ! Simulation parameters
    real(8), parameter :: dt = 0.01d0        ! Time step (ms)
    real(8), parameter :: T_max = 50.0d0     ! Total simulation time (ms)
    integer, parameter :: N_steps = nint(T_max / dt)

    ! State variables
    real(8) :: V, m, h, n
    real(8) :: I_Na, I_K, I_L, I_ext
    real(8) :: g_Na, g_K
    real(8) :: t

    ! RK4 intermediate variables
    real(8) :: k1_V, k2_V, k3_V, k4_V
    real(8) :: k1_m, k2_m, k3_m, k4_m
    real(8) :: k1_h, k2_h, k3_h, k4_h
    real(8) :: k1_n, k2_n, k3_n, k4_n
    real(8) :: V_tmp, m_tmp, h_tmp, n_tmp

    integer :: i, output_unit

    ! Initialize at resting state
    V = -65.0d0
    m = alpha_m(V) / (alpha_m(V) + beta_m(V))
    h = alpha_h(V) / (alpha_h(V) + beta_h(V))
    n = alpha_n(V) / (alpha_n(V) + beta_n(V))

    ! Open output file
    output_unit = 10
    open(unit=output_unit, file='hh_output.dat', status='replace')
    write(output_unit, '(A)') '# t(ms)  V(mV)  m  h  n  g_Na  g_K  I_Na  I_K'

    ! Main simulation loop using 4th-order Runge-Kutta
    do i = 0, N_steps
        t = i * dt
        if (t > 10.0d0 .and. t < 40.0d0) then
            I_ext = 10.0d0
        else
            I_ext = 0.0d0
        end if

        g_Na = g_Na_max * m**3 * h
        g_K = g_K_max * n**4
        I_Na = g_Na * (V - E_Na)
        I_K = g_K * (V - E_K)
        I_L = g_L * (V - E_L)

        if (mod(i, 10) == 0) then
            write(output_unit, '(9F12.4)') t, V, m, h, n, g_Na, g_K, I_Na, I_K
        end if

        ! RK4 integration
        k1_V = dVdt(V, m, h, n, I_ext)
        k1_m = dmdt(V, m); k1_h = dhdt(V, h); k1_n = dndt(V, n)

        V_tmp = V + 0.5d0*dt*k1_V
        m_tmp = m + 0.5d0*dt*k1_m
        h_tmp = h + 0.5d0*dt*k1_h
        n_tmp = n + 0.5d0*dt*k1_n
        k2_V = dVdt(V_tmp, m_tmp, h_tmp, n_tmp, I_ext)
        k2_m = dmdt(V_tmp, m_tmp); k2_h = dhdt(V_tmp, h_tmp); k2_n = dndt(V_tmp, n_tmp)

        V_tmp = V + 0.5d0*dt*k2_V
        m_tmp = m + 0.5d0*dt*k2_m
        h_tmp = h + 0.5d0*dt*k2_h
        n_tmp = n + 0.5d0*dt*k2_n
        k3_V = dVdt(V_tmp, m_tmp, h_tmp, n_tmp, I_ext)
        k3_m = dmdt(V_tmp, m_tmp); k3_h = dhdt(V_tmp, h_tmp); k3_n = dndt(V_tmp, n_tmp)

        V_tmp = V + dt*k3_V
        m_tmp = m + dt*k3_m
        h_tmp = h + dt*k3_h
        n_tmp = n + dt*k3_n
        k4_V = dVdt(V_tmp, m_tmp, h_tmp, n_tmp, I_ext)
        k4_m = dmdt(V_tmp, m_tmp); k4_h = dhdt(V_tmp, h_tmp); k4_n = dndt(V_tmp, n_tmp)

        V = V + (dt/6.0d0) * (k1_V + 2.0d0*k2_V + 2.0d0*k3_V + k4_V)
        m = m + (dt/6.0d0) * (k1_m + 2.0d0*k2_m + 2.0d0*k3_m + k4_m)
        h = h + (dt/6.0d0) * (k1_h + 2.0d0*k2_h + 2.0d0*k3_h + k4_h)
        n = n + (dt/6.0d0) * (k1_n + 2.0d0*k2_n + 2.0d0*k3_n + k4_n)

        m = max(0.0d0, min(1.0d0, m))
        h = max(0.0d0, min(1.0d0, h))
        n = max(0.0d0, min(1.0d0, n))
    end do

    close(output_unit)
    print *, 'Simulation complete. Output saved to hh_output.dat'

contains
    real(8) function alpha_m(V)
        real(8), intent(in) :: V
        real(8) :: x
        x = V + 40.0d0
        if (abs(x) < 1.0d-6) then
            alpha_m = 1.0d0
        else
            alpha_m = 0.1d0 * x / (1.0d0 - exp(-x/10.0d0))
        end if
    end function

    real(8) function beta_m(V)
        real(8), intent(in) :: V
        beta_m = 4.0d0 * exp(-(V + 65.0d0) / 18.0d0)
    end function

    real(8) function alpha_h(V)
        real(8), intent(in) :: V
        alpha_h = 0.07d0 * exp(-(V + 65.0d0) / 20.0d0)
    end function

    real(8) function beta_h(V)
        real(8), intent(in) :: V
        beta_h = 1.0d0 / (1.0d0 + exp(-(V + 35.0d0) / 10.0d0))
    end function

    real(8) function alpha_n(V)
        real(8), intent(in) :: V
        real(8) :: x
        x = V + 55.0d0
        if (abs(x) < 1.0d-6) then
            alpha_n = 0.1d0
        else
            alpha_n = 0.01d0 * x / (1.0d0 - exp(-x/10.0d0))
        end if
    end function

    real(8) function beta_n(V)
        real(8), intent(in) :: V
        beta_n = 0.125d0 * exp(-(V + 65.0d0) / 80.0d0)
    end function

    real(8) function dVdt(V, m, h, n, I_ext)
        real(8), intent(in) :: V, m, h, n, I_ext
        real(8) :: I_Na, I_K, I_L
        I_Na = g_Na_max * m**3 * h * (V - E_Na)
        I_K = g_K_max * n**4 * (V - E_K)
        I_L = g_L * (V - E_L)
        dVdt = (I_ext - I_Na - I_K - I_L) / C_m
    end function

    real(8) function dmdt(V, m)
        real(8), intent(in) :: V, m
        dmdt = alpha_m(V) * (1.0d0 - m) - beta_m(V) * m
    end function

    real(8) function dhdt(V, h)
        real(8), intent(in) :: V, h
        dhdt = alpha_h(V) * (1.0d0 - h) - beta_h(V) * h
    end function

    real(8) function dndt(V, n)
        real(8), intent(in) :: V, n
        dndt = alpha_n(V) * (1.0d0 - n) - beta_n(V) * n
    end function
end program hodgkin_huxley

To run Fortran: Download the file and compile with:

gfortran -O3 -o hh hodgkin_huxley.f90 && ./hh

Validation Checklist for Debugging

Physical Checks

  • โœ“ Resting V_m between -60 and -80 mV
  • โœ“ AP peak near +40 mV (not exceeding E_Na)
  • โœ“ AP duration 1-2 ms (squid axon)
  • โœ“ Refractory period ~1-2 ms
  • โœ“ Currents sum to zero at steady state

Numerical Checks

  • โœ“ dt โ‰ค 0.01 ms for stability
  • โœ“ Gating variables remain in [0, 1]
  • โœ“ No NaN or Inf values
  • โœ“ Energy conservation (current balance)
  • โœ“ Compare with literature values

References & Further Reading

  • โ€ข Hodgkin AL, Huxley AF (1952). A quantitative description of membrane current and its application to conduction and excitation in nerve. J Physiol 117:500-544.
  • โ€ข Hille B (2001). Ion Channels of Excitable Membranes, 3rd ed. Sinauer Associates.
  • โ€ข Johnston D, Wu SM (1995). Foundations of Cellular Neurophysiology. MIT Press.
  • โ€ข Kandel ER et al. (2021). Principles of Neural Science, 6th ed. McGraw-Hill.
  • โ€ข Cole KS (1949). Dynamic electrical characteristics of the squid axon membrane. Arch Sci Physiol 3:253-258.