This directory is the repository's first executable modeling example. It is not a mirror of the book's vocabulary-only Chapter 1: it starts immediately with a conductance-based Hodgkin--Huxley (HH) simulation and a voltage trace.
A membrane stores charge, so its voltage changes only when the injected and ionic currents do not balance. Sodium activation provides rapid positive feedback; sodium inactivation and potassium activation provide delayed negative feedback. The three gating variables make those conductances depend on both voltage and recent history.
The voltage balance implemented here is
Here
The example now lives in chapter01.ipynb:
simulate_hh_voltage_trace integrates the four HH state variables from
their voltage-dependent initial values, and an ipywidgets slider lets you
adjust i_ext interactively.
The trace is the compact consequence of current balance: a depolarizing input
first recruits i_ext only after confirming how the same initial state is built
from m_inf, h_inf, and n_inf.
- Run
HH_VOLTAGE_TRACEand identify the resting level, upstroke, and recovery. - Read the
derivativefunction alongside the equation above. - Continue to the gating curves in Chapter 03 before changing rate laws.
Comfort with first-order ODEs, units of current and voltage, and Python arrays is enough. Chapter 03 separates the gates into steady-state and time-constant curves; Chapter 04 focuses on numerical trajectories.
Open chapter01.ipynb in Jupyter, or via the Colab
badge at the top of the notebook. Run all cells top to bottom; the static
figure reproduces the book's plot, and the interact(...) cell below it
lets you adjust i_ext with a slider.