Izhikevich neuron model in Brian2

705 views
Skip to first unread message

set....@gmail.com

unread,
Nov 4, 2017, 3:03:03 PM11/4/17
to Brian
Hi,
I'm trying to simulate the simple neuron from http://www.izhikevich.org/publications/spikes.htm but I'm not getting any spikes and I don't know why, I followed the tutorial (http://brian2.readthedocs.io/en/latest/resources/tutorials/1-intro-to-brian-neurons.html) but I still don't have a clue of what to do.

Right now my code looks like

from brian2 import *
from scipy import stats

start_scope
()
number
= 1 #number of neurons
a
= 0.02/ms
b
= 0.2/ms
c
= -65 * mV
d
= 6*mV/ms
I
= 15*mV/second

#Neuronal equations of the Izhikevich-neuron
eqs
= '''
dv/dt = (0.04/ms/mV)*v**2+(5/ms)*v+140*mV/ms-u+I : volt
du/dt = a*(b*v-u)                                : volt/second
a                                                : 1/second
d                                                : volt/second

'''


reset
= '''
v = c
u = u + d
'''


#Set up neuron population
G
= NeuronGroup(number,eqs,threshold='v >= 30*mV',reset=reset,method='euler')
G
.a = 0.02/ms
G
.d = 8*mV/ms
G
.v = c
G
.u = b * c

M
= StateMonitor(G,'v', record=True)

run
(100*ms)

figure
plot
(M.t/ms, M.v[0])
xlabel
('Time (ms)')
ylabel
('v');

And my main problems are inside of eqs and below NeuronGroup, inside eqs I'm not sure if I have to put all values or exactly which values I need to declare there and with what unit, I heard is the most difficult.
And below NeuronGroup I wasn't sure if there was all the variables to update or only the initialization, and if it is only the initialization where you declare the increment of the variables?

Thanks a lot,
Sergio Tobal.

Marcel Stimberg

unread,
Nov 7, 2017, 12:27:47 PM11/7/17
to brians...@googlegroups.com
Hi,

I don't know the Izhikevich model very well, but I think your model
definition looks basically fine. The reason why you are not seeing
spikes is probably because your input current is too low: I guess you
meant to use "15*mV/ms" instead of "15*mV/second", i.e. a 1000 times
stronger current?

A minor remark: you are mixing global constants (the variables defined
outside the equations) and per-neuron variables (a and d inside the
equations) which can be confusing (that's why you get warnings; in your
case, the global constants will actually be ignored). If you want all
neurons to use the same values for a and d, define them as variables
outside (as in your lines 6-7) but remove them from the neuron equations
(lines 16-17), and don't assign initial values to them (lines 28-29); if
you want each neuron to (potentially) have a different values of a and
d, remove the definition outside (l. 6-7) and keep the definition in the
equations and the initialization (potentially with a different value for
each neuron).

If you use the second option, then you could also add "(constant)" after
the unit definition for a and d to state that these are not variables
that change over the course of the simulation (see
http://brian2.readthedocs.io/en/stable/user/equations.html#flags). This
is mostly for optimization, though, it doesn't change anything
fundamentally.

Hope that helps, best
  Marcel

Roger

unread,
Dec 20, 2017, 5:42:12 PM12/20/17
to Brian
This should fix it. Just few changes:
from brian2 import *
from scipy import stats


start_scope
()
number
= 1 #number of neurons
#a = 0.02/ms

b
= 0.2/ms
c
= -65 * mV
#d = 6*mV/ms
I
= 15*mV/ms


#Neuronal equations of the Izhikevich-neuron
eqs
= '''
dv/dt = (0.04/ms/mV)*v**2+(5/ms)*v+140*mV/ms-u+I : volt
du/dt = a*(b*v-u)                                : volt/second
a                                                : 1/second
d                                                : volt/second


'''



reset
= '''
v = c
u = u + d
'''



#Set up neuron population
G
= NeuronGroup(number,eqs,threshold='v >= 30*mV',reset=reset,method='euler')
G
.a = 0.02/ms
G
.d = 8*mV/ms
G
.v = c
G
.u = b * c


M
= StateMonitor(G,'v', record=True)


run
(100*ms)


figure
plot
(M.t/ms, M.v[0])
xlabel
('Time (ms)')
ylabel
('v');

show
()
Reply all
Reply to author
Forward
0 new messages