fitzhugh-nagumo-2d

FitzHugh-Nagumo lattice model in Python and julia

To cite this code, please use: DOI

This repo contains simple implementations of the FitzHugh-Nagumo model of cellular excitability on a 2D lattice.
The code is available in Python and Julia.

Ref.: FitzHugh, R., Impulses and physiological states in theoretical models of nerve membrane. Biophys J 1:445-466, 1961.

Rendered page: https://frederic-vw.github.io/fitzhugh-nagumo-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)

FitzHugh-Nagumo model

The FHN model is a two-variable system for the abstract representation of action potential as those found in neurons or cardiac myocytes. The voltage-like variable $v$ and the recovery variable $w$ implement depolarization current ($I$) induced spiking and a post-spike refractory behaviour.
Spatial coupling is introduced via diffusion of the voltage-like variable:

Noise is added via Itô-integration:

The main function call running the simulation is: fhn2d(N, T, t0, a, b, c, I, s, D, dt, stim, blocks):

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

Examples 1, 2 use

Example-1

Stimulation near the left border generates a travelling wave which breaks at and merges after the conduction blocks. After-depolarization does not change the qualitative behaviour of a travelling wave. Parameters:
N = 128, T = 1000, t0 = 0, dt = 0.1, s = 0.02, D = 1.0, a = 0.5, b = 0.7, c = 0.3, I = 0.5

Example-2

Increasing the stimulation current while maintaining all other variables constant generates functional re-entry (spiral waves) originating where the 2nd stimulus hits repolarizing tissue. Parameters:
N = 128, T = 1000, t0 = 0, dt = 0.1, s = 0.02, D = 1.0, a = 0.5, b = 0.7, c = 0.3, I = 1.0

Example-3

Without a stimulus current (stim = []), a large background noise can generate re-entry patterns. Parameters on the left:
N = 128, T = 1000, t0 = 0, dt = 0.1, sd = 0.10, D = 1.0, a = 0.5, b = 0.7, c = 0.3, I = 0.5
On the right, with reduced diffusion constant D=0.25, other parameters identical.

Conclusions

The FHN lattice can produce: