But the record for 2nd simulation, i.e. variables"soma_v_2" and "t_2" return nothing.
I didn't tell you to do this
Code: Select all
# record for 2nd simulation
soma_v_2 = h.Vector().record(my_cell.soma(0.5)._ref_v)
t_2 = h.Vector().record(h._ref_t)
did I?
Omit those two statements, and at the end of the second run your soma_v and t vectors will contain the values calculated at all times from t==0 to the end of the second run, and you can do whatever you like with those data after the end of the second run.
If you don't want to save the results generated before you make your parameter changes, then execute
h.frecord_init()
just before your
h.continuerun(1000)
statement, and the soma_v and t vectors will contain only the results generated during the second run.
If you want to know more about segmenting simulations and using h.frecord_init(), search the Forum for frecord_init, and in paricular read this post
viewtopic.php?p=15895#p15895
If you use the same first simulation many times, you might be able to save some run time by using SaveState. Read about it in NEURON's Python documentation at nrn.readthedocs.io, and check the Forum for examples.