Unit Annotations and Context - Maple Help

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

Unit Annotations and Context

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 $\mathrm{unit}\left(\mathrm{symbol}\right)$. 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.0⟦\mathrm{gal}\left(\mathrm{petroleum}\right)⟧$ to indicate $15.0$ gallons of gasoline or diesel as opposed to $15.0$ gallons in the abstract, or $x⟦J\left(\mathrm{mech}\right)⟧$ 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 $\frac{425143.}{{m}^{2}}$, since its dimension is $\frac{\mathrm{length}}{{\mathrm{length}}^{3}}=\frac{1}{{\mathrm{length}}^{2}}$; however, $\frac{\mathrm{mile}}{\mathrm{gallon}\left(\mathrm{petroleum}\right)}$ does not simplify (its dimension is $\frac{\mathrm{length}}{{\mathrm{length}\left(\mathrm{petroleum}\right)}^{3}}$). 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 $\mathrm{length}\left(\mathrm{radius}\right)$; for example, $m\left(\mathrm{radius}\right)$. So a radian is defined as a $\frac{m}{m\left(\mathrm{radius}\right)}$. As an example of contexts, Maple understands a mile[standard] as different from a mile[US_survey]: one standard mile is $\frac{499999}{500000}$ US survey miles. Or for a different example: minute can refer to a unit of time, but also to $\frac{1}{60}$ 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 $2⟦{\mathrm{mile}}_{\mathrm{US_survey}}⟧$ and an arc length of $3⟦{\mathrm{mile}}_{\mathrm{nautical}}⟧$ describes an angle of $\frac{3}{2}⟦\frac{{\mathrm{mile}}_{\mathrm{nautical}}}{{\mathrm{mile}}_{\mathrm{US_survey}}\left(\mathrm{radius}\right)}⟧$.