Hello from the SBML side of town,
As some of you may know, SBML has simplified things by removing the offset
entirely (all temperatures have to be in Kelvin) and it's up to the tool (or
maybe in some cases the user) to make things right if Celcius is really needed.
This permits the use of simple conversion factors to convert from one unit to
another.
The price is that it would break your existing spec (SBML made this decision
last year), and it no longer corresponds one-to-one with SI, but it makes it
really easy to do analysis and to make tools. Originally, I didn't like this
approach because it seemed like the "easy way out", but I think it was the best
decision for interoperability (even in it's simplified state, very few SBML
tools handle units properly). It would also be easier for interoperability if
SBML/CellML had a single unit system (yes, CellML's unit system came first, and
SBML "flattened it" to only use base units within a unit definition and then
simplified it by removing offsets).
Of course, it is possible to do offsets correctly. Somewhere I have a paper
(that I never read) that describes a proper formalism for properly handling
units with offsets - I think it is conceptually similar to the 4x4 affine
matrices used in 3D modeling, but I'm not sure without reading the paper.
VCell implements units by wrapping UCAR's unit library (the java version) which
supported offsets. But then (a couple of years ago) we made a decision to not
use offsets (before SBML decided) so that we could get a working version out
the door and into our users hands. The resulting unit library is very simple
to use and quite powerful, and will be released as a reusable open source
library in a couple of months (VCell is currently going through a process of
refactoring in preparation for open source development and a new open,
extensible architecture).
I'm sorry if all of this "SBML" discussion is off-topic. I'm interested in
your thoughts on the subject (CellML's design pressures and use cases, tool
impact, specification impact, existing model impact).
Thanks,
Jim Schaff
VCell Developer
http://vcell.org
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Jonathan Cooper
Sent: Tue 10/24/2006 4:30 AM
To: [email protected]
Cc:
Subject: [cellml-discussion] Units in CellML
Hello all,
Having spent a while grappling with the units sections of the CellML 1.0
specification whilst writing my validation tool, I have a few comments
and queries on the model CellML uses for units.
For the most part, I like it. However, when dealing with units with
offsets, things get rather confusing. In the first place, the way in
which an offset is defined works in the opposite sense to the way in
which the multiplier and prefix are defined. The standard units litre
are defined by:
|<units|| ||name="||litre||"||>||
||<unit|| ||multiplier="||1000||"|| ||prefix="||centi||"||
||units="||metre||"|| ||exponent="||3||"|| />||
||</units>
|
|The multiplier and prefix both 'modify' the referenced unit metre,
which makes sense. In the definition of celsius, however:|
| <units name="celsius">
<unit units="kelvin" offset="-273.15"/>
</units>
|
|Here the offset gives the offset of the Kelvin zero from the Celsius
zero, which (to me at least) seems to be the opposite sense from what
one would expect. It would be more natural to read the above as
defining a celsius scale offset from the kelvin scale by -273.15 degrees
C, and this would be consistent with the semantics for the multiplier,
prefix and exponent.
|
|It may well be too late to make such a fundamental change, but some
documentation to clarify the issue could well help others to avoid being
confused.
|
|
The second point I have also involves units with offsets. Consider the
expression
<apply><plus/>
<cn cellml:units="celsius">2</cn>
<||cn cellml:units="celsius">2</cn>
</apply>
|
|What should the result be? 4 degrees celsius? Or 277.15 degrees
celsius? The latter comes from converting to Kelvin, then adding. This
issue becomes more important when we consider something like
|| <apply><minus/>
<cn cellml:units="celsius">2</cn>
<||cn cellml:units="celsius">2</cn>
</apply>
|
|Here saying the result is 0 degrees celsius is much less convincing.
When celsius is viewed as a complex unit (i.e. without the offset) it
makes more sense, so since such an expression will generally (always?)
occur in the context of a temperature difference per something, this may
not be an issue in actuality. Again however something should probably
be mentioned in the specification to warn the unwary.
|
|Any comments?
|
|Jonathan.
|
_______________________________________________
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