Lesson 2 of 15

Nernst Equation

Nernst Equation

Electrochemical Equilibrium

Biological membranes maintain ion concentration gradients that drive electrical signaling. The Nernst equation gives the equilibrium membrane potential for a single ion species.

The Nernst Equation

E=RTzFln([ion]out[ion]in)E = \frac{RT}{zF} \ln\left(\frac{[\text{ion}]_{\text{out}}}{[\text{ion}]_{\text{in}}}\right)

  • R = 8.314 J/mol·K (gas constant)
  • T = temperature in Kelvin (body temperature ≈ 310 K)
  • z = ion valence (e.g., +1 for K⁺, +2 for Ca²⁺, −1 for Cl⁻)
  • F = 96485 C/mol (Faraday constant)

At 37°C: RT/F ≈ 26.7 mV

Typical Ion Concentrations (mammalian neuron)

Ion[out] mM[in] mME_Nernst
K⁺5140−89 mV
Na⁺14512+67 mV
Cl⁻1204−91 mV

Goldman-Hodgkin-Katz Equation

The resting membrane potential depends on the permeability of each ion. The Goldman equation accounts for K⁺, Na⁺, and Cl⁻:

Vm=RTFln(PK[K+]o+PNa[Na+]o+PCl[Cl]iPK[K+]i+PNa[Na+]i+PCl[Cl]o)V_m = \frac{RT}{F} \ln\left(\frac{P_K[K^+]_o + P_{Na}[Na^+]_o + P_{Cl}[Cl^-]_i}{P_K[K^+]_i + P_{Na}[Na^+]_i + P_{Cl}[Cl^-]_o}\right)

Typical permeability ratios at rest: P_K : P_Na : P_Cl = 1 : 0.04 : 0.45

Note that Cl⁻ appears flipped (intracellular on top for Cl⁻) because it carries negative charge.

Your Task

Implement three functions:

  1. nernst_potential_V(z, c_out, c_in, T_K=310) — Nernst potential in Volts
  2. nernst_potential_mV(z, c_out, c_in, T_K=310) — Nernst potential in millivolts
  3. goldman_potential_mV(K_o, K_i, Na_o, Na_i, Cl_o, Cl_i, P_K=1, P_Na=0.04, P_Cl=0.45, T_K=310) — Goldman membrane potential in mV
Python runtime loading...
Loading...
Click "Run" to execute your code.