Important facts
1. The NEURON simulator can be used to execute programs written in hoc, or Python, or programs that contain hoc and Python statements.
2. Because of fact 1, there are two versions of NEURON's online Programmers' Reference. One focuses on how to use NEURON with Python, and the other shows how to use NEURON with hoc. If you go to NEURON's home page
https://neuron.yale.edu/neuron/
and click on the Programmer's Reference link, the Python version of the Programmer's Reference appears. You will know its the Python version because it says so, in big letters, on the second line of the web page:
NEURON Python documentation
If you want to see the hoc documentation instead, click on the
Switch to HOC
link, which appears, in smaller letters, on the first line of the web page.
3. At the top of every page in the Programmers' Reference there is a
Switch to . . .
link, so if you are reading one version of the documentation and you want to see the other version, just click on that link.
Now to address the issues in your most recent post.
apc = new APCount(soma(0.5)) causes error
Your original question was
I read explanation about APCount at programmer's reference.
apc = h.APCount(section(x))
Here, section(x) should be written only number?
That is a question about how to use Python syntax to work with APCount. I gave you an example of correct usage of Python that would place an APCount at the middle of the soma.
But you're using a hoc program, so you really needed to know how to use hoc to attach an APCount to a section at the right location. I can see why you might guess that
apc = new APCount(soma(0.5))
would work in a hoc program, but the hoc version of APCount expects a numerical argument in the range 0..1, and soma(0.5) is not a number.
In hoc, the best way to specify the name of the section to which the APCount (or any other point process) is attached is with what is called "section stack notation"
sectionname objrefname = new APCount(
rangeval)
where
objrefname is the name of the objref that will refer to the new APCount
sectionname is the name of the section to which the new APCount will be attached
rangeval is the normalized position of the APCount along the length of the section
if I use access soma, it works
I want to see dendrites, axon threshold. In this case, should I use 'access soma', 'access dendrite','access axon' respectively?
It is not a good idea to use the access keyword to specify where anything is located. There should never be more than one access statement in a program. Read this post about "access abuse" to discover why:
https://www.neuron.yale.edu/phpBB2/view ... t=301#p828
Instead, you should use "section stack" notation to specify the section that the point process will be attached to, like this example:
Code: Select all
objref apc
soma apc = new APCount(0.5)
. . . then find threshold . . .
dendrite apc = new APCount(0.5)
. . . then find threshold . . .
axon apc = new APCount(0.5)
. . . then find threshold . . .