check validity of DLL files

The basics of how to develop, test, and use models.
Post Reply
Martenzi
Posts: 34
Joined: Thu Feb 28, 2013 4:17 am

check validity of DLL files

Post by Martenzi »

I have a vital DLL file that gives the NMDA receptor of my experiment. This file is taken from Kempe et al 2004 in the Model DB and used by Branco et al 2010. I used the file that checks validity of the dll files on it and it gave me the error message:


NEURON -- Release 7.3 (841:8bd842aaf0ab) 2013-03-31
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

0
0
0
0
1
model 1.1.1.1 1994/10/12 17:22:51
Checking units of C:/Neuron/BrancoOriginal/mod.files/NMDA_Mg_T.mod
0.001 m2-kg/sec2-coul
The previous expression is not dimensionless at line 174 in file C:/Neuron/Branc
oOriginal/mod.files/NMDA_Mg_T.mod
rmb = Rmb * mg * (1e3) * exp((v-40) * valence * memb_fraction /25<
<ERROR>>)

Since Branco has used it and the simulation of his Works fine. The interpreter do not give error message when loading these dlls. But I need to now that it works. Do I have reasons to be worried from this error message?
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: check validity of DLL files

Post by ted »

In modeling of physical systems, it is particularly important to verify that formulas and equations use consistent units. The fact that code runs to completion without crashing or generating an error message is no guarantee that results are correct. Indeed, the most pernicious bugs are those that do not interfere with program execution.

"But so-and-so used this successfully for his publication in XYZ!"

Yes, but reviewers don't check model source code, and generally don't even have the opportunity to run a simulation with it. The onus is on the code developer to get it right. Occasionally one gets it quite wrong.

So reuse code written by others with caution.

modlunit is very good at detecting syntax errors and inconsistency of units. However, it stops at the first error it finds, so one has to

Code: Select all

REPEAT
  run modlunit
  fix the error it reports
UNTIL it reports no error
And even if a formula produces results that are numerically correct, modlunit will complain if the source code doesn't give it enough clues to verify consistency of units.

Your choice is
1. ignore the error message. Feeling lucky today?
2. revise the NMODL file so that modlunit can check each formula for consistency of units
3. work through each formula yourself, by hand, to verify consistency of units

Fortunately, modlunit often provides useful clues. Also, the person who wrote this NMODL file was good about declaring the units used by parameters and variables. This error message

Code: Select all

	0.001 m2-kg/sec2-coul
The previous expression is not dimensionless at line 174 in file NMDA_Mg_T.mod
	rmb 	= Rmb 	* mg * (1e3) * exp((v-40) * valence * memb_fraction /25<<ERROR>>)
flags the 25 in the denominator because it doesn't have the same units as the numerator (which is in mV). The fix is to replace this line with

Code: Select all

:	rmb 	= Rmb 	* mg * (1e3) * exp((v-40) * valence * memb_fraction /25)
	rmb 	= Rmb 	* mg * (1e3) * exp((v-40) * valence * memb_fraction / (25 (mV)) )
Check this file with modlunit again, and you'll see a similar error message about the line that starts
rmu = . . .
Post Reply