Overview of the Units:-Natural Subpackage
Basic Functionality
Examples
The Units:-Natural subpackage provides an environment that allows users to include units in expressions. The with(Units:-Natural) command establishes an environment in which some functions are modified to accept input with units.
The Natural Units environment provides users with two ways to include units in expressions. The Unit command, Unit(unit_name), or the natural notation, unit_name, can be used.
The with(Units:-Natural) command does not allow the use of the short form of the Units package commands that customize the dimensions, units, and systems of units. For that, it is necessary to enter the with(Units) command. For a list of the commands in the Units package, see Units.
Accessing the Natural Units Environment
To include units in an expression or to use a redefined Units:-Natural subpackage command in the current Maple session, enter the with(Units:-Natural) command first.
with(Units:-Natural):
3*cm + 2*Unit('m');
203100⁢m
Loading the Units package (which allows you to use the short form to access Units package commands) additionally loads one of the Units subpackages; by default, this is the Units:-Simple package. If you want to use the short form to access Units package commands together with the Natural Units environment, you can do this in at least two ways:
You can load the Units and Units:-Natural packages. This works in either order: if you load the Units package first, it will by default load the Units:-Simple package, but loading the Units:-Natural package overrides this. If you load the Units:-Natural package first, then the Units package detects this when it is loaded and it doesn't load a subpackage.
A variation on this is loading the Units:-Natural package and Units:-CommandsOnly. The latter is a variation of loading the Units package that doesn't load any subpackages.
Alternatively, you can instruct the Units package to load the Units:-Natural subpackage when it is loaded. You can do this with the Units:-UseMode command before loading the Units package:
restart;
Units:-UseMode(natural);
simple
with(Units):
Automatically loading the Units[Natural] subpackage
Redefined Natural Units Environment Commands
The commands redefined in the Natural Units environment to accept input with units are:
*
+
-
/
<
<=
<>
=
>
>=
^
abs
arccos
arccosh
arccot
arccoth
arccsc
arccsch
arcsec
arcsech
arcsin
arcsinh
arctan
arctanh
argument
ceil
collect
combine
conjugate
convert
cos
cosh
cot
coth
csc
csch
csgn
diff
eval
evalc
evalr
exp
expand
factor
floor
frac
Im
int
ln
log
max
min
normal
plot
plot3d
polar
Re
root
round
sec
sech
seq
shake
signum
simplify
sin
sinh
sqrt
surd
tan
tanh
trunc
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 Natural 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:-Natural:
a_length≔2⁢Unit⁡m
a_length≔2⁢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⁢ft+4⁢x⁢y⁢y−x2⁢ft
3⁢x4+4⁢x⁢y⁢y−x2⁢ft
3⁢x4⁢m+4⁢x⁢y⁢y−x2⁢ft
3⁢x4+762⁢x⁢y⁢y−x2625⁢m
You can specify a unit for the differentiating variable in the Units:-Natural:-diff function. To do so, multiply the differentiating variable by the unit.
diff⁡,x⁢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
Although the Natural Units environment provides a natural method of using units, some inputs can be misinterpreted as units. For example, the name f is the symbol for the fresnel, a unit of frequency. Therefore, f⁡x is interpreted as the fresnel with the modifier or attachment x. To avoid these problems, use the strict option with the UseSystem command. Then only units, including units with prefixes, from the default system of units are accepted in the natural notation. To include units that are not in the default system, use the Unit command.
Units:-UseSystem⁡strict:
3⁢m⁢ft⁢x3
3⁢ft⁢x3⁢m
diff⁡,x
9⁢ft⁢x2⁢m
3⁢m⁢x3⁢Unit⁡ft
1143⁢x31250⁢m2
3429⁢x21250⁢m2
See Also
Units
Units/frequency
Units/Index
Units/SI
Units/Systems
Units:-Natural functions
Units:-Natural:-diff
Units:-Simple
Units:-Standard
Units:-UseSystem
Download Help Document