Unit Annotations and Context
DescriptionExamples
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>
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 NiMtSSV1bml0RzYiNiNJJ3N5bWJvbEdJKnByb3RlY3RlZEdGKA==. 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 (*).
<Text-field style="Heading 2" layout="Heading 2" bookmark="examples">Examples</Text-field>
One can specify a volume as NiMsJC1JJVVuaXRHSShfc3lzbGliRzYiNiMtSSRnYWxHRic2I0kqcGV0cm9sZXVtR0YnJCIkXSIhIiI= to indicate NiMkIiRdIiEiIg== gallons of gasoline or diesel as opposed to NiMkIiRdIiEiIg== gallons in the abstract, or NiMqJkkieEc2IiIiIi1JJVVuaXRHSShfc3lzbGliR0YlNiMtSSJKR0YlNiNJJW1lY2hHRiVGJg== to indicate NiNJInhHNiI= 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 NiMsJCokSSJtRzYiISIjJCInVl5VIiIh, since its dimension is NiMvKiZJKGxlbmd0aH5HNiIiIiJJJ2xlbmd0aEdJKnByb3RlY3RlZEdGKSEiJCokRighIiM=; however, NiMqJkklbWlsZUc2IiIiIi1JJ2dhbGxvbkdGJTYjSSpwZXRyb2xldW1HRiUhIiI= does not simplify (its dimension is NiMqJkknbGVuZ3RoR0kqcHJvdGVjdGVkR0YlIiIiLUYkNiNJKnBldHJvbGV1bUc2IiEiJA==).
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 NiMtSSdsZW5ndGhHSSpwcm90ZWN0ZWRHRiU2I0kncmFkaXVzRzYi; for example, NiMtSSJtRzYiNiNJJ3JhZGl1c0dGJQ==. So a radian is defined as a NiMqJkkibUc2IiIiIi1GJDYjSSdyYWRpdXNHRiUhIiI=.
As an example of contexts, Maple understands a mile[standard] as different from a mile[US_survey]: one standard mile is NiMjIicqKioqXCInKytd US survey miles. Or for a different example: minute can refer to a unit of time, but also to NiMjIiIiIiNn 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 NiMsJC1JJVVuaXRHSShfc3lzbGliRzYiNiMmSSVtaWxlR0YnNiNJKlVTX3N1cnZleUdGJyIiIw== and an arc length of NiMsJC1JJVVuaXRHSShfc3lzbGliRzYiNiMmSSVtaWxlR0YnNiNJKW5hdXRpY2FsR0YnIiIk describes an angle of NiMsJC1JJVVuaXRHSShfc3lzbGliRzYiNiMqJiZJJW1pbGVHRic2I0kpbmF1dGljYWxHRiciIiItJkYrNiNJKlVTX3N1cnZleUdGJzYjSSdyYWRpdXNHRichIiIjIiIkIiIj.