I have a model whose topology is a ball (soma) and several sticks (dendrites). I use the impedance class in order to calculate the electrotonic distance of each dendritic segment from the soma using the following code:
Code: Select all
finitialize(-65)
zz = new Impedance()
soma { zz.loc(0.5) }
zz.compute($1, 1)
zn = 0
soma { zn = zz.input(0.5) }
forsec "den" {
for (x,0) {
ElectroDist_info(x) = -log(zz.transfer(x)/zn)
}
}