Page 1 of 1

Posted: Mon Jan 22, 2007 2:30 pm
by thats_karlo
Hi,

suppose we have 3 sections,e.g. A,B,C, with the following properties

Code: Select all

create A,B,C
A {L=30 diam=3}
B {L=40 diam=5}
C {L=50 diam=1}

connect A(1),B(0)
connect B(1),C(0)
then,
oc> A for (x) {print ri(x)}
0.75121133
0.75121133
0.36058114

oc> B for (x) {print ri(x)}
0.36058114
0.36058114
1e+30

oc> C for (x) {print ri(x)}
1e+30
11.26817
11.26817


Two questions:


1- Since A, B is connected, does ri(x=1) means resistance between two section A, B?
if yes, the the resistance between two sections is
ri(x=1),from A side, or ri(x=0) from B side,
or the resistance bewteen two sections is
ri(x=1)+ri(x=0)?



2-Did i make mistake to conncet B,C? i don't know why i get a big number for ri(x=1) for B and ri(x=0) for C?


thanks in advance

Kralo

never connect 1 to 0

Posted: Mon Jan 22, 2007 10:15 pm
by ted
The documentation of ri() states
"Return the resistance (in megohms) between the center of the segment containing x and
its parent segment. This can be used to compute axial current given the voltage at two
adjacent points. If there is no parent the "infinite" resistance returned is 1e30."

Your example produces a model with this topology, as revealed by typing
topology()
at the oc> prompt:

Code: Select all

|-|       C(0-1)
 `|       B(1-0)
   `|       A(1-0)
Notice that in C, range increases with increasing distance from the soma,
but in B and A range decreases with increasing distance from the soma.
This is why the results are confusing.

The root section of this tree is C. The first value printed by
C for (x) {print ri(x)}
is 1e+30 because the 0 node of C has no parent segment.
The second and third values are the path resistance from the middle of C
to the 0 end of C, and from the 1 end of C to the middle of C.

The first two values printed by
B for (x) {print ri(x)}
are the path resistance from the 0 node of B to the middle of B
and from the middle of B to the 1 node of B.
The third value is 1e+30 because the 1 node of B is attached to the 0 node
of C, so it has no parent segment because the 0 node of C has no parent
segment.

The three values printed by
A for (x) {print ri(x)}
are the path resistances from the 0 node of A to its middle node,
from its middle node to its 1 node, and from its 1 node to the middle node
of B, its parent section.


To avoid such confusing results, never do this
connect b(1), a(0)
or this
connect b(1), a(1)
because the resulting topologies will have some sections in which
increasing range means more distance from the root of the tree, and
other sections in which increasing range means closer to the root.
This also messes up space plots and makes it difficult to write code
that sets up nonuniform distributions of biophysical properties, such
as channel densities.

Either of these is OK
connect b(0), a(0)
connect b(0), a(1)
because it will produce a topology in which increasing range means
increasing distance from the root of the tree.