Unit Annotations and Context - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Units : Details : Unit Annotations and Context

Unit Annotations and Context

 

Description

Examples

Description

• 

In Maple, units (and dimensions) can be annotated with an arbitrary symbol to indicate that the physical quantity being described is of a particular type. This is done by writing the unit as a function of the symbol, as unitsymbol. The symbol is called an annotation.

• 

A few commands related to the Units package have an option called symbolic; this option makes Maple temporarily ignore these annotations.

• 

Additionally, a unit can be indexed with specific symbols: this indicates an alternative definition of the unit itself, not just a different underlying physical quantity. The index is called the context. If no context is specified for a unit, the default context is used. Which context is the default context differs per unit; the help pages with tables of units, such as Units,time or Units,permeability, indicate default contexts with an asterisk (*).

Examples

One can specify a volume as 15.0galpetroleum to indicate 15.0 gallons of gasoline or diesel as opposed to 15.0 gallons in the abstract, or xJmech to indicate x joules of mechanical energy rather than general energy. The effect of this is that the annotated units do not recombine with un-annotated units. This is nice for discussing fuel consumption, for example: without this feature, the unit mile_per_gallon would simplify to approximately 425143.m2, since its dimension is length length3=1length2; however, milegallonpetroleum does not simplify (its dimension is lengthlengthpetroleum3).

One obtains an angle in radians by dividing the length of an arc by the length of a radius. At first sight, this would seem to require that an angle always simplifies to unit 1, which would be undesirable. The solution is that in Maple, the denominator gets a unit of the dimension lengthradius; for example, mradius. So a radian is defined as a mmradius.

As an example of contexts, Maple understands a mile[standard] as different from a mile[US_survey]: one standard mile is 499999500000 US survey miles. Or for a different example: minute can refer to a unit of time, but also to 160 of a degree - the unit of angle. In Maple, these are known as the minute[SI] (or just minute, since SI is the default context for minute, as can be seen on the help page Units,time) and the minute[angle], respectively.

If both a context and an annotation are needed on a unit, then the context should be specified first. For example, a circle segment with a radius of 2mileUS_survey and an arc length of 3milenautical describes an angle of 32milenauticalmileUS_surveyradius.