A superficial answer: because you can't.
Another superficial answer: because it isn't valid syntax.
A less superficial answer: it isn't valid syntax because section.item is reserved for items that
depend only on the attributes of section. Unlike diam and L which are properties of the
currently accessed section, ri may also depend on the properties of the parent section and
whether there even is a parent section.
If you want a range variable, e.g. for the sake of producing a range var plot, create a
dummy density mechanism with an ASSIGNED RANGE variable.
Code: Select all
NEURON {
SUFFIX dummy
RANGE ri
}
ASSIGNED {
ri
}
(you can give it a different suffix if you want).
Compile this with mknrndll.
Insert the mechanism into all sections of interest, run finitialize() to make sure that all
geometry specifications have been evaluated, then compute ri over all sections of
interest and store those values in dummy's range variable.
Code: Select all
forall insert dummy
finitialize()
forall for (x,0) ri_dummy(x) = ri(x) // skip the 0 area nodes at 0 and 1
Now you can refer to the range variable ri_dummy like so:
print dend[0].ri_dummy(0.1)