hodgkin-huxley-2d

Hodgkin-Huxley lattice model in Python and julia

DOI

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:

  1. python installation, latest version tested 3.6.9
  2. python packages (pip install package-name)
    • NumPy
    • Matplotlib
    • opencv-python (save data as movie)

Julia Requirements:

  1. julia installation, latest version tested 1.6.1
  2. julia packages (julia > using Pkg; Pkg.add("Package Name"))
    • NPZ
    • PyCall (load Matplotlib animation functionality)
    • PyPlot
    • Statistics
    • VideoIO (save data as movie)

Hodgkin-Huxley model

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):

Outputs: (T,N,N) array as NumPy .npy format and as .mp4 movie.

In example 1, use

Example-1

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

Conclusions

The Hodgkin-Huxley lattice can produce spiral waves and other travelling waves.