FitzHugh

FitzHugh#

FitzHugh() - the FitzHugh2 model without external stimulus.

The FitzHugh model is commonly used to test ODE software 6 3, the model itself describes the excitation state of a neuron membrane as an excitation spike passes. PyGOM also includes other functions which are commonly used to test numerical integrators such as: vanDerPol() - the Van der Pol oscillator 8 and Robertson() - the Robertson reaction 7. The FitzHugh model equations are as follows:

\[\begin{split}\begin{aligned} \frac{\mathrm{d} V}{\mathrm{d} t} &= c ( V - \frac{V^{3}}{3} + R) \\ \frac{\mathrm{d} R}{\mathrm{d} t} &= -\frac{1}{c}(V - a + bR). \end{aligned}\end{split}\]

We solve for the deterministic time evolution of the system:

import numpy as np
from pygom import common_models
import matplotlib.pyplot as plt

model = common_models.FitzHugh(
    {
        'a':0.2,
        'b':0.2,
        'c':3.0
    }
)

t = np.linspace(0, 20, 100)
x0 = [1.0, -1.0]
model.initial_values = (x0, t[0])

solution = model.solve_deterministic(t)

Plotting the function reveals frequent sharp transitions, which makes it an appropriate system to test ODE solving methods.

Hide code cell source
state_names = model.state_list
n_state = len(state_names)

fig, axes = plt.subplots(1, n_state, figsize=(10, 3))

for i in range(n_state):
    axes[i].plot(t, solution[0].result.y[:, i])
    axes[i].set_title(state_names[i])
    axes[i].set_xlabel("Time")

plt.tight_layout()
plt.show()
../../_images/e421a03f5c88eae44dcfab112711643a58e175ec6d5c99d815c826fa017dbd26.png