functions

neuron
   attr_praxis    fit_praxis     nrnglobalmechmenu  pval_praxis  
   batch_run      fmatrix        nrnmechmenu    secname        
   batch_save     frecord_init   nrnpointmenu   section_orientation  
   fadvance       fstim          nrnsecmenu     sectionname    
   fclamp         fstimi         parent_connection  stop_praxis  
   fclampi        hocmech        parent_node    this_node      
   fclampv        initnrn        parent_section  this_section  
   fcurrent       ismembrane     prstim         
   finitialize    issection      psection       
These are Neuron-specific functions which you can call from the nrnoc interpreter.


batch_run

functions

SYNTAX

batch_run(tstop, tstep, "filename")
batch_run(tstop, tstep, "filename", "comment")

DESCRIPTION

This command replaces the set of commands:
while (t < tstop) {
        for i=0, tstep/dt {
                fadvance()
        }
        // print results to filename
}
and produces the most efficient run on any given neuron model. This command was created specifically for Cray computers in order eliminate the interpreter overhead as the rate limiting simulation step.

This command will save selected variables, as they are changed in the run, into a file whose name is given as the third argument. The 4th comment argument is placed at the beginning of the file. The batch_save command specifies which variable are to be saved.


batch_save

functions

SYNTAX

batch_save()
batch_save(&var, &var, ...)

DESCRIPTION

batch_save()
starts a new list of variables to save in a batch_run .
batch_save(&var, &var, ...)
adds pointers to the list of variables to be saved in a batch_run. A pointer to a range variable, eg. "v", must have an explicit arc length, eg. axon.v(.5).

EXAMPLES

batch_save()	//This clears whatever list existed and starts a new
		//list of variables to be saved.
batch_save(&soma.v(.5), &axon.v(1))
for i=0,2 {
	batch_save(&dend[i].v(.3))
}
specifies five quantities to be saved from each batch_run.


initnrn

functions

SYNTAX

initnrn()

DESCRIPTION

Initialize t, dt, clamp_resist, and celsius to the values they had when the program was first run.

Note that in this version Ra is no longer a global variable but a section variable like L and rallbranch. Thus Ra can be different for different sections. In order to set Ra to a constant value, use:

forall Ra=...

BUGS

Not very useful. No way to completely restart neuron exect to quit and re-load.


fadvance

functions

SYNTAX

fadvance()

DESCRIPTION

Integrate all section equations over the interval dt . The value of t is incremented by dt. The default method is first order implicit but may be changed to Crank-Nicholson by changing secondorder = 2.

fadvance integrates the equation over the dt step by calling all the BREAKPOINT blocks of models at t+dt/2 twice with v+.001 and v in order to compute the current and conductance to form the matrix conductance*voltage = current. This matrix is then solved for v(t+dt). (if secondorder == 2 the ionic currents are adjusted to be second order correct. If secondorder == 1 the ionic currents are not adjusted but the voltages are second order correct) Lastly the SOLVE statement within the BREAKPOINT block of models is executed with t+dt and the new values of v in order to integrate those states (from new t-.5dt to new t+.5dt).


finitialize

functions

SYNTAX

finitialize()
finitialize(v)

DESCRIPTION

Call the INITIAL block for all mechanisms and point processes inserted in the sections. If the optional argument is present then all voltages of all sections are initialized to v. t is set to 0.


frecord_init

functions

SYNTAX

frecord_init()

DESCRIPTION

Initializes the Vectors which are recording variables. i.e. resize to 0 and append the current values of the variables. This is done at the end of an finitialize call but needs to be done again to complete initialization if the user changes states or assigned variables that are being recorded..

SEE ALSO

record Init


fstim

functions

SYNTAX

fstim()

DESCRIPTION

Consider this obsolete. Nevertheless, it does work. See the old NEURON reference manual.


fstimi

functions

SYNTAX

fstimi()

DESCRIPTION

Obsolete


fit_praxis

functions

SYNTAX

fit_praxis(n, "funname", &x[0])

DESCRIPTION

This is the principal axis method for minimizing a function. See praxis.c in the scopmath library.

1 <= n < 20
is the number of parameters to vary (number of arguments to funname).
funname
the name of the function to minimize, eg. least square difference between model and data. The funname must take two arguments, the first arg, $1, is the number of elements in second arg vector, $&2. The ith index of the vector is given by $&2[i].
x
is a double vector of at least length n. Prior to the call set it to a guess of the parameter values. On return it contains the values of the args that minimize funname().

