Draft:Epileptor-2
Template:Short description Template:Draft topics Template:AfC topic
Epileptor-2 is the simplified mathematical model of epileptic discharges observed in the brain[1], named after the previous model called Epileptor[2]. It replicates brief interictal discharges—observed as clusters of action potential spikes in the activity of individual neurons—and longer ictal discharges, represented as clusters of these shorter discharges. According to the Epileptor-2 model, brief interictal discharges are characterized as stochastic oscillations of the membrane potential and synaptic resources, while ictal discharges emerge as oscillations in the extracellular concentration of potassium ions and the intracellular concentration of sodium ions. The both models, Epileptor and Epileptor-2, demonstrate that ionic dynamics play a decisive role in the generation of pathological activity.
Below, a modified Epileptor-2 model is described, where the second extracellular compartment has been added. Ionic dynamics is described with two extracellular concentrations of potassium ions, at the proximity of neurons, , and at a distance, , and the intracellular concentration of sodium ions, :
According to these equations, the concentrations increase because of firing with the rate , relax with the time scales , and , and decrease due to the sodium-potassium pump .
The membrane polarization averaged across population and the synaptic resource are governed by
where
The source term summarises the current mediated by the changes ot the potassium concentration, the synaptic current and the noise (white gaussian noise). The synaptic resource decreases because of firing with the rate and recovers with the time scale .
The potassium reversal potential is
The sodium-potassium pump is
The sigmoidal dependence of the firing rate on voltage is
Representative neuron is governed by the quadratic integrate-and-fire model for the membrane potential . It receives the same input as the population:
The parameters are as follows:

The model's implementation in Python is given below:
import numpy as np
import pylab as pl
def Sigmoid(V):
scc = 2. / (1 + np.exp(2 * (Vth - V) / K_v)) - 1
psc = np.clip(scc, a_min=0, a_max=None)
return vmax * psc
def I_pump(K, Na):
return rho / ((1 + np.exp(3.5 - K)) * (1 + np.exp((25 - Na) / 3)))
def VK(Kconc):
return 26.6 * np.log(Kconc / 130.)
def u_over_gL(K, nu, x, y, Ipi):
eta = np.random.normal(0, 1)
vkk = VK(y)
#********************************************************************************************
return (g_K * (vkk - vkk0) + G_syn * nu * (x - 0.5)
+ sigma * eta / np.sqrt(dt) / np.sqrt(1000))
#********************************************************************************************
def dots(states):
K, Na, x, V, U, y = states
Ip_ = I_pump(K, Na)
nu_ = Sigmoid(V)
uu_ = u_over_gL(K, nu_, x, y, Ip_)
#*************************************************************
dotK = (y - K ) / tau_K + deltaK * nu_ - 2 * beta * Ip_
dotNa = (Na_0 - Na) / tau_Na + deltaNa * nu_ - 3 * Ip_
dotV = (uu_ - V) / tau_m
dotx = (1 - x) / tau_x - deltax * x * nu_
doty = (Kbath - y) / tau_y + (K-y)/tau_K
dotU = 1000 * ((gU / CU) * (U - U1) * (U - U2) + gL * uu_ / CU)
#*************************************************************
return np.array([dotK, dotNa, dotx, dotV, dotU, doty])
# in ms
tau_K = 100/4 # s
tau_Na = 20 # s
tau_m = 0.01 # s
tau_x = 2 # s
tau_y = 250
deltaK = 0.02*2 # switches from ID to IID
deltaNa = 0.03
deltax = 0.01
rho = 0.2*4 # mM/ms
beta = 10.
sigma = 25./3
G_syn = 5./2
g_K = 0.5
K_0 = 3.
Kbath1 = 3
Kbath2 = 8.5
Na_0 = 10.
vmax = 100
Vth = 25./4
K_v = 20.
gL = 1*5 # from their mathematica notebook
# parameters of the observer:
gU = 0.4
CU = 200.
Uth = 25.
Vr = -50.
U1 = -60.
U2 = -40.
U_0 = -70.
V_0 = 0
x_0 = 1.
y_0 = Kbath1
nu_0 = 0
Ip_0 = 0
vkk0 = VK(K_0)
dt = 0.01 # in second
u_0 = u_over_gL(K_0, nu_0, x_0, y_0, Ip_0)
tt = 400. # in second
lngth = int(tt / dt)
xax = np.arange(0, tt, dt)
arbig = np.zeros((lngth, 9))
arbig[0] = [K_0, Na_0, x_0, V_0, U_0, y_0, nu_0, Ip_0, u_0]
Ki, Nai, xi, Vi, Ui, yi, nui, Ipi, ui = arbig[0]
for ii, it in enumerate(xax[1:], 1):
if it <= 50:
Kbath = Kbath1
else:
Kbath = Kbath2
state = dots(arbig[ii - 1, :6])
Ki, Nai, xi, Vi, Ui, yi = arbig[ii - 1, :6] + dt * state
#***********************************
Ipi = I_pump(Ki, Nai)
nui = Sigmoid(Vi)
ui = u_over_gL(Ki, nui, xi, yi, Ipi)
#***********************************
if Ui > Uth:
Ui = Vr
arbig[ii] = [Ki, Nai, xi, Vi, Ui, yi, nui, Ipi, ui]
# Plotting **********************************************************************************
KK, NNa, xx, VV, UU, yy, nuu, II, uu = arbig.T
pl.close('all')
pl.figure(figsize=(10, 7))
ax = pl.subplot(511)
pl.plot(xax, UU, 'k')
pl.ylabel(r'$U (mV)$')
pl.subplot(512, sharex=ax)
pl.plot(xax, VV, 'r')
pl.ylabel(r'$V(mV)$')
pl.subplot(513, sharex=ax)
pl.plot(xax, xx, color=(0.5, 0., 0.5))
pl.ylabel(r'$x^D$')
pl.subplot(514, sharex=ax)
pl.plot(xax, NNa, 'r')
pl.ylabel(r'$[Na]_i$ (mM)')
pl.subplot(515, sharex=ax)
pl.plot(xax, (yy+KK)/2, color=(0.2, 0.6, 0.2), linewidth=3)
pl.ylabel(r'$[K]_o$ (mM)')
pl.tight_layout()
pl.show()