import sys
from pyNN.utility import get_script_args
import pdb
import matplotlib.pyplot as plt
simulator_name = get_script_args(1)[0]
exec("from pyNN.%s import *" % simulator_name)
setup(min_delay=0.1)
cells = Population(2, IF_curr_exp(v_rest = -65.0, v_thresh=-55.0, tau_refrac=5.0, i_offset=-1.0))
dc_source = DCSource(amplitude=0.5, start=25, stop=50)
cells[0].inject(dc_source)
cells[1].inject(dc_source)
cells.record(['v'])
run(100)
plt.subplot(2,1,1)
vm = cells.get_data().segments[0].filter(name="v")[0]
plt.plot(vm.times, vm[:, 0], 'r')
plt.xlabel("time (ms)")
plt.ylabel("Vm (mV)")
plt.subplot(2,1,2)
plt.plot(vm.times, vm[:, 1], 'r')
plt.xlabel("time (ms)")
plt.ylabel("Vm (mV)")
plt.show(block=True)
end()
However if I create another dc_source and inject it in cells[1], it works just fine.
This code works with neuron.
Consider the code :
When I try to inject the same dc_source into cells[0] and cells[1]
I get and error :
However if I create another dc_source and inject it in cells[1], it works just fine.
This code works with neuron.