Page 1 of 1

setting a parameter in nmodl

Posted: Thu Aug 30, 2007 11:54 pm
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.

Re: setting a parameter in nmodl

Posted: Fri Aug 31, 2007 11:10 am
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