Hybrid Clamp

NMODL and the Channel Builder.
Post Reply
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

Hybrid Clamp

Post by Bill Connelly »

A voltage clamp that activates after the action potential.

It seems to run very slowly. Is this simply due to the watch statement?

I've never dealt with a breakpoint statement that isn't a ODE in some form. Is how I've done this fine?

Finally, why does this behave strangely when gain is between 0.001 and 10 ? I would have thought setting the gain very high could cause oscillations, but how does having it too low do it?

Code: Select all

 
UNITS {
  (mA) = (milliamp)
  (mV) = (millivolt)
}

NEURON {
  POINT_PROCESS Hybrid_Clamp
  NONSPECIFIC_CURRENT i
  RANGE vc, gain, dur
}
 
PARAMETER {
	thresh = 2 (mV)
	dur = 10 (ms)
	delay = 1 (ms)
	gain = 1000
	vc = -75 (mV)
}
 
 
ASSIGNED {
  on
  i (nA)
  v (mV)
}
 
BREAKPOINT {
  if (on) {
		i = (vc - v)*gain
	}else{
		i = 0
	}
}
 
 
INITIAL {
  net_send(0, 3)
  on=0
}

NET_RECEIVE (dummy) {
  if (flag==2) { : a spike has occurred
    net_send(delay, 4)
  } else if (flag==4) {
    if (on == 0) { : voltage clamp is off, so turn it on
      on = 1
      net_send(dur, 1) : to turn it off
    } else if (on == 1) { : if VS is already on, delay the recovery time
      net_move(t + dur)
    }
  } else if (flag==1) { : time to VC off
    on = 0
  } else if (flag==3) {
    WATCH (v > thresh) 2 : detect spike
  }
}
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Hybrid Clamp

Post by ted »

Every time a spike is detected, a new event with flag==4 is sent. Do you really want to do that, or having sent one flag==4 event, do you want to wait until the response to it has run its course? Not sure this has anything to do with speed of execution, unless it stuffs a whole bunch of events into the queue (which you could discover with a printf() statement or two).

When the clamp is on, it's just a voltage source in series with a resistance equal to 1/gain. If gain is small, and the command potential is depolarized compared to spike threshold, you have a crummy current clamp that injects a depolarizing current.
Post Reply