set the default mode for combining units
(optional) symbol; name of mode for combining units
The combine/units command can be used with several modes for combining units, corresponding to subpackages of the Units package. The UseMode(mode) function sets a default mode for combining units, to be used for the current session.
The modes available are currently simple, standard, and natural, corresponding to the Units/Simple, Units/Standard, and Units/Natural subpackages, respectively. If you load any of these packages, Maple will automatically call UseMode with the corresponding argument.
When you load the Units package, Maple will automatically load the subpackage corresponding to the currently selected mode.
Additionally, the mode set by this command determines the default for the symbolic option of the convert/units command. In simple mode, the conversions happen with symbolic = true by default; in the two other modes, the default is symbolic = false.
The default mode if none of these packages have been loaded is simple.
Calling the UseMode command manually can be useful if you use the default Units environment, i.e., without loading any packages, and you wish to select how combine/units should combine units. It can also be useful to do this before loading the Units package, to instruct it which subpackage to load.
The setting effected by the UseMode command applies to any calls to combine/units made by the user themselves, but also to calls from inside other commands, such as plot and int.
The UseMode command returns the previous mode that was in effect. When called without any arguments, its only effect is to return the current mode.
To set a default mode for combining units for all future Maple sessions, add the UseMode command to your Maple initialization file. For more information, see Create Maple Initialization File.
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.
The default setting if none of the Units environments have been loaded is simple.
We can see this because combine/units accepts the following expression, which assumes the unassigned variable distance has a unit of length.
In either the Units/Standard or Units/Natural model, this expression is invalid. Notice that if we select the standard units mode, executing the same expression results in an error about adding distance, which is now implicitly unitless, and the term with a unit.
Error, (in Units:-Standard:-`+`) the units `1` and `km` have incompatible dimensions
To verify that the correct mode was stored, we can call the UseMode command again.
With the currently selected mode, the default value for the symbolic option of the convert/units command is false. This means, for example, that Maple distinguishes between angles and unitless quantities, and between torque and energy; you cannot convert one to the other.
Error, (in `convert/units`) unable to convert `N*m(radius)` to `Btu`
If we supply the option symbolic = true, or if we switch to the simple mode, then this conversion succeeds, with the implicit understanding that it is the energy required for applying the torque over an angle of one radian.
If we load the Units[Standard] package in a new Maple session to enable the Standard Units environment, the standard mode is automatically selected.
This means that the combine command we used above will throw an error, as before.
You can override the mode by calling UseMode again, or by explicitly supplying the mode option to the combine/units command. In either case, you need to be careful, otherwise the addition operator, +, generates an error before it gets to combine/units. This can be overcome by explicitly using the top level version of + instead of the one from the Units[Standard] package.
Loading the Units package also loads one of the Units subpackages, as indicated by the currently selected mode. By default, this is the Units[Simple] subpackage, but this can be overridden using the UseMode command.
Automatically loading the Units[Simple] subpackage
Automatically loading the Units[Standard] subpackage
The Units[UseMode] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
The Units[UseMode] command was updated in Maple 2018.
Create Maple Initialization File
Download Help Document
What kind of issue would you like to report? (Optional)