I think that the problem is caused because the syntax is for use with a point process not a distributed mechanism.
If Schannel were a class of point process, the proper syntax would not involve
mus.Schannel at all--you would use an objref (say, schan) to refer to an instance of
the Schannel class, and the syntax would be of the form
But Schannel is a distributed mechanism, so the syntax is of the form
Code: Select all
setpointer post.mus_Schannel(0.5), pre.v(0.5)
One might well ask why Schannel is NOT a point process, and why, with such modest
dimensions, nseg for your two sections is so large. Ra and/or cm would have to be
enormous to require such a fine spatial grid (with Ra = 500 ohm cm and cm = 10 uf/cm2,
nseg == 43 should be sufficient). Or maybe you're concerned with extremely short times,
or the complete model specification includes longitudinal diffusion, e.g. of calcium?
Since you are using such a large value for nseg in the section with Schannel--and also
because nseg is different in the "pre" and "post" sections--have you verified that a
single setpointer statement guarantees the proper value of mus over the entire "post"
section?
Not knowing anything particular about your ultimate purposes, here are some further
observations and suggestions:
1. e is declared but not used.
2. The conditional in the BREAKPOINT block
Code: Select all
if (mus>0){
stretch = (mus+35)*10
}
doesn't assign any value to stretch if mus<=0. This is asking for trouble.
3. Debugging and testing will be easier if your NMODL code is easily testable from hoc.
Instead of burying all complexities in the BREAKPOINT block, split them out into
FUNCTIONs which can be called from hoc. That is, instead of making stretch an
ASSIGNED, make it a FUNCTION. Likewise, rather than compute compute gna
directly from stretch with a bunch of code inside the BREAKPOINT block, split that
out into another FUNCTION.
Code: Select all
BREAKPOINT {
gna = g*fstretch(stretch(mus))
ina = gna*(v - ena)
}
FUNCTION stretch(m (mV)) (1) {
if (m>0) {
stretch = (m+35)*10/(1(mV))
} else {
stretch = 0
}
}
FUNCTION fstretch(stx (1)) (1) {
fstretch = 1/(1+exp((50-stx)/10))
}
Then you can plot stretch_Schannel(v) vs. v, fstretch_Schannel(x) vs. x (here x is
used as a generic independent variable, not range),
and fstretch_Schannel(stretch_Schannel(v)) vs. v. The results may be informative.