compute nseg

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
Posts: 75
Joined: Sun Feb 20, 2011 7:15 pm

compute nseg

Post by shyam_u2 » Thu Aug 22, 2013 2:33 am

I don't understand the following line from fixnseg.hoc
nseg = int((L/(d_lambda*lambda_f(freq))+0.9)/2)*2 + 1
I want to set the distance between adjacent nodes to 10% of AC length constant at 100 Hz. For a compartment of length 60 um, diam 3 um, Ra 100 um and cm =1uf/cm2,I get the distance between adjacent nodes to be 488(AC length constant at 100 Hz) *0.1 = 48.8 um. I expect the the same spacing between internal nodes even for longer compartments. But in NEURON, using the function fixnseg.hoc, nseg for the compartment mentioned above for lengths of 60 and 120 um are 3 and 3 respectively which means the spacing between the internal nodes are big in 120 um compartment than in 60 um counterpart. Any reasons?

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

Re: compute nseg

Post by ted » Thu Aug 22, 2013 1:24 pm

nseg needs to be the smallest odd number such that L/nseg is < 0.1*lambda at 100 Hz. Why an odd number? So that there is a node at 0.5. Why should there be a node at 0.5? Because
returns the value of rangevarname at 0.5. If nseg is even, 0.5 lies on the boundary between two adjacent segments, and roundoff error will determine which of these segments is the one whose node is referenced by
It is not a good idea to create situations in which a result is determined by roundoff error.

Post Reply