Page 1 of 1

NMODL Units

Posted: Wed Mar 07, 2012 8:05 am
by shyam_u2
I am using the gap junction version that is mentioned in NEURON book(chapter 10). In that piece of code(gap.mod), even if i change the units of resistance r there is no impact on the result. For example if I change the units of r to ohm or gigaohm or leave it dimensionless it neither produces error or alters the result. May i know the reason for this ? By result i mean voltage response of either of the cell.
I am pasting the code here.

Code: Select all

NEURON {
	POINT_PROCESS gap
	NONSPECIFIC_CURRENT i
	RANGE r, i
	POINTER vgap
}
PARAMETER {
		
	r = 5e3 (megohm)

     
}
ASSIGNED {
	i (nanoamp)
	vgap (millivolt)
	v (millivolt)
	
}
BREAKPOINT {
	i = (v - vgap)/r
}

Thanks in advance.

Re: NMODL Units

Posted: Wed Mar 07, 2012 2:08 pm
by ted
The NMODL-to-C translator does not do anything about units. It is up to the user to ensure that all assignment statements involve consistent units. A separate program called modlunit, which is invoked from the command line, e.g.
modlunit somefile.mod
will check somefile.mod and report the first instance of inconsistent units that it finds. It also reports undeclared user-defined symbols, and finds some simple syntax errors. Only one error is identified at a time, so it is necessary to repeatedly revise and test if a file contains more than one error. Unit inconsistencies are fixed by including appropriate scale factors into NMODL code.