NMODL Units

NMODL and the Channel Builder.
Post Reply
shyam_u2
Posts: 77
Joined: Sun Feb 20, 2011 7:15 pm

NMODL Units

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

Re: NMODL Units

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