If I use the compute function prior to running define_shape(), it works just fine. I'm not sure why it doesn't work after?Fatal Complex arithmetic error. Attempted division by zero.
Here is my code:
Code: Select all
{load_file("nrngui.hoc")}
create soma[1], dend1[1], dend2[1], axon[1]
connect dend1(0), soma(1)
connect dend2(0), soma(0)
connect axon(0), soma(1)
soma { L = 20 diam = 10 }
dend1 { L = 250 diam = 3 }
dend2 { L = 250 diam = 3 }
axon { L = 150 diam = 1.5 }
objref all
all = new SectionList()
soma all.append()
dend1 all.append()
dend2 all.append()
axon all.append()
forsec all { nseg = int((L/(0.1*lambda_f(100))+.9)/2)*2 + 1 }
define_shape() // Running define_shape causes the following error when computing
// the impedance of the soma:
// Fatal Complex arithmetic error. Attempted division by zero.
print "diameter info: "
forsec all {
print "*** ", secname(), ": L: ", L, ", diam: ", diam
z = n3d()
for y=0,z-1 {
print "x: ", x3d(y), ", y: ", y3d(y), ", z: ", z3d(y), ", diam: ", diam3d(y)
}
}
objref zz
zz = new Impedance()
soma[0] zz.loc(0.5)
zz.compute(0)
quit()