little confusion about 3D

Particularly useful chunks of hoc and/or NMODL code. May be pedestrian or stunningly brilliant, may make you gasp or bring tears to your eyes, but always makes you think "I wish I had written that; I'm sure going to steal it."
Post Reply
figoyouwei
Posts: 41
Joined: Sun Aug 08, 2010 11:09 am

little confusion about 3D

Post by figoyouwei » Tue Dec 17, 2013 1:56 pm

Dear,

Given this simply example, I would expect that diam(0)=5 and diam(1)=1, don't understand why diam(0)=diam(0.1) and diam(0.9)=diam(1) ? Thank you.

create dend
access dend
dend {
pt3dadd(10, 0, 0, 5)
pt3dadd(10, 10, 0, 1)
nseg = 5
}

print L, diam(0)
print L, diam(0.1)
print L, diam(0.3)
print L, diam(0.5)
print L, diam(0.7)
print L, diam(0.9)
print L, diam(1)

ted
Site Admin
Posts: 5300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: little confusion about 3D

Post by ted » Tue Dec 17, 2013 5:10 pm

diam is a range variable. For any range variable, diam(x) refers to the value at the center of the segment that contains x. For x that lies on a boundary between segments, the value you get will be determined by roundoff error. For x = 0 or 1, the values will be from the middle of the first or last segment, respectively. This stuff is covered in chapters 5 and 6 of the NEURON Book. If you don't have that, at the very least read this
Hines, M.L. and Carnevale, N.T. The NEURON simulation environment. Neural Computation 9:1179-1209, 1997.
Preprint is available at http://www.neuron.yale.edu/neuron/nrnpubs

figoyouwei
Posts: 41
Joined: Sun Aug 08, 2010 11:09 am

Re: little confusion about 3D

Post by figoyouwei » Tue Dec 17, 2013 5:29 pm

thank you Ted for pointing out chapters, I guess diam3d() is the correct way to print out edge diam then :)

ted
Site Admin
Posts: 5300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: little confusion about 3D

Post by ted » Wed Dec 18, 2013 12:12 am

Depends on what you mean by "correct." From the standpoint of the equations that are solved in the course of a simulation, the relevant value is the diameter of the segment, which is diam(x). If 3d points exist, diam(x) becomes the diameter of a right cylinder with the same length and surface area as the segment that contains x. If define_shape() is called (either directly or by creating a Shape plot), 3d points are created for sections that were originally specified using the stylized method; this can cause slight changes to diam(x), area(x), and ri values--see 5.5.3 Avoiding artefacts in The NEURON Book. To minimize this effect, it is best to try to ensure that sudden diameter changes occur only at the boundaries of sections.

Post Reply