This repo contains implementations of the Hodgkin-Huxley model of cellular excitability on a 2D lattice.
The code is available in Python and Julia.
Ref.: Hodgkin, A.L., Huxley, A.F., A quantitative description of membrane current and its application to conduction and excitation in nerve. J Physiol 117:500-544, 1952.
Rendered page: https://frederic-vw.github.io/hodgkin-huxley-2d/
Python Requirements:
pip install package-name
)
Julia Requirements:
julia > using Pkg; Pkg.add("Package Name")
)
The Hodgkin-Huxley model uses four variables to model the nerve membrane potential and its response to input currents, including action potentials. The four variables represent voltage ($V$), Na+-channel activation ($m$), Na+-channel inactivation ($h$), and K+-channel activation ($n$).
Spatial coupling is introduced with a diffusion term for the voltage variable ($D Delta v$).
The steady-state functions contain the experimentally derived voltage-dependency of the gating variables:
Noise is added via stochastic integration of the voltage variable $V$:
The main function call running the simulation is: hh2d(N, T, t0, dt, s, D, C, gNa, gK, gL, VNa, VK, VL, I0, stim, blocks)
:
N
: lattice size (N,N)
T
: number of simulation time stepst0
: number of ‘warm-up’ iterationsdt
: integration time steps
: noise intensity (σ)D
: diffusion constantgNa,gK,gL,VNa,VK,VL
: Hodgkin-Huxley model parameters, I
: stimulation current amplitudestim
: stimulation current parameters, array of time-, x-, and y-interval bordersblocks
: conduction blocks, array of x- and y-interval bordersOutputs: (T,N,N)
array as NumPy .npy format and as .mp4 movie.
In example 1, use
stim = [ [[50,350], [1,5], [1,5]], [[1900,2200], [25,30], [1,15]] ]
blocks = [ [[1,15], [5,10]] ]
Stimulation in the lower left corner generates a travelling wave along a narrow channel formed by the left boundary and the conduction block defined by blocks
, an early after-depolarization within the partially refractory region generates a spiral wave.
Parameters:
N = 128, T = 10000, t0 = 2000, dt = 0.01, s = 1.0, D = 1, C = 1, gNa = 120, gK = 36, gL = 0.3, VNa = 115, VK = -12, VL = 10.6, I = 45.0
The Hodgkin-Huxley lattice can produce spiral waves and other travelling waves.