Exemplo n.º 1
0
print("Preparing simulation ...")
defaultclock.dt = dt = 0.1*msecond
duration = 0.2*second
w = 2*msecond  # coincidence window for npss
Vrest = -60*mvolt
Vth = -50*mvolt
tau = 20*msecond

n_ext = 1000
p_ext = 0.5
p_int = 0.05
w_ext = 0.1*mvolt
r_ext = 10*hertz
w_int = 0.09*mvolt
lif_eq = Equations("dV/dt = (Vrest-V)/tau : volt")
lif_eq.prepare()
lif_group = NeuronGroup(1000, lif_eq, threshold="V>Vth", reset=Vrest,
                       refractory=2*msecond)

inp_group = PoissonGroup(n_ext, rates=r_ext)
# external input only applied to a part of the network
n_ext_rec = 100
inp_conn = Connection(inp_group, lif_group[:n_ext_rec], weight=w_ext,
                      sparseness=p_ext, fixed=True, delay=5*msecond)
asympt_inp = n_ext*p_ext*w_ext*r_ext*tau
voltage_range = Vth-Vrest
if asympt_inp <= voltage_range:
    print("Network spikes unlikely to occur: %f <= %f" % (
        asympt_inp, voltage_range))
#    print("Aborting!")
#    sys.exit()