Alan Garny wrote:
> Hi,
>
> I was looking into units and was wondering something about base units, which
> are not part of the SI base units...
>
> For instance, volt, which is part of the set of CellML base units
Volt is not a base unit, it is a standard derived unit. From Section 
5.2.1 of the CellML specification...
*"Table 2* The dictionary of units keywords that CellML processing 
applications are expected to recognise. Base SI units are printed in 
bold text, derived SI units are printed in plain text, and additions to 
the standard units defined purely for the convenience of model authors 
are italicised."

Volt is printed in plain text, which makes it a derived unit, not a base 
unit.
> , is
> defined as kg.m^2.s^-3.A^-1 in SI base units. Now, say that I want to create
> a new unit called "volt per metre". I could potentially define in one of two
> ways: V.m^-1 or kg.m.s^-3.A^-1. Now, say again that I have an equation that
> goes something like: A = B/C, with A in volt per metre, B in volt and C in
> metre, with the unit describing "volt per metre" was defined using SI base
> units (i.e. kg.m.s^-3.A^-1). Now, here is my question: how do I go about
> showing that the equation is valid? Shouldn't the CellMl specifications
> force one all non-SI base units to be expanded to SI base units when
> checking unit consistency?
CellML processing software is not required to check for dimensional 
consistency at the equation level (but validating software would 
probably want to). Software is also not strictly required to convert at 
the connection level, although appendix C defines how to do this if 
software implements the functionality (CCGS and mozCellML do have this 
functionality). Derived units are converted into the set of base units, 
and base units are compared (and constant factors multiplied and raised 
to the appropriate powers, to get the conversion factor).

If you would like to see a working implementation of this, refer to 
https://svn.physiomeproject.org/svn/physiome/CellML_DOM_API/trunk/CCGS/sources/Units.cxx.
 
The derived units can be seen in CodeGenerationState::SetupBuiltinUnits 
(for example, the line in the source for volts looks like:

  DERIVED_UNIT4(volt, ibu_metre, 2.0, ibu_kilogram, 1.0, ibu_second, -3.0,
                ibu_ampere, -1.0, 1.0);

).

The code works by assigning base units a strict ordering, converting 
sub-units into base units, and recursively merging the ordered lists 
into a final ordered list of base units with exponents, as well as a 
single multiplication factor and/or offet. This canonical form of base 
units is compared, and if it matches (except for the factor/offset), the 
factors are multiplied to get the final conversion factor.

Best regards,
Andrew

_______________________________________________
cellml-discussion mailing list
[email protected]
http://www.cellml.org/mailman/listinfo/cellml-discussion

Reply via email to