本文整理汇总了Python中brian2.NeuronGroup.v0方法的典型用法代码示例。如果您正苦于以下问题:Python NeuronGroup.v0方法的具体用法?Python NeuronGroup.v0怎么用?Python NeuronGroup.v0使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类brian2.NeuronGroup
的用法示例。
在下文中一共展示了NeuronGroup.v0方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_network
# 需要导入模块: from brian2 import NeuronGroup [as 别名]
# 或者: from brian2.NeuronGroup import v0 [as 别名]
def run_network(traj):
"""Runs brian network consisting of
200 inhibitory IF neurons"""
eqs = '''
dv/dt=(v0-v)/(5*ms) : volt (unless refractory)
v0 : volt
'''
group = NeuronGroup(100, model=eqs, threshold='v>10 * mV',
reset='v = 0*mV', refractory=5*ms)
group.v0 = traj.par.v0
group.v = np.random.rand(100) * 10.0 * mV
syn = Synapses(group, group, on_pre='v-=1*mV')
syn.connect('i != j', p=0.2)
spike_monitor = SpikeMonitor(group, variables=['v'])
voltage_monitor = StateMonitor(group, 'v', record=True)
pop_monitor = PopulationRateMonitor(group, name='pop' + str(traj.v_idx))
net = Network(group, syn, spike_monitor, voltage_monitor, pop_monitor)
net.run(0.25*second, report='text')
traj.f_add_result(Brian2MonitorResult, 'spikes',
spike_monitor)
traj.f_add_result(Brian2MonitorResult, 'v',
voltage_monitor)
traj.f_add_result(Brian2MonitorResult, 'pop',
pop_monitor)