%matplotlib inline
from brian2 import *
start_scope()
# All neurons (indices 0-9) spike at 0ms. This stimulation pattern will be
# repeated every 10ms
input_group = SpikeGeneratorGroup(10, arange(10), zeros(10)*ms,
period=10*ms)
C_m = 200*pF
g_L = 10*nS
E_L = -70*mV
v_th = -50*mV
eqs = """
dV_m/dt = (g_L * (E_L - V_m))/C_m: volt
"""
group = NeuronGroup(10, eqs, threshold='V_m > v_th',
reset='V_m = E_L')
group.V_m = E_L
syn = Synapses(input_group, group, on_pre='V_m_post += 1*mV')
syn.connect() # Connect "all-to-all"
mon = StateMonitor(group, 'V_m', record=True)
run(100*ms)
plot(mon.t/ms, mon[0].V_m/mV)
plot(mon.t/ms, mon[2].V_m/mV)
INFO No numerical integration method specified for group 'neurongroup', using method 'linear' (took 0.04s). [brian2.stateupdaters.base.method_choice]
[<matplotlib.lines.Line2D at 0x7f9f2964b510>]
start_scope()
# All neurons (indices 0-9) spike at 0ms. This stimulation pattern will be
# repeated every 10ms
input_group = SpikeGeneratorGroup(10, arange(10), zeros(10)*ms,
period=10*ms)
C_m = 200*pF
g_L = 10*nS
E_L = -70*mV
v_th = -50*mV
eqs = """
dV_m/dt = (g_L * (E_L - V_m))/C_m: volt
"""
group = NeuronGroup(10, eqs, threshold='V_m > v_th',
reset='V_m = E_L')
group.V_m = E_L
syn = Synapses(input_group, group, on_pre='V_m_post += 1*mV')
syn.connect() # Connect "all-to-all"
# Add a fixed delay for all connections
syn.delay = 5*ms
mon = StateMonitor(group, 'V_m', record=True)
run(100*ms)
plot(mon.t/ms, mon[0].V_m/mV)
plot(mon.t/ms, mon[2].V_m/mV)
INFO No numerical integration method specified for group 'neurongroup_1', using method 'linear' (took 0.02s). [brian2.stateupdaters.base.method_choice]
[<matplotlib.lines.Line2D at 0x7f9f2823d950>]
start_scope()
# All neurons (indices 0-9) spike at 0ms. This stimulation pattern will be
# repeated every 10ms
input_group = SpikeGeneratorGroup(10, arange(10), zeros(10)*ms,
period=10*ms)
C_m = 200*pF
g_L = 10*nS
E_L = -70*mV
v_th = -50*mV
eqs = """
dV_m/dt = (g_L * (E_L - V_m))/C_m: volt
"""
group = NeuronGroup(10, eqs, threshold='V_m > v_th',
reset='V_m = E_L')
group.V_m = E_L
syn = Synapses(input_group, group, on_pre='V_m_post += 1*mV')
syn.connect() # Connect "all-to-all"
# Add a synapse-specific random delay for all connections
syn.delay = 'rand()*3*ms + 2*ms'
mon = StateMonitor(group, 'V_m', record=True)
run(100*ms)
plot(mon.t/ms, mon[0].V_m/mV)
plot(mon.t/ms, mon[2].V_m/mV)
INFO No numerical integration method specified for group 'neurongroup', using method 'linear' (took 0.02s). [brian2.stateupdaters.base.method_choice]
[<matplotlib.lines.Line2D at 0x7f9f23af5f10>]
start_scope()
# All neurons (indices 0-9) spike at 0ms. This stimulation pattern will be
# repeated every 10ms
input_group = SpikeGeneratorGroup(10, arange(10), zeros(10)*ms,
period=10*ms)
C_m = 200*pF
g_L = 10*nS
E_L = -70*mV
v_th = -50*mV
eqs = """
dV_m/dt = (g_L * (E_L - V_m))/C_m: volt
"""
group = NeuronGroup(10, eqs, threshold='V_m > v_th',
reset='V_m = E_L')
group.V_m = E_L
syn = Synapses(input_group, group, on_pre='V_m_post += 1*mV')
syn.connect(p=0.5) # For all neuron pairs: 50% connection probability
# Add a synapse-specific random delay for all connections
syn.delay = 'rand()*3*ms + 2*ms'
mon = StateMonitor(group, 'V_m', record=True)
run(100*ms)
plot(mon.t/ms, mon[0].V_m/mV)
plot(mon.t/ms, mon[2].V_m/mV)
INFO No numerical integration method specified for group 'neurongroup_1', using method 'linear' (took 0.02s). [brian2.stateupdaters.base.method_choice]
[<matplotlib.lines.Line2D at 0x7f9f28279610>]
start_scope()
# All neurons (indices 0-9) spike at 0ms. This stimulation pattern will be
# repeated every 10ms
input_group = SpikeGeneratorGroup(10, arange(10), zeros(10)*ms,
period=10*ms)
C_m = 200*pF
g_L = 10*nS
E_L = -70*mV
v_th = -50*mV
eqs = """
dV_m/dt = (g_L * (E_L - V_m))/C_m: volt
"""
group = NeuronGroup(10, eqs, threshold='V_m > v_th',
reset='V_m = E_L')
group.V_m = E_L
syn = Synapses(input_group, group, 'weight: volt',
on_pre='V_m_post += weight') # synapse-specific connection weights
syn.connect(p=0.5) # For all neuron pairs: 50% connection probability
# Add a synapse-specific random delay for all connections
syn.delay = 'rand()*3*ms + 2*ms'
syn.weight = 'rand()*2*mV + 0.5*mV'
mon = StateMonitor(group, 'V_m', record=True)
run(100*ms)
plot(mon.t/ms, mon[0].V_m/mV)
plot(mon.t/ms, mon[2].V_m/mV)
INFO No numerical integration method specified for group 'neurongroup', using method 'linear' (took 0.02s). [brian2.stateupdaters.base.method_choice]
[<matplotlib.lines.Line2D at 0x7f9f23b5c310>]