eacheon wrote:I am using the phase plane plot tool in NEURON GUI. I find if I want to plot dV/dt ~ V, I can plot total current of that segment versus V.
You are of course referring to total ionic current, not total membrane current.
However, is there a variable which I can access from hoc that is exactly this dV/dt value?
Numerical integration always produces approximate results. The best one can get is results
that are internally consistent and within an acceptable error tolerance.
NEURON's default integrator is implicit Euler, which has first order accuracy. Greater
precision is achievable by setting secondorder = 2, which gives second order accurate
results for voltage and currents--but at different times in the course of the simulation!
That is, v is 2nd order correct at times n*dt, and i is 2nd order correct at n*dt - dt/2
(see
http://www.neuron.yale.edu/neuron/stati ... econdorder
). If you must have both correct to the highest precision at the same time, use adaptive
integration (aka cvode).
Otherwise I would have to record the vectors down and make difference of the vectors, which might be troublesome especially when I am using variable step integration in my simulation.
Not at all. Use
vdest.record(&var, DT)
where DT is your desired sampling interval, and NEURON will generate the solution wth
adaptive integration but forcing the integrator to stop at integer multiples of DT to calculate
and record the variable to your vector. So you have evenly spaced samples, and can
readily use the Vector class's deriv() method to calculate your derivative.
The only caveat is to use cvode.record rather than vector.record() if you are using local
variable time step integration.