In [1]:
from brian import *
from model.mitral_cells import MitralCells
from model.parameters import Mitral
psmt = Mitral()
In [2]:
N_mitral = 100
istart = 0.*amp*meter**-2
istop = 0.01*amp*meter**-2
period = 2.*second
N_trial = 1
N_tot = N_mitral*N_trial
nt_refract = linspace(psmt.t_refract, 10*psmt.t_refract, N_trial)
In [3]:
mt = MitralCells()
In [4]:
mt.add_eqs({'var': ['+I_electrode'], 'eqs' : ['I_electrode : amp*meter**-2']})
In [5]:
mt.make_pop(N_tot)
currents = array(list(linspace(istart, istop, N_mitral))*N_trial)
for i in xrange(N_trial):
mt.pop.I_electrode = currents
mt.pop.V = psmt.E_L
In [6]:
rneuron = [0, int(N_tot/2), N_tot-1]
monitV = StateMonitor(mt.pop, 'V', record = rneuron)
monit_spikes = SpikeMonitor(mt.pop, record=True)
In [7]:
defaultclock.dt = 0.05*msecond
netw = Network(mt.pop, monit_spikes, monitV)
netw.run(period, report='text')
Spikes
In [8]:
print monit_spikes.nspikes, 'spikes'
figure()
raster_plot(monit_spikes)
Membrane potential
In [9]:
figure()
for i in rneuron:
plot(monitV.times/msecond, monitV[i]/mvolt)
xlabel('time (ms)')
ylabel('mitral membrane potential (mvolt)')
Out[9]:
fI curve
In [10]:
freqs = []
stimes = monit_spikes.spiketimes
for neuron in stimes:
freqs += [len(stimes[neuron])/period]
figure()
plot(array(currents)/(amp*meter**-2), array(freqs)/second**-1)
xlabel('current I (amp*meter**-2)')
ylabel('frequency f (Hz)')
show()
In [10]: