setting a parameter in nmodl

The basics of how to develop, test, and use models.
Post Reply
JimH
Posts: 54
Joined: Tue Apr 10, 2007 3:36 pm
Location: Duke University

setting a parameter in nmodl

Post by JimH »

I just figured this out and it wasn't so obvious for me so I though I would share. The following shows how to go about changing a mechanism's parameter in hoc code.

Code: Select all

NEURON {    
	SUFFIX xyz
        :More Code
}

PARAMETER {
      myparam = 3
}
in hoc code you might the have:

Code: Select all

insert xyz
myparam_xyz = 4

The key point here is that in order to change a parameter in a mechanism is to add the suffix to the parameter. Since Neuron seems to have a million global variables adding the suffix helps to prevent name collision.
ted
Site Admin
Posts: 5784
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: setting a parameter in nmodl

Post by ted »

JimH wrote:The key point here is that in order to change a parameter in a mechanism is to add the suffix to the parameter.
That only works for parameters associated with density (distributed) mechanisms; it
does not apply to parameters of point processes. Also, one must distinguish between
RANGE variables and GLOBALs. If a parameter is GLOBAL, its value is the same at all
locations in all sections. If it is RANGE, it may vary with location, and for a density
mechanism one must also specify which section is affected.

Strong suggestion: before doing anything else, see
Help for the total beginner
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=177
and do what item #1 says. If you have The NEURON Book, start with chapter 5,
especially 5.6 How to specify biophysical properties.

RANGE and GLOBAL are discussed in chapter 6, and also in
Hines, M.L. and Carnevale, N.T. Expanding NEURON's repertoire of mechanisms
with NMODL. Neural Computation 12:995-1007, 2000.
which you can obtain from a link at http://www.neuron.yale.edu/neuron/bib/nrnpubs.html
Post Reply