Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-discuss » units in sbml l2v3
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Sven Sahle


Posts: 82
Registered:
September 2003
Re: units in sbml l2v3 04 Jun '07 13:06 Go to previous messageGo to previous message

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.


      

SubjectPosterDate
Read Message   units in sbml l2v3 Ralph Gauges30 May '07 06:21
Read Message   Re: units in sbml l2v3 Mike Hucka01 Jun '07 14:07
Read Message   Re: units in sbml l2v3 Sven Sahle01 Jun '07 16:36
Read Message   Re: units in sbml l2v3 Mike Hucka03 Jun '07 11:46
Read Message   Re: units in sbml l2v3 Sven Sahle04 Jun '07 08:36
Read Message   Re: units in sbml l2v3 Stefan.Hoops04 Jun '07 11:28
Read Message   Re: units in sbml l2v3  Sven Sahle04 Jun '07 13:06
Read Message   Re: units in sbml l2v3 Ralph.Gauges04 Jun '07 13:27
Read Message   Re: units in sbml l2v3 Nicolas Le Novere04 Jun '07 13:58
Read Message   Re: units in sbml l2v3 Nicolas Le Novere04 Jun '07 14:42
Read Message   Re: units in sbml l2v3 Sven Sahle04 Jun '07 15:38
Read Message   Re: units in sbml l2v3 Nicolas Le Novere05 Jun '07 00:47
Read Message   Re: units in sbml l2v3 Sven Sahle05 Jun '07 03:59
Read Message   Re: units in sbml l2v3 Mike Hucka06 Jun '07 23:19
Read Message   Re: units in sbml l2v3 Mike Hucka06 Jun '07 23:42
Previous Topic:DSMTS for SBML L2v3
Next Topic:Re: [Biomodels] Eight release of BioModels Database
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.