Page 1 of 1
specifying nseg and channel density
Posted: Thu Oct 01, 2009 2:25 pm
by chen_xiang
Hello,
I'm a very new user of NEURON. I guess my question is very simple for you. However, I confused a little by looking at NEURON book and some available online codes
do we have to define number of segments before inserting any type of channel density or after that?
Re: specifying nseg and channel density
Posted: Thu Oct 01, 2009 3:53 pm
by ted
As a rule, it's good to get in the habit of specifying nseg first, and specifying channel density second.
If you want channel density to be uniform, it doesn't matter which you do first.
Example: try this
Code: Select all
create dend
access dend
insert pas
nseg = 3
g_pas = 1
for (x,0) print x, g_pas
then try again but this time set g_pas before setting nseg
Code: Select all
. . .
g_pas = 1
nseg = 3
for (x,0) print x, g_pas
and you'll see that the final result is the same.
If you want nonuniform channel density, every time you specify a new value of nseg you should follow that by applying the rule that governs channel density.
Example: try this
Code: Select all
create dend
access dend
insert pas
nseg = 3
// suppose you want g_pas to be a linear function of position in dend
for (x,0) g_pas(x) = 0.1*x
for (x,0) print x, g_pas(x) // three segments, so three different values of g_pas
print " "
// suppose you want g_pas to vary more smoothly along the length of dend
nseg *= 3 // make nseg 3 times larger
for (x,0) print x, g_pas(x) // 9 segments but only 3 different values of g_pas!
// no improvement of smoothness!
print " "
// you need to specify g_pas as a function of x again
for (x,0) g_pas(x) = 0.1*x
for (x,0) print x, g_pas(x) // much smoother
Re: specifying nseg and channel density
Posted: Thu Oct 01, 2009 5:14 pm
by chen_xiang
Hi Ted,
Thanks a lot for your prompt response. I really appreciate it.
Re: specifying nseg and channel density
Posted: Thu Oct 01, 2009 10:26 pm
by ted
You're welcome. Thanks for using NEURON in your research.