Probable bug in IClamp mechanism

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Probable bug in IClamp mechanism

Post 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
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: Probable bug in IClamp mechanism

Post by Keivan »

What should I do?
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Probable bug in IClamp mechanism

Post 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
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: Probable bug in IClamp mechanism

Post 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.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: Probable bug in IClamp mechanism

Post 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.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Probable bug in IClamp mechanism

Post 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) {
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: Probable bug in IClamp mechanism

Post by Keivan »

this is the topic.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Probable bug in IClamp mechanism

Post by ted »

My mistake. Fixed now. Thanks for bringing this up and pointing me to the thread that contained the erroneous code.
Post Reply