Hi,
By coincidende I came across a mismatch between the theoretical length constant and the length constant found by looking at the 0.37 fraction of the voltage at the injection site.
To look into this, I created a long cable of uniform diameter, and measured the length constant of the cable (by looking at the 0.37 fraction of V0) for different values og nseg. I tried by stimulating both in the sealed end and in the middle of the cable. What I found was that the length constant varies as a function of nseg.
I calculated the theoretical length constant as:
lambda=sqrt(Rm/Ra*d/4) (from Koch and Segev, Methods in Neuronal modeling)
When inserting Rm=8500 OhmCm^-2, Ra=70 OhmCm^-1, d=0.3 um, I get lambda = 302 um. The (0.37) values read from NEURON's simulations are (by stimulation in 0.5):
nseg = [6 10 15 20 25 30 35 40 50 70]
lambda= [350 366 343 315 333 312 330 323 323 323]
Am I doing something wrong or is there a known explanation for this issue?
Best regards,
Ulrik
nseg and the length constant
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: nseg and the length constant
The mismatch you describe is to some extent a consequence of several conceptual mismatches between what you think NEURON does, and what it actually does. But to some extent it is also probably attributable to the use of a section that is not nearly long enough.
First, the NEURON-specific considerations. NEURON computes solutions at internal nodes (grid points) that are located at uniformly spaced distances dist along the length L of a section, where
dist = L*(0.5 + i)/nseg for i = 0 . . . nseg-1
sectionname.v(x) refers to the value of v at the internal node that is nearest to x. If x lies midway between two internal nodes, the value that is returned will be the value at one of those nodes, and the node whose value you get will depend on roundoff error.
This has several consequences.
1. If nseg is even, there will be no node at the midpoint of a section. Trying to reference the midpoint of a section with even nseg will instead reference the adjacent node at 0.5*(1 - (1/nseg)) or 0.5*(1 + (1/nseg)), depending on roundoff error. So if you ever want to refer to the midpoint of a section--either to attach a signal source to that location, or to measure the value of any variable at that location--you should never assign an even value to nseg.
That partially accounts for your results with even values for nseg.
2. Unless you are very careful about specifying the anatomical and biophysical properties of a section, there will be no internal node that lies exactly 1 length constant from the section's 0 or 1 end, or from its midpoint.
That partially accounts for your results with odd values of nseg.
There are additional considerations that are not NEURON-specific, which probably also contribute to the results you obtained.
1. The question of what "long" means. For the purpose you have in mind, "long" should be at least 3 and probably more than 5 length constants for a signal source located at either end, and double these values for a signal source located at the midpoint of a section. Otherwise, the sealed end boundary condition will noticeably reduce attenuation along the length of the section. It seems likely that your "long" section is not nearly long enough, since all of your "observed lambda" values are longer than the value calculated from the formula (which assumes infinite length).
2. The question of how fine the spatial grid should be in order to get sufficient accuracy. For steady state attenuation, nseg should be at least 10*(anatomical length / DC length constant).
First, the NEURON-specific considerations. NEURON computes solutions at internal nodes (grid points) that are located at uniformly spaced distances dist along the length L of a section, where
dist = L*(0.5 + i)/nseg for i = 0 . . . nseg-1
sectionname.v(x) refers to the value of v at the internal node that is nearest to x. If x lies midway between two internal nodes, the value that is returned will be the value at one of those nodes, and the node whose value you get will depend on roundoff error.
This has several consequences.
1. If nseg is even, there will be no node at the midpoint of a section. Trying to reference the midpoint of a section with even nseg will instead reference the adjacent node at 0.5*(1 - (1/nseg)) or 0.5*(1 + (1/nseg)), depending on roundoff error. So if you ever want to refer to the midpoint of a section--either to attach a signal source to that location, or to measure the value of any variable at that location--you should never assign an even value to nseg.
That partially accounts for your results with even values for nseg.
2. Unless you are very careful about specifying the anatomical and biophysical properties of a section, there will be no internal node that lies exactly 1 length constant from the section's 0 or 1 end, or from its midpoint.
That partially accounts for your results with odd values of nseg.
There are additional considerations that are not NEURON-specific, which probably also contribute to the results you obtained.
1. The question of what "long" means. For the purpose you have in mind, "long" should be at least 3 and probably more than 5 length constants for a signal source located at either end, and double these values for a signal source located at the midpoint of a section. Otherwise, the sealed end boundary condition will noticeably reduce attenuation along the length of the section. It seems likely that your "long" section is not nearly long enough, since all of your "observed lambda" values are longer than the value calculated from the formula (which assumes infinite length).
2. The question of how fine the spatial grid should be in order to get sufficient accuracy. For steady state attenuation, nseg should be at least 10*(anatomical length / DC length constant).
Re: nseg and the length constant
Dear Ted,
Thank you for the reply - it all makes good sence. I apologize for the unclear description of the cell length. The cable was 2200 um long during my simulations. I assume that is long enough to be able to neglect the boundary effect in both ends.
I understand how the round off error accounts for the nature of the error in lambda ("dampening oscillations" as a function of nseg). However, as the data show, lambda converges toward 323 as we increase nseg (while stimulating at the section midpoint).
I have tried to double the cable length. Lambda now converges toward 361 as I increase the spatial grid, that is, even further from the theoretical lambda value (lambda=301).
Could I be doing something wrong or is it because of the way NEURON calculates decay between segments?
Best regards,
Ulrik
Thank you for the reply - it all makes good sence. I apologize for the unclear description of the cell length. The cable was 2200 um long during my simulations. I assume that is long enough to be able to neglect the boundary effect in both ends.
I understand how the round off error accounts for the nature of the error in lambda ("dampening oscillations" as a function of nseg). However, as the data show, lambda converges toward 323 as we increase nseg (while stimulating at the section midpoint).
I have tried to double the cable length. Lambda now converges toward 361 as I increase the spatial grid, that is, even further from the theoretical lambda value (lambda=301).
Could I be doing something wrong or is it because of the way NEURON calculates decay between segments?
Best regards,
Ulrik
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: nseg and the length constant
The best way to proceed is probably to send me your hoc code (or session files, if you used the GUI to construct the model) so that I can examine the model and reproduce your findings.
Re: nseg and the length constant
While cleaning up the code and getting ready to send it, I realized where things are wrong in my script. I'm measuring v(i/10), i=0...10, regardless of the number of segments. Obviously, if I increase the cell length, the error can potentially increase since my 0.37 value is found by linear interpolation between data points. By measuring around the middle of each node, I now get the right value for lambda.
I apologize for the mistake, yet your elaborate answer was very useful and helped me realize what was wrong. Thank you.
I apologize for the mistake, yet your elaborate answer was very useful and helped me realize what was wrong. Thank you.
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: nseg and the length constant
No need to apologize at all. Thank you for opening a discussion that may contain information which is useful for others--who will find here a reiteration of NEURON's approach to spatial discretization, two examples of how not to determine length constant from simulation results (the way I thought you were doing it (which was a wrong guess about an incorrect approach, thus a case in which two wrongs do not make a right), and the way that you were actually doing it), and the correct solution that you came up with. Thank you for your patience and persistence in resolving this.