print ri()

The basics of how to develop, test, and use models.
Post Reply
vdhelm
Posts: 4
Joined: Fri Jun 01, 2007 5:50 am
Location: University of Munich

print ri()

Post by vdhelm »

Hi!

I read the topics about plotting an axial current.
Now I want to plot an expression like dend[0].ri(0.1) but it always gives me a syntax error.

So my question is: why cant I print this expression

Code: Select all

print dend[0].ri(0.1)
but this one is no problem:

Code: Select all

dend[0] print ri(0.1)
Thanks
Martin
ted
Site Admin
Posts: 6389
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

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)
Post Reply