Page 1 of 1

VClamp SEClamp delay

Posted: Thu Jun 27, 2013 8:49 am
by oren
Is there a way to use VClamp with a delay? I need the voltage clamp to start in a certain time point, and then to stop.
Is it possible in the gui?

Thank You

Code: Select all

edit: I added "SEClamp" to the title for better search result 

Re: VClamp delay

Posted: Thu Jun 27, 2013 12:06 pm
by ted
oren wrote:Is there a way to use VClamp with a delay?
First read
Use SEClamp instead of VClamp
in the Forum's "Hot tips" area
viewforum.php?f=28&start=50
I need the voltage clamp to start in a certain time point, and then to stop.
That's the SEClamp's dur1 parameter. See the Programmer's Reference.
Is it possible in the gui?
Use a PointProcessManager.
NEURONMainMenu / Tools / Managers / Point Manager
SelectPointProcess / SEClamp

Re: VClamp delay

Posted: Thu Jun 27, 2013 12:48 pm
by oren
I am sorry, I did not understood, I need the SEClamp to be with delay, Not to start at t=0
is it possible?

In the program refference I get " Clamp is on at time 0, and off at time dur1+dur2+dur3" I want the clamp to stat on time=10ms not on time= 0

Re: VClamp delay

Posted: Fri Jun 28, 2013 2:21 pm
by ted
oren wrote:I am sorry, I did not understood, I need the SEClamp to be with delay, Not to start at t=0
Actually it was I who did not understand.

If an SEClamp exists, it is always on. However, an SEClamp is simply a voltage source, so if you increase its series resistance rs to 1e9 (megohms), the SEClamp will not affect the segment to which it is attached.

So what you need is a way to make the SEClamp's rs be 1e9 megohms at the start of a simulation, and change to something much lower (1 megohm, or better 0.001 megohm). This can be done with events.

Suppose you have an SEClamp that you called sec. If you include this code

Code: Select all

STARTSEC = 10 // or whatever you want
proc delaysec() {
  sec.rs = 1e9
  cvode.event($1, "sec.rs = 0.001")
}
objref fih
fih = new FInitializeHandler("delaysec(STARTSEC)")
in your program AFTER model setup is complete, but BEFORE run() is called, sec.rs will be 1e9 megohms at the start of each simulation, and it will drop to 0.001 megohms at the time specified by STARTSEC (10 ms in this example, but you can change that to anything you like). Be sure to read the Programmer's Reference entries about the FInitializeHandler class and the CVode class's event method.