Page 1 of 1

Probable bug in IClamp mechanism

Posted: Mon Jul 04, 2011 2:38 am
by Keivan
ICamp injects current from t=0 if delay (of IClamp) is less than 200 ms.
When delay is more than 200 ms everything works fine.

I can send you a test model if you want.

Code: Select all

NEURON -- VERSION 7.2 (522:60f37c136abb) 2011-06-02
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008

Re: Probable bug in IClamp mechanism

Posted: Mon Jul 04, 2011 10:41 am
by Keivan
What should I do?

Re: Probable bug in IClamp mechanism

Posted: Mon Jul 04, 2011 11:35 am
by ted
Keivan wrote:ICamp injects current from t=0 if delay (of IClamp) is less than 200 ms.
When delay is more than 200 ms everything works fine.
Haven't seen this ever. I'm using 7.2 (524:1a4443872b11) and it doesn't happen. Suggest you try the very latest alpha version, which is
http://www.neuron.yale.edu/ftp/neuron/v ... -setup.exe
for MSWin, and
http://www.neuron.yale.edu/ftp/neuron/v ... 524.tar.gz
for UNIX/Linux/OS X

Re: Probable bug in IClamp mechanism

Posted: Mon Jul 04, 2011 1:06 pm
by Keivan
Dear ted
I tried 7.2 524 and 7.2 526 in linux and windows:
with cvode active and inactive -> problem exist
with and without active mechanism -> it exist

I use this init() code you gave me before:

Code: Select all

//initialize it to steady state
INITDUR = 300 // # ms to reach steady state
proc init() {
  finitialize(v_init)
  t = -2*INITDUR // jump to a time "before" 0
  temp = cvode.active()
  if (temp != 0) { // if cvode is on, turn it off
    cvode.active(0)
    dt = 0.025
  }
  while (t < INITDUR) {
    fadvance()
  }
  if (temp != 0) { cvode.active(1) } // turn cvode back on if necessary
  t = 0
  if (cvode.active()) {
    cvode.re_init()
  } else {
    fcurrent()
  }
  frecord_init()
}
I'm sure the model initializes in 200 ms but I set INITDUR = 300. -> it worsens the problem.
This is a real trouble for me because I cannot initialize the model properly.
it seems neuron or IClamp() do not understand negative t anymore.

Re: Probable bug in IClamp mechanism

Posted: Mon Jul 04, 2011 2:27 pm
by Keivan
I was thinking about this all the day. I think I found the solution. the init code should change in this part:

Code: Select all

  while (t < 0) {
    fadvance()
  }
excuse me if I asked this stupid question. I should be more careful.

Re: Probable bug in IClamp mechanism

Posted: Tue Jul 05, 2011 12:24 am
by ted
I see from your most recent post that you were tracking down the problem (good!), but here's what caught my attention in your earlier message--
Keivan wrote:I use this init() code you gave me before:
Did the code I sent you really do this?

Code: Select all

INITDUR = 300 // # ms to reach steady state
proc init() {
  . . .
  t = -2*INITDUR // jump to a time "before" 0
  . . .
  while (t < INITDUR) {
There's the problem. Since INITDUR>0, the "while" statement should be

Code: Select all

  while (t < -INITDUR) {

Re: Probable bug in IClamp mechanism

Posted: Tue Jul 05, 2011 6:40 am
by Keivan
this is the topic.

Re: Probable bug in IClamp mechanism

Posted: Tue Jul 05, 2011 1:28 pm
by ted
My mistake. Fixed now. Thanks for bringing this up and pointing me to the thread that contained the erroneous code.