Complex Voltage Clamp

The basics of how to develop, test, and use models.
Post Reply
fred

Complex Voltage Clamp

Post by fred »

Is there a way to write a V-Clamp in hoc that has more than 3 phases (durations and amplitudes)?

I'd like to do gapped pulse protocols in hoc, but I get an error when I try to write a VClamp with more than 3 elements.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

The Vector class's play() method can be used to drive any variable with an arbitrary
waveform. Read about it
http://www.neuron.yale.edu/neuron/stati ... .html#play
Also see this item
SEClamp and IClamp just deliver rectangular step waveforms. How can I make them
produce an arbitrary waveform, e.g. something that I calculated or recorded from a real cell?
in the FAQ list http://www.neuron.yale.edu/neuron/faq/general-questions
fred

Post by fred »

I'm having 2 problems:

1) The interpolater used in vector.play will only interpolate the first 2 points (code below). This wouldn't be a problem except that (see #2). The output I get here is a ramp instead of a triangle.

Code: Select all

    objref tempvec, tvec
    tempvec = new Vector(3)
    tvec = new Vector(3)
    tempvec.x[0] = -80  // mV
    tvec.x[0] = 0
    tempvec.x[1] = 20   // mV
    tvec.x[1] = 10
    tempvec.x[2] = -80   // mV
    tvec.x[2] = 15
    tempvec.play(&stim.amp[0], tvec, 1)
2) I'm having trouble using vector.play without using the interpolation feature. The following code produces a VClamp output that's steady at -80mV. What I'm trying for is a triangular waveform. I tested tempvec2 to make sure it's interpolated as desired, but it isn't playing correctly.

Code: Select all

    objref tempvec, tempvec2, tvec, tvec2
    tempvec = new Vector(3)
    tvec = new Vector(3)
    tempvec.x[0] = -80  // mV
    tvec.x[0] = 0
    tempvec.x[1] = 20   // mV
    tvec.x[1] = 10
    tempvec.x[2] = -80   // mV
    tvec.x[2] = 15
    tvec2 = new Vector(15/dt+1)
    tvec2.indgen(0,15,dt)
    tempvec2 = tempvec.c.interpolate(tvec2,tvec)
    tempvec2.play(&stim.amp[0], tvec2)
Any hints?
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

fred wrote:I'm having 2 problems:

1) The interpolater used in vector.play will only interpolate the first 2 points (code below). This wouldn't be a problem except that (see #2). The output I get here is a ramp instead of a triangle.
Let's deal with this first, because it will obviate the second question. You
apparently want to make a VClamp ramp from -80 to 20 mv over the first
10 ms, then back down to -80 mv over the next 5 ms, where it should
stay ever after.

Is dur[0] long enough? Hint: make it 1e9 ms.
Is tstop long enough, i.e. >= 15 ms to see the entire waveform.
Finally, to keep the command potential at -80 mv you'll need to tack one
more element onto the end of each of the Vectors, i.e. -80 for the
"command potential Vector" and 1e9 for the "time vector". Otherwise the
clamp's command potential will jump back to 0 mv at t == 15 ms.

Now a couple of questions for you: why not use SEClamp? Have you read
What is the difference between SEClamp and VClamp, and which should I use?
at
http://www.neuron.yale.edu/neuron/faq/general-questions
?
fred

Post by fred »

Is dur[0] long enough? Hint: make it 1e9 ms.
Is tstop long enough, i.e. >= 15 ms to see the entire waveform.
dur[0] is set longer than tstop. tstop is set at 30 ms, allowing me to see the entire waveform 'play' in simulation.
Now a couple of questions for you: why not use SEClamp? Have you read What is the difference between SEClamp and VClamp, and which should I use?
I just read this for the first time, and I'll start using SEClamp for this type of input.

I'm still lost as to why the interpolater doesn't work as I expected. Has anyone used this before? Any ideas?
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

fred wrote:I'm still lost as to why the interpolater doesn't work as I expected. Has anyone used this before? Any ideas?
I have, most recently just prior to answering your previous questions. To
discover why your code can't get this feature to work properly, it will be
necessary to examine your code. If you zip up just enough hoc, ses, and
mod files to reproduce the problem and email it to me
ted dot carnevale at yale dot edu
I'll take a look and tell you whether you have discovered a new bug, or
if the problem is something more mundane (e.g. a run of the mill syntax
error).
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

ted wrote:I'll take a look and tell you whether you have discovered a new bug, or
if the problem is something more mundane (e.g. a run of the mill syntax
error).
The interpolation error reported by fred was related to having no sections. This has been
fixed in versions released on or after July 7, 2006.
Post Reply