| Author | Topic |
Posts: 82
Registered: September 2003
|
|
Re: units in sbml l2v3
|
04 Jun '07 13:06

|
 |
|
Hello Stefan, hello all,
I don´t quite understand this.
The old definition was:
unit = multiplier * 10^scale * baseunit^exponent
The new definition (from the errata) is:
unit = (multiplier * 10^scale *baseunit)^exponent
In both cases the multiplier is handled the same as 10^scale. Originally the
exponent applied to none of them, now it applies to both. You are completely
right that in principle multiplier*10^scale could be replaced by one number.
On Monday 04 June 2007 20:28:15 Stefan Hoops wrote:
> Hello All,
>
> I would like to make an attempt to look at his problem more from an XML
> standpoint and hopefully reduce the confusion. Let us look at two
> equivalent and valid definitions of the unit dezimetre:
> A)
> <unitDefinition id="dm" name="dezimetre">
> <listOfUnits>
> <unit kind="metre" multiplier="0.1" scale="0" exponent="1" />
> </listOfUnits>
> </unitDefinition>
> or B)
> <unitDefinition id="dm" name="dezimetre">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="1" />
> </listOfUnits>
> </unitDefinition>
>
> Let us now define a unit liter (Note, not litre as this is a base unit)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="dm" multiplier="1" scale="0" exponent="3" />
> </listOfUnits>
> </unitDefinition>
"dm" is a valid value for kind?
>
> Up to this point I think everyone agrees. Please note that the exponent
> 3 in the above definition of liter can be replaced by the following
> equivalent definition:
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="dm" multiplier="1" scale="0" exponent="1" />
> <unit kind="dm" multiplier="1" scale="0" exponent="1" />
> <unit kind="dm" multiplier="1" scale="0" exponent="1" />
> </listOfUnits>
> </unitDefinition>
>
> Replacing in this last definition dm with its definition leads
> A)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="0.1" scale="0" exponent="1" />
> <unit kind="metre" multiplier="0.1" scale="0" exponent="1" />
> <unit kind="metre" multiplier="0.1" scale="0" exponent="1" />
> </listOfUnits>
> </unitDefinition>
> or B)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="1" />
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="1" />
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="1" />
> </listOfUnits>
> </unitDefinition>
>
> Now we are coming to the problem which is the root of this discussion.
> Let us make an attempt to reintroduce the exponent 3. I naively (not
> looking at the SBML specifications) would have written:
> A)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="0.1" scale="0" exponent="3" />
> </listOfUnits>
> </unitDefinition>
> or B)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="3" />
> </listOfUnits>
> </unitDefinition>
>
This is correct with the current specification.
> This makes obvious that scale and multiplier should be treated equally.
> There is also another more abstract way to look at it. The whole scheme
> works perfectly fine without the scale attribute since the multiplier is
> a double and thus treating them differently would create an obvious
> inconsistency.
>
> Another confusion stems from the interpretation. Above I have defined
> liter in terms of metre. If I want to define it in terms of cubic meters
> I again have two choices:
> A)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="m3" multiplier="0.001" scale="0" exponent="1" />
> </listOfUnits>
> </unitDefinition>
> or B)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="m3" multiplier="1.0" scale="-3" exponent="1" />
> </listOfUnits>
> </unitDefinition>
I think nested unit definitions are not allowed in sbml.
> With the definition of cubic meters being:
> <unitDefinition id="m3" name="cubic meter">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="0" exponent="3" />
> </listOfUnits>
> </unitDefinition>
>
> Note here I am not able to apply the simple replace mechanism used
> before. The reason for this is that m3 is metre to the power 3. This
> becomes more clear if I rewrite the definition of cubic meter in the
> following way:
> <unitDefinition id="m3" name="cubic meter">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="0" exponent="1" />
> <unit kind="metre" multiplier="1.0" scale="0" exponent="1" />
> <unit kind="metre" multiplier="1.0" scale="0" exponent="1" />
> </listOfUnits>
> </unitDefinition>
>
> Thus to rewrite liter in metre^3 I have to take the 3rd root of either
> the scale or the multiplier yielding:
> A)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="0.1" scale="0" exponent="3" />
> </listOfUnits>
> </unitDefinition>
> or B)
> <unitDefinition id="l" name="liter">
> <listOfUnits>
> <unit kind="metre" multiplier="1.0" scale="-1" exponent="3" />
> </listOfUnits>
> </unitDefinition>
>
> My conclusion from the above examples is that the current
> interpretation and rules given in the specification are correct. They
> are simple and straight forward. I do not see the possibility to treat
> multiplier and scale differently especially because of the reason that
> every scale can be rewritten as a multiplier thus leading to a different
> result.
>
Yes, the current interpretation is certainly correct. As was the old one. Both
treat 10^scale and multiplier the same. From the two possible choices I still
prefer the old definition.
A new example (I know it will hopefully never occur in a kinetic function, but
as a software developer I need to be prepared for this):
I want to multiply two units.
New definition:
(1*10^1*mol)^2 * (1*10^0*mol) = 1*10^2*mol^3.
Now I have to do an additional step to convert this to sbml compatible
structure:
1*10^2*mol^3 = (1*10^(2/3)*mol)^3.
I am now forced to put the result of the multiplication of the scales
(10^(2/3)) into the multiplier because it is not anymore an integer scale.
This is of course possible, just not convenient.
Now the same in the original definition:
(1*10^2*mol^2) * (1*10^0*mol) = 1 * 10^2 * mol^3
This is straight forward, looses no accuracy at all (no need to calculate a
root, actually no lossy floating point operations at all, if I asume that
1.0*1.0 can be calculated exactly).
> Thanks,
> Stefan
Sven
--
Sven Sahle
Bioquant, Universität Heidelberg
____________________________________________________________
To manage your sbml-discuss list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
For a web interface to the sbml-discuss mailing list, visit
http://sbml.org/forums/
For questions or feedback about the sbml-discuss list,
contact sbml-team@caltech.edu.
|
|
|