## Weird "trap" function in Bazhenov 2002 model

Discussions of particular models.

Moderator: tom_morse

pascal
Posts: 89
Joined: Thu Apr 26, 2012 11:51 am

### Weird "trap" function in Bazhenov 2002 model

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

### Re: Weird "trap" function in Bazhenov 2002 model

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?
pascal
Posts: 89
Joined: Thu Apr 26, 2012 11:51 am

### Re: Weird "trap" function in Bazhenov 2002 model

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

### Re: Weird "trap" function in Bazhenov 2002 model

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.
pascal
Posts: 89
Joined: Thu Apr 26, 2012 11:51 am

### Re: Weird "trap" function in Bazhenov 2002 model

Fair enough, thanks. I just wanted a sanity check to make sure I wasn't missing something.