Code: Select all
from neuron import h, rxd
from pylab import *
h.load_file('stdrun.hoc')
dend = h.Section(name='dend')
cyt = rxd.Region([dend], name='cyt', nrn_region='i')
specNameLen=21
specs = []
vecs = []
vec_t = h.Vector()
vec_t.record(h._ref_t)
for i in range(0,2):
specs.append(rxd.Species(cyt, name='X'*(specNameLen-5)+'spec'+str(i), charge=0, initial=rand(1)))
vecs.append(h.Vector())
vecs[i].record(specs[i].nodes(dend)(0.5)[0]._ref_concentration)
cvode = h.CVode()
cvode.active(1)
cvode.atol(1e-3)
h.continuerun(100)
print "Simulation done"