Units
UseUnit
set a default unit
Calling Sequence
Parameters
Description
Examples
Compatibility
UseUnit(unit)
unit
-
unit name or unit expression ; default unit to use for its dimension
The UseUnit command is used to select a unit that is to be used for computations in the Units package. The return value is either true or false, indicating whether this overwrites a previous selection given with the same command.
If the Units[Standard], Units[Natural], or Units[Simple] package is loaded, then whenever different unit expressions are multiplied, Maple converts units into the default unit for that dimension. When adding unit expressions with different units (but with the same dimension), Maple does the same. If the packages are not loaded, then the same can be achieved by using the combine/units procedure. There are two ways to control what the default unit for a given dimension is:
The Units[UseSystem] command can be used to select a coherent system of units that the default units are taken from, such as the SI system or the FPS system. One can define a new, custom system using the Units[AddSystem] command.
This command, Units[UseUnit], can be used to override the choice of unit for any single dimension.
To set a default unit for a given dimension for all future Maple sessions, add the UseUnit command to your Maple initialization file. For more information, see Create Maple Initialization File.
By default, running the Units[UseSystem] command will overwrite the current set of units selected with the UseUnit command. This can be prevented by using the keepOverrides option to that command. Furthermore, the convert/system command will by default convert purely to the system specified, disregarding units selected with UseUnit. This can be prevented by using the respectOverrides option to the convert/system command.
Notes:
To enter a unit in 2-D Math input, select the unit from the appropriate Units palette. If the unit you want is not there, select unit and then enter the unit.
When you edit a unit, double brackets appear around it.
with⁡Units:
Automatically loading the Units[Simple] subpackage
3.23⁢Unit⁡mih
3.23⁢mih
combine⁡3.23⁢Unit⁡mih,units
1.443939200⁢ms
We select a unit for the dimensions speed and length.
UseUnit⁡fts:UseUnit⁡Unit⁡mm:
4.737333333⁢fts
convert⁡3.23,system,ft,SI
0.9845040000
convert⁡3.23,system,ft,SI,respectOverrides
984.5040000
We load the Units[Standard] package and reset the overridden units by selecting the (default) SI system.
with⁡UnitsStandard:UseSystem⁡SI:
speed≔32⁢Unit⁡ms
speed≔32⁢ms
duration≔2⁢Unit⁡s
duration≔2⁢s
speed⁢duration
64⁢m
Now we select the unit mm for lengths.
UseUnit⁡mm:
64000⁢mm
The Units[UseUnit] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
See Also
Create Maple Initialization File
infolevel
unassign
Units/Commands
Units/Index
Units/Systems
Units[AddSystem]
Units[GetSystem]
Units[GetSystems]
Units[HasSystem]
Units[Natural]
Units[RemoveSystem]
Units[Standard]
Units[UsingSystem]
Download Help Document