Page 1 of 1

Current record and plot

Posted: Tue May 07, 2013 2:01 pm
by Hessum
Hello
I made new current stimulation named "IClamp2" which is injecting the exponential current in the cell. Now I want to check it and be sure of it's correctness, but I don't know how record current and plot it in the graph. here is my code of "IClamp2" if it's helping:

: Exponential Current Clamp

NEURON {
POINT_PROCESS IClamp2
RANGE del, dur, amp, tau, i
ELECTRODE_CURRENT i
}
UNITS { (nA) = (nanoamp) }

PARAMETER {
del (ms)
dur (ms) <0, 1e9>
tau (ms)
amp (nA)
}
ASSIGNED { i (nA) }
INITIAL { i = 0 }

BREAKPOINT {
at_time(del)
at_time(del+dur)
if (t < del + dur && t > del) {
i = amp*(1-2.718^(-(t-del)/tau))
} else {
i = 0
}
}

Re: Current record and plot

Posted: Wed May 08, 2013 9:40 am
by ted
Patterned nicely after stim.mod (source for IClamp). Should work, but why use
2.718^(-(t-del)/tau)
instead of
exp(-(t-del)/tau)
?

If you want to record the generated values, and the times at which they were generated, use the Vector class's record method. To plot the contents of one Vector against those of another, use the Vector class's plot method. Read about them here
http://www.neuron.yale.edu/neuron/stati ... tml#Vector