- Code: Select all
That's not going to do what you want, because h.run() << trigger warning . . . naked hoc syntax starts here >> calls stdinit() before it enters the main computational loop that executes a simulation.* stdinit() in turn calls init() (among other things), which calls finitialize(v_init). If you want to launch simulations in which the model is first initialized to something other than the default value of v_init (which is -65 mV), you must first change v_init. << you are now re-entering the world of Python >> (good, I thought we were going to get stuck).
Does anyone know how to truly change v_init?
Direct assignment works.
h.v_init = whatever you like
Then call h.run() and all will be well.
*--Why does run() call stdinit() before it calls continuerun(tstop)? Because it is often useful to run a series of simulations interactively, so it's convenient for run() to take care of initialization before the task of generating a solution begins. NEURON's initialization and standard run system is discussed in chapters 7 and 8 of The NEURON Book, but you can also learn a lot just by examining the contents of stdrun.hoc in nrn/share/nrn/lib/hoc