Overview of the Units:-Simple Subpackage
Basic Functionality
Examples
Compatibility
The Units:-Simple subpackage provides an environment that allows users to work with units in their computations. The with(Units:-Simple) command establishes an environment in which some functions, including the ones for basic arithmetic, are modified to accept input with units. By default, the with(Units) command does the same.
Every command in the Simple Units environment that needs to determine whether an expression is valid or not, does so using the Units:-TestDimensions command.
To use the Simple Units environment, enter units using the Unit command, *Unit(unit_name).
In the Simple Units environment, in contrast to the Standard and Natural environments, unassigned variables are not automatically assumed to represent unit-free quantities. For example, 5⁢m+x is a valid expression if x is unassigned, because x may represent a length. On the other hand, 5⁢m+x⁢6⁢s+x is an invalid expression, because the first factor implies that x represents a length, whereas the second factor implies that x is a duration.
In the Simple Units environment, any verifications of valid dimensions ignore so-called Unit annotations. As a consequence, for example, you can add angles to unit-free quantities.
When using the Units:-Simple package, units will by default be converted to your selected unit system. (The default system is SI, the metric system.) To change the default system of units, use the UseSystem command.
The with(Units:-Simple) command does not allow the use of the short form of the Units package commands that customize the dimensions, units, and systems of units. In order to do that, it is necessary to enter the with(Units) command (which, by default, also loads the Units:-Simple package). For a list of the commands in the Units package, see Units.
Accessing the Simple Units Environment
To include units in an expression or to use a redefined Units:-Simple subpackage command in the current Maple session, enter the with(Units:-Simple) command first. Alternatively, you can enter the with(Units) command: this loads the Units package and then the subpackage corresponding to the currently selected mode (using the Units:-UseMode command). The default mode is simple, corresponding to the Units:-Simple subpackage.
Note: Prior to Maple 2015, units were displayed surrounded by double brackets.
with(Units:-Simple):
3*Unit('cm') + 2*Unit('m');
203100⁢m
Redefined Simple Units Environment Commands
The commands redefined in the Simple Units environment to accept input with units are:
*
+
-
/
<
<=
<>
=
>
>=
^
arccos
arccosh
arccot
arccoth
arccsc
arccsch
arcsec
arcsech
arcsin
arcsinh
arctan
arctanh
argument
collect
combine
cos
cosh
cot
coth
csc
csch
diff
eval
evalc
evalr
exp
factor
frem
ln
log
max
min
piecewise
polar
root
sec
sech
shake
sin
sinh
sqrt
surd
tan
tanh
type
verify
To display the help page for a particular command, click the corresponding hyperlink.
For more information on the interaction of these commands, see the Simple Units Example Worksheet.
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:-Simple:
a_length≔2⁢Unit⁡m
a_length≔2⁢m
a_width≔3⁢Unit⁡m
a_width≔3⁢m
an_area≔a_length⁢a_width
an_area≔6⁢m2
If an input has only one unit, the output uses that unit. If an input has more than one unit, the output is automatically converted to the default unit in the current system of units. The default system of units in the Units package is SI. To change the default system of units, use the UseSystem command.
3⁢x4⁢Unit⁡ft+4⁢x⁢y⁢y−x2⁢Unit⁡ft
3⁢x4+4⁢x⁢y⁢y−x2⁢ft
3⁢x4⁢Unit⁡m+4⁢x⁢y⁢y−x2⁢Unit⁡ft
3⁢x4+762⁢x⁢y⁢y−x2625⁢m
diff⁡,x⁢Unit⁡s
12⁢x3+762⁢y⁢y−x2625−1524⁢x⁢y⁢y−x625⁢ms
collect⁡,x
12⁢x3+2286625⁢y⁢x2−3048625⁢y2⁢x+762625⁢y3⁢ms
⋅625
7500⁢x3+2286⁢y⁢x2−3048⁢y2⁢x+762⁢y3⁢ms
convert⁡,units,mih
234375001397⁢x3+5625011⁢y⁢x2−7500011⁢y2⁢x+1875011⁢y3⁢mih
eval⁡,x=3⁢Unit⁡s,y=4⁢Unit⁡min
10012333860⁢s2⁢m
The following example uses the fact that the Simple Units environment doesn't assume that unassigned variables are unit-free.
Let x1 and x2 be the positions of the front and rear of an 80.6 meters long train car, as a function of time.
x2≔t↦x1⁡t+80.6⋅Unit⁡m:
Then the velocity of the front and back of the train car are always the same.
diff⁡x2⁡t,t
ⅆⅆtx1⁡t
The Units:-Simple subpackage was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
See Also
convert
Units
Units/frequency
Units/Index
Units/SI
Units/Systems
Units:-Natural
Units:-Simple functions
Units:-Simple:-diff
Units:-Standard
Units:-UseSystem
Download Help Document