Using FInitializeHandler to set initial voltages for a subset of cells
Posted: Thu Jul 11, 2019 7:24 pm
I am running a simulation in which I want all cells to be initialized to -68 mV, except for a subset of cells (RE cells), which I want to start at -61 mV.
I've tried this code (where 'pc' is a ParallelContext object):
When I run the simulation (using psolve), I find that the RE cell starts at -68 mV. I've tried using types 0, 1, 2, and 3 as the first argument to FInitializeHandler, all to no avail.
I've tried this code (where 'pc' is a ParallelContext object):
Code: Select all
def set_RE_voltages():
for re_gid in net.re_gidList:
pc.gid2cell(re_gid).v=-61
if(h.cvode.active()):
h.cvode.re_init()
else:
h.fcurrent()
h.frecord_init()
fih = h.FInitializeHandler(1, set_RE_voltages)
h.finitialize(-68)