funname may be either an interpreted hoc function or a compiled NMODL function.

If the variable stoprun is set to 1 during a call to fit_praxis, it will return immediately (when the current call to funname returns) with a return value and varx values set to the best minimum found so far.

BUGS

Up to version 4.0.1, the arguments to funname were an explicit list of n arguments. ie numarg()==n.


attr_praxis

functions

SYNTAX

attr_praxis(tolerance, maxstepsize, printmode)

DESCRIPTION

Set the attributes of the praxis method. This must be called before the first call to fit_praxis .
tolerance
praxis attempt to return f(x) such that if x0 is the true local minimum then norm(x-x0) < tolerance
maxstepsize
should be set to about the maximum distance from initial guess to the minimum.
printmode=0
no printing
printmode=1,2,3
more and more verbose


pval_praxis

functions

SYNTAX

pval_praxis(i)
pval_praxis(i, &paxis[0])

DESCRIPTION

Return the ith principal value. If the second argument is present, pval_praxis also fills the vector with the ith principal axis.


stop_praxis

functions

SYNTAX

stop_praxis()
stop_praxis(i)

DESCRIPTION

Set a flag in the praxis function that will cause it to stop after it finishes the current (or ith subsequent) principal axis calculation. If this function is called before fit_praxis, then praxis will do a single (or i) principal axis calculation and then exit.


fclamp

functions

SYNTAX

fclamp()

DESCRIPTION

obsolete. Use the VClamp or SEClamp point process.


fclampi

functions

SYNTAX

fclampi()

DESCRIPTION

obsolete. Use the VClamp or SEClamp point process.


fclampv

functions

SYNTAX

fclampv()

DESCRIPTION

obsolete. Use the VClamp or SEClamp point process.


prstim

functions

SYNTAX

prstim()

DESCRIPTION

obsolete. Print the info about fstim, fclamp, and fsyn


fcurrent

functions

SYNTAX

fcurrent()

DESCRIPTION

Make all assigned variables (currents, conductances, etc) consistent with the values of the states. Useful in combination with finitialize .

EXAMPLES

execute following example
create soma
access soma
insert hh
print "default el_hh = ", el_hh
// set el_hh so that the steady state is exactly -70 mV
finitialize(-70) // sets v to -70 and m,h,n to corresponding steady state values

fcurrent()	// set all assigned variables consistent with states

// use current balance: 0 = ina + ik + gl_hh*(v - el_hh)		
el_hh = (ina + ik + gl_hh*v)/gl_hh

print "-70 mV steady state el_hh = ", el_hh
fcurrent()	// recalculate currents (il_hh)


fmatrix

functions

SYNTAX

fmatrix()

DESCRIPTION

Print the jacobian matrix for the tree structure in a particularly confusing way. for debugging only.


issection

functions

SYNTAX

issection("regular expression")

DESCRIPTION

Return 1 if the currently accessed section matches the regular expression. Return 0 if otherwise.

Regular expressions are like those of grep except {} are used in place of [] to avoid conflict with indexed sections. Thus a[{8-15}] matches sections a[8] through a[15]. A match always begins from the beginning of a section name. If you don't want to require a match at the beginning use the dot.

(Note, that . matches any character and * matches 0 or more occurrences of the previous character). The interpreter always closes each string with an implicit $ to require a match at the end of the string. If you don't require a match at the end use ".*".

EXAMPLES

create soma, axon, dendrite[3]
forall if (issection("s.*")) {
	print secname()
}
will print soma
forall if (issection("d.*2]")) {
	print secname()
}
will print dendrite[2]
forall if (issection(".*a.*")) {
	print secname()
}
will print all names which contain the letter "a"
soma
axon

SEE ALSO

ifsec forsec


ismembrane

functions

SYNTAX

ismembrane("mechanism")

DESCRIPTION

This function returns a 1 if the current membrane contains this (density) mechanism. This is not for point processes.

EXAMPLES

forall if (ismembrane("hh") && ismembrane("ca_ion")) {
	print secname()
}
will print the names of all the sections which contain both Hodgkin-Huxley and Calcium ions.


sectionname

functions

SYNTAX

sectionname(strvar)

