APCount()

The basics of how to develop, test, and use models.
Post Reply
ecchiang
Posts: 7
Joined: Mon Jul 24, 2006 12:53 pm
Location: Case Western Reserve University, Cleveland, OH

APCount()

Post 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
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Exactly what did the syntax error say?
ecchiang
Posts: 7
Joined: Mon Jul 24, 2006 12:53 pm
Location: Case Western Reserve University, Cleveland, OH

Syntax error

Post 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.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post 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
ecchiang
Posts: 7
Joined: Mon Jul 24, 2006 12:53 pm
Location: Case Western Reserve University, Cleveland, OH

Post 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
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post 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
Post Reply