Page 1 of 1

Weird "trap" function in Bazhenov 2002 model

Posted: Wed Oct 03, 2018 11:27 am
by pascal
I am trying to code the Bazhenov 2002 sleep model in NEURON (ModelDB link: https://senselab.med.yale.edu/ModelDB/s ... odel=28189), and I have run across a very strange "trap" function for the fast sodium current in the cortical pyramidal cells. The details of this current are found in the appendix of Timofeev 2000 ("Origin of Slow Cortical Oscillations in Deafferented Cortical Slabs") and Table 2 of Chen 2012 ("Interneuron-mediated inhibition synchronizes neuronal activity during slow oscillation"). There, the alpha function associated with the "m" gating variable is:

alpha(v) = 0.182*(v+25.0)/(1.0 - exp(-(v+25.0)/9.0) ) if |v-10|/35 > 10^{-6}

alpha(v) = 1.638 if |v-10|/35 < 10^{-6}

I understand that trap functions are employed numerically to prevent dividing by zero. However, there is no possibility of dividing by 0 at v=10. Furthermore, this curve is equal to approximately 6.503 at v=10, so setting it to 1.638 makes the function discontinuous.

The authors provide no explanation for this, and they have not responded to my inquiries over email.

Has anyone seen anything like this before? I am baffled...

Re: Weird "trap" function in Bazhenov 2002 model

Posted: Thu Oct 04, 2018 10:03 am
by ted
Published articles are subject to all kinds of errors that should have been, but weren't, caught by authors, editors, or proofreaders. That's why ModelDB exists--when it comes to being absolutely sure about what the authors did, there is no substitute for original source code.

Speaking of which--does the source code in the ModelDB entry http://modeldb.yale.edu/28189 allow you to reconstruct the equations that Bazhenov et al. actually used?

Re: Weird "trap" function in Bazhenov 2002 model

Posted: Thu Oct 04, 2018 10:42 am
by pascal
Good question. I should have mentioned in my original post that yes, I have checked the source code you referenced (written in C++), and it incorporates this exact trap function. It's so bizarre that it makes the function discontinuous. I'll try emailing the authors one more time...

Re: Weird "trap" function in Bazhenov 2002 model

Posted: Thu Oct 04, 2018 12:45 pm
by ted
I have checked the source code you referenced (written in C++), and it incorporates this exact trap function. It's so bizarre that it makes the function discontinuous.
Just got an email from HAL 9000, which I quote here:
"I wouldn't dump core about this, which is unlikely to cause a qualitative change of simulation results (as long as no cell was clamped to a potential in the "trapped" range). It's just another demonstration that at least some programmers are human. Let him/her/whatever that is without fault throw the first error (or is it the other way around?)."

That said, I think ModelDB's curators will fix the bug and notify the authors.

Re: Weird "trap" function in Bazhenov 2002 model

Posted: Thu Oct 04, 2018 11:02 pm
by pascal
Fair enough, thanks. I just wanted a sanity check to make sure I wasn't missing something.