We simlulate the model proposed in Brunel (2000). http://link.springer.com/article/10.1023/A:1008925309027
Import libraries and prepare nest for new simulation
In [1]:
import sys
sys.path.append('/opt/lib/python2.7/site-packages/')
In [2]:
import numpy as np
import pylab
import nest
import nest.raster_plot
nest.ResetKernel()
Enable multi-threading. Set number of threads equal to the number of processor cores (e.g. 8 for intel i7)
This enables the nest simualtor to use multiple processor cores resulting in faster simulation.
In [3]:
nest.SetKernelStatus({'local_num_threads': 8})
In [4]:
total_population = 10000
pop_e = 0.8*total_population
pop_i = 0.2*total_population
In [5]:
nest.Models('nodes')
Out[5]:
To know more about a particular model, execute in a new ipython shell
nest.help('iaf_psc_delta')
We are going to use the iaf_psc_delta
model neuron for this simulation.
We define the default parameters for this model and later we set the model defaults to these values (for this session).
Neuron parameters:
In [6]:
delay = 1.5
tau_ref = 2.0
tau_m = 20.0
V_th = 20.0
V_e = 0.0
V_reset = 10.0
J_e = 0.1
eta = 2.0
C_m = 1.0
Define Neuron-neuron connection probabilities (10%)
In [7]:
connection_probability = 0.1
C_e = connection_probability*pop_e
C_i = connection_probability*pop_i
Factor for IPSP/EPSP amplitudes
In [8]:
g = 5.0
IPSP Amplitude
In [9]:
J_i = -1*g*J_e
Firing rate of a neuron in the external population
In [10]:
nu_ext = eta*V_th/(J_e*C_e*tau_m)
Population rate of the whole external population
In [11]:
p_rate = 1000.0*nu_ext*C_e
Make the nest kernel print progress of the simulation
In [12]:
nest.SetKernelStatus({'print_time': True})
Set the default values for the iaf_psc_delta
neuron model
In [13]:
nest.SetDefaults('iaf_psc_delta', {
'C_m': C_m,
'tau_m': tau_m,
't_ref': tau_ref,
'E_L': 0.0,
'V_th': V_th,
'V_reset': V_reset
})
In [14]:
nodes = nest.Create('iaf_psc_delta', total_population)
nodes_e = nodes[:int(pop_e)]
nodes_i = nodes[int(pop_e):]
Create Poisson noise
In [15]:
noise = nest.Create('poisson_generator', 1, {'rate': p_rate})
Create a spike detector for each of the neuronal populations, and label them. Each detector outputs spikes into files corresponding to the label names
In [16]:
spikes = nest.Create('spike_detector', 2, [{'label': 'ex'}, {'label': 'in'}])
spikes_e = spikes[:1]
spikes_i = spikes[1:]
In [17]:
nest.CopyModel('static_synapse_hom_w', 'excitatory', {'weight': J_e, 'delay': delay})
nest.CopyModel('static_synapse_hom_w', 'inhibitory', {'weight': J_i, 'delay': delay})
In [18]:
nest.Connect(nodes_e, nodes, {'rule': 'fixed_indegree', 'indegree': int(C_e)}, 'excitatory')
nest.Connect(nodes_i, nodes, {'rule': 'fixed_indegree', 'indegree': int(C_i)}, 'inhibitory')
nest.Connect(noise, nodes, syn_spec='excitatory')
In [19]:
nest.Connect(nodes_e[:50], spikes_e)
nest.Connect(nodes_i[:50], spikes_i)
In [20]:
nest.Simulate(300)
In [21]:
nest.raster_plot.from_device(spikes_e, hist=True)
pylab.show()
In [21]: