I'm doing some voltage clamp "experiments" and I want to plot the total current evoked in the cell by a SEClamp object. I'm trying to do this by plotting the &name of the SEClamp object.i variable. However, I always get a trace that is about 5 times the expected sum of the individual currents.
To see what I mean, execute the code below and press the 'V-Clamp' button. The model only contains a K conductance from hh, and the sum (third, blue) trace is always bigger than the K (first, black) trace.
What is wrong? Is there another variable that I should capture to get the total current?
Regards.
Code: Select all
load_file("nrngui.hoc")
create soma
access soma
soma {diam=15 L=15 Ra=100}
//insert trpm8
//insert hcn_po
insert hh
gkbar_hh = 0.003
gnabar_hh = 0
gl_hh = 0
//gmax_trpm8 = 5
dt = 0.5
tstop = 500
celsius = 34
// Parameters Initialization
objectvar vstim,istim
vstim = new SEClamp(0.5)
vstim.dur1 = 50
vstim.dur2 = 300
vstim.dur3 = 150
vstim.amp1= -60
vstim.amp3= 40
istim = new IClamp(0.5)
istim.del = 1000
istim.dur = 300
numpulses = 4
vinit = -100
vstep = 20
iinit = -0.1
istep = 0.01
// Recording stuff
objectvar vec[3],ivec
for i=0,2 vec[i] = new Vector()
ivec = new Vector()
vec[0].record(&soma.ik(0.5),1)
vec[1].record(&soma.ina(0.5),1)
vec[2].record(&vstim.i,1)
ivec.record(&soma.v(0.5),1)
//Graphical stuff
objref box1,grph
box1 = new VBox()
box1.intercept(1)
grph = new Graph()
xpanel("",1)
xbutton("V-pulses","dovc()")
xbutton("I-pulses","doic()")
xvalue("temp","celsius")
xpanel()
xpanel("",1)
xvalue("Number of pulses","numpulses",1)
xpanel()
box1.intercept(0)
box1.map("",50,50,500,350)
// V-clamp and I-Clamp steps procedures
proc dovc() {
grph.erase()
grph.size(0, 500, -0.5, 0.5)
istim.del = 1000
//vstim.rs = 0.5
for i=0,numpulses-1 {
vstim.amp2= vinit + i*vstep
run()
for j=0,2 vec[j].line(grph,j+1,1)
}
}
proc doic() {
grph.erase
grph.size(0, 500, -150, 100)
istim.del = 50
vstim.rs = 1e9
for i=0,numpulses-1 {
istim.amp= iinit + i*istep
run()
ivec.line(grph,3,1)
}
}