DESCRIPTION

The name of the currently accessed section is placed in strvar.

This function is superceded by the easier to use, secname .


secname

functions

SYNTAX

secname()

DESCRIPTION

Returns the currently accessed section name. Usage is
		strdef s
		s = secname()
or
		print secname()
or
		forall for(x) printf("%s(%g)\n", secname(), x)


psection

functions

SYNTAX

psection()

DESCRIPTION

Print info about currently accessed section in a format which is executable. (length, parent, diameter, membrane information)


secondorder

globals

SYNTAX

secondorder

DESCRIPTION

This is a global variable which specifies the time integration method.
=0
default fully implicit backward euler. Very numerically stable. gives steady state in one step when dt=1e10. Numerical errors are proportional to dt.
=1
crank-nicholson Can give large (but damped) numerical error oscillations. For small dt the numerical errors are proportional to dt^2. Cannot be used with voltage clamps. Ionic currents are first order correct. Channel conductances are second order correct when plotted at t+dt/2
=2
crank-nicholson like 1 but in addition Ion currents (ina, ik, etc) are fixed up so that they are second order correct when plotted at t-dt/2


t

globals

SYNTAX

t

DESCRIPTION

The global time variable.


dt

globals

SYNTAX

dt

DESCRIPTION

The integration interval for fadvance ().

When using the default implicit integration method ( secondorder = 0) there is no upper limit on dt for numerical stability and in fact for passive models it is often convenient to use dt=1.9 to obtain the steady state in a single time step.

dt can be changed by the user at any time during a simulation. However, some inserted mechanisms may use tables which depend on the value of dt which will be automatically recomputed. In this situation, the tables are not useful and should be bypassed by setting the appropriate usetable_suffix global variables to 0.


clamp_resist

globals

SYNTAX

clamp_resist

DESCRIPTION

Obsolete, used by fclamp.


celsius

globals

SYNTAX

celsius = 6.3

DESCRIPTION

Temperature in degrees centigrade.

Generally, rate function tables ( eg. used by the hh mechanism) depend on temperature and will automatically be re-computed whenever celsius changes.


stoprun

globals

SYNTAX

stoprun

DESCRIPTION

A flag which is watched by fit_praxis , CVode , and other procedures during a run or family of runs. When stoprun==1 they will immediately return without completing normally. This allows safe stopping in the middle of a long run. Procedures that do multiple runs should check stoprun after each run and exit gracefully. The Stop of the RunControl GUI sets this variable. It is cleared at the beginning of a run or when continuing a run.


this_section

functions

SYNTAX

this_section(x)

DESCRIPTION

Return a pointer to the section which contains location 0 of the currently accessed section. This pointer can be used as the argument to push_section.


this_node

functions

SYNTAX

this_node(x)

DESCRIPTION

Return the segment number of the currently accessed section that contains location x.


parent_section

functions

SYNTAX

parent_section(x)

DESCRIPTION

Return the pointer to the section parent of the segment containing x.


parent_node

functions

SYNTAX

parent_node(x)

DESCRIPTION

Return the segment number of the parent of the segment containing x.


parent_connection

functions

SYNTAX

y = parent_connection()

DESCRIPTION

Return location on parent that currently accessed section is connected to. (0 <= x <= 1). This is the value, y, used in
        connect child(x), parent(y)


section_orientation

functions

SYNTAX

y = section_orientation()

DESCRIPTION

Return the end (0 or 1) which connects to the parent. This is the value, x, used in

        connect child(x), parent(y)


CompileTimeOptions

neuron
The following definitions are found in nrnoc/SRC/options.h and add extra functionality which not everyone may need. The extras come at the cost of larger memory requirements for node and section structures. METHOD3 is too large and obscure to benefit most users.
#define VECTORIZE	1	/* hope this speeds up simulations on a Cray */
				/* this is no longer optional */

#define EXTRACELLULAR	1	/* extracellular membrane mechanism */

#define DIAMLIST	1	/* section contains diameter info */
				/* shape plots make use of this */

#define EXTRAEQN	0	/* ionic concentrations calculated via
				 * jacobian along with v (not implemented) */
#if DIAMLIST
#define NTS_SPINE	1	/* A negative diameter in pt3dadd() tags that
				 * diamlist location as having a spine.
				 * diam3d() still returns the positive diameter
				 * spined3d() returns 1 or 0 signifying presence
				 * of spine. setSpineArea() tells how much
				 * area/spine to add to the segment. */
