On 4/21/07, David Nickerson <[EMAIL PROTECTED]> wrote: > > going back to the following equation Andrew supplied: > > > > amount_Na [nmol] = 10^-6 [dimensionless] * conc_Na [nmol / L] * > > vol[microL] > > > > How do you make this more 'valid'? (it is already valid dimensionally > > and numerically). > > but it is not consistent or valid dimensionally.
By dimensional analysis it's fine, you end up with dimensions of concentration = dimensions of concentration > The specification says > that tools are not required to look at the units within mathematics but > that units are required. Tools are not, however, restricted from making > use of the units and to hope that we're not wasting our time putting > them in you'd expect some tools at least to interpret the units inside > the math, in which case this equation becomes (at least the way I would > look at the equation) > > amount_Na [nmol] = 10^-6 [dimensionless] * conc_Na [nmol / L] * vol [uL] > => 10^-6 [] * conc_Na [nmol / L] * vol[(10^-6 L/uL)*uL]] > => 10^-6 [] * conc_Na [nmol / L] * (10^-6*vol [L]) > => 10^-12 * (conc_Na) * (vol) [nmol] This is where I don't think we can make this assumption at the moment for the current CellML specifications. So the declarations in CellML could look like this: variable name="amount_Na" units="nanomol" variable name="conc_Na" units="nanomolar" (nanomoles per liter) variable name="vol" units="microliters" math amount_Na = 10^-6 * conc_Na * vol So what I am saying is that given values for conc_Na, and vol, the result amount_Na is correct. It is also dimensionally correct. And the point I am trying to make is that because there is no prescription in CellML to say that variables defined in a component have to be "unit consistent" (so nothing amount dimensionally consistent here since that is to do with the math), then there is no way to tell if the author has already included any units conversion factors into dimensionless constants in the math (unless of course they provide metadata or units within the mathml to tell us that). The only way to guarantee that our values in the math are units consistent is to either: 1) make sure all the variables in the component are units consistent in the declaration itself, that way at least we know the author is aware that all values of the same dimensions have the same units and that they don't need to put in any further conversion factors or annotate/detail any such factors as such, or 2) make sure that all numbers and variables in the math expressions have units supplied - which means you won't end up with any dimensionless numbers in the math: i.e. from the spec 4.2.6 Associating units with numbers To ensure that models are robust and portable, all variables and numbers that occur in mathematical expressions within a CellML document must have units associated with them. CellML's units framework is introduced in Section 5 and the association of units with variables is presented in Section 3.2.3. The association of units with numbers in equations requires an extension to MathML. This can be done in a manner consistent with the association of units with variables and with application-specific extensions to CellML by adding a units attribute in the CellML namespace to the <mathml:cn> element, which encloses all numbers. The example presented in Section 4.3 demonstrates this. > > which is presumably not what the author intended (unless I have messed > something up?). Whereas if the equation was specified as > > amount_Na [nmol] = 10^-6 [L/uL] * conc_Na [nmol / L] * vol [uL] > => 10^-6 * (conc_Na) * (vol) [nmol] > > as expected. I think it is only this second equation that could be used > in both units processing and units ignoring tools to give a consistent > solution. Which is the original point of discussion, if I remember > correctly. Yes. It is, unless the units in the variables declarations are unit consistent and the author coded their math against this knowledge. > > The problem seems to be that the specification can be interpreted in > such a way that the second form of the equation is first "simplified" to > the first form before the multiplication is done, which I feel is wrong > and needs to be clarified in the specification. I would only see that as a problem if the software did the simplification prior to units checking. > > > Andre. > _______________________________________________ > cellml-discussion mailing list > [email protected] > http://www.cellml.org/mailman/listinfo/cellml-discussion > _______________________________________________ cellml-discussion mailing list [email protected] http://www.cellml.org/mailman/listinfo/cellml-discussion
