Page 1 of 1

APCount()

Posted: Tue Jul 25, 2006 1:22 pm
by ecchiang
I'm sorry if this question has a really obvious answer but I'm still really new to this.

On the help section of the webpage, there is a object APCount()

http://www.neuron.yale.edu/neuron/stati ... ml#APCount

In the syntax section, it includes the following line
apc = new APCount(x)

What is x? For IClamp and AlphaSynapse, x referred to the placement of the point proess onto the neruon. HOwever, when I type "apc = new APCount(0.5)", I get a syntax error.

Thank you in advance!
Elisa

Posted: Tue Jul 25, 2006 1:40 pm
by ted
Exactly what did the syntax error say?

Syntax error

Posted: Tue Jul 25, 2006 4:59 pm
by ecchiang
It just says:

nrniv: syntax error
near line 27 (that's just the line in the sh window)
apc = new APCount(0.5)
^

That's it.

Posted: Tue Jul 25, 2006 6:04 pm
by ted
That's enough. It's a syntax error, so the ^ marks where the parser failed. To see
exactly where, examine the error message as NEURON printed it out, not as it is
displayed by phpBB2--here it is:

Code: Select all

syntax error
 near line 1
 apc = new APCount(0.5)
         ^
(see https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=493 if you don't already know
about code formatting).

Anyway, back to your problem.

The error message means that apc is not an object reference. APCount is a kind of
point process, and point processes are managed with object syntax. You can read
about this in chapter 13 of The NEURON Book, or this old article
Hines, M.L. and Carnevale, N.T.
The NEURON simulation environment.
Neural Computation 9:1179-1209, 1997.
which is downloadable from
http://www.neuron.yale.edu/neuron/bib/nrnpubs.html

Posted: Wed Jul 26, 2006 10:53 am
by ecchiang
The error message means that apc is not an object reference. APCount is a kind of
point process, and point processes are managed with object syntax
I see, so I need to declare apc by typing something like

Code: Select all

objref = abc
A complete code that makes a soma, and then uses APCount to count the number of times the membrane potential goes past the threhold during a run looks like

Code: Select all

create soma
access soma
insert hh

objref apc
apc = new APCount(0.5)

objref v1
v1 = new Vector()

apc.record(v1)
Now if I type "print apc.n" at the oc> prompt, the program will return the number of action potentials. I can set the threshold by typing "apc.thres = 0".

I think I get it. :)

Elisa

Posted: Wed Jul 26, 2006 11:52 am
by ted
A more powerful and flexible approach is to use the NetCon class's record method--
see http://www.neuron.yale.edu/neuron/stati ... etcon.html