#endif

#define METHOD3		1	/* third order spatially correct method */
				/* testing only, not completely implemented */
				/* not working at this time */

#if METHOD3
 spatial_method(i)
	no arg, returns current method
	i=0 The standard NEURON method with zero area nodes at the ends
		of sections.
	i=1 conventional method with 1/2 area end nodes
	i=2 modified second order method
	i=3 third order correct spatial method
	Note: i=1-3 don't work under all circumstances. They have been
	insufficiently tested and the correctness must be established for
	each simulation.
#endif

#if NEMO
neuron2nemo("filename") Beginning of translator between John Millers
		nemosys program	and NEURON. Probably out of date.
nemo2neuron("filename")
#endif


ion

neuron
   ghk            ion_style      nernst         


ion_style

ion

SYNTAX

ion_style("name_ion", c_style, e_style, einit, eadvance, cinit)

DESCRIPTION

In the currently accessed section, force the named ion (eg. na_ion, k_ion, ca_ion, etc) to handle reversal potential and concentrations according to the indicated styles. You will not often need this section since the style chosen automatically on a per section basis should be appropriate to the set of mechanisms inserted in each section. Warning: if other mechanisms are inserted subsequent to a call of this function, the style will be "promoted" according to the rules associated with adding the used ions to the style previously in effect.
c_style: 0, 1, 2, 3.
Concentrations respectively treated as UNUSED, PARAMETER, ASSIGNED, or STATE variables. Determines which panel (if any) will show the concentrations.
e_style: 0, 1, 2, 3.
Reversal potential respectively treated as UNUSED, PARAMETER, ASSIGNED, or STATE variable.
einit: 0 or 1.
If 1 then reversal potential computed by Nernst equation on call to finitialize() using values of concentrations.
eadvance: 0 or 1.
If 1 then reversal potential computed every call to fadvance() using the values of the concentrations.
cinit: 0 or 1.
If 1 then a call to finitialize() sets the concentrations to the values of the global initial concentrations. eg. nai set to nai0_na_ion and nao set to nao0_na_ion.

The automatic style is chosen based on how the set of mechanisms that have been inserted in a section use the ion. Note that the precedence is WRITE > READ > unused in the USEION statement; so if one mechanism READ's cai/cao and another mechanism WRITE's them then WRITE takes precedence in the following table. For compactness, the table assumes the ca ion. Each table entry identifies the equivalent parameters to the ion_style function.

cai/cao	->	unused		read		write

eca unused 0,0,0,0,0 1,0,0,0,0 3,0,0,0,1

eca read 0,1,0,0,0 1,2,1,0,0 3,2,1,1,1

eca write 0,2,0,0,0 1,2,0,0,0 3,2,0,0,1

For example suppose one has inserted a mechanism that READ's eca, a mechanism that READ's cai, cao and a mechanism that WRITE's cai, cao Then, since WRITE takes precedence over READ in the above table, cai/cao would appear in the STATE variable panel (first arg is 3), eca would appear in the ASSIGNED variable panel (second arg is 2), eca would be calculated on a call to finitialize (third arg is 1), eca would be calculated on every call to fadvance (fourth arg is 1), cai/cao would be initialized (on finitialize) to the global variables cai0_ca_ion and cao0_ca_ion respectively. (note that this takes place just before the calculation of eca).


ghk

ion

SYNTAX

ghk(v, ci, co, charge)

DESCRIPTION

Return the Goldman-Hodgkin-Katz current (normalized to unit permeability). Use the present value of celsius.
mA/cm2 = (permeability in cm/s)*ghk(mV, mM, mM, valence)


nernst

ion

SYNTAX

nernst(ci, co, charge)
nernst("ena" or "nai" or "nao", [x])

DESCRIPTION

nernst(ci, co, charge)
returns nernst potential. Utilizes the present value of celsius.
nernst("ena" or "nai" or "nao", [x])
calculates nao/nai = exp(z*ena/RTF) for the ionic variable named in the string.
Celsius, valence, and the other two ionic variables are taken from their values at the currently accessed section at position x (.5 default). A hoc error is printed if the ionic species does not exist at this location.


neuron/neuron/nrnoc.hel : 18104 Mar 31