Overview of the Units[Natural] Subpackage - Maple Help

Home : Support : Online Help : Science and Engineering : Units : Environments : Natural : Units/Natural

Overview of the Units[Natural] Subpackage

Basic Functionality

 • 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');
 $\frac{{203}}{{100}}{}⟦{m}⟧$ (1)

Redefined Natural Units Environment Commands

 The commands redefined in the Natural Units environment to accept input with units are:

 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.

Examples

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 $\mathrm{unit}$ and then enter the unit.
 – In Maple 2015 and later versions, the double brackets around a unit are not displayed unless you are editing the unit.
 > $\mathrm{with}\left(\mathrm{Units}[\mathrm{Natural}]\right):$
 > $\mathrm{a_length}≔2⟦'m'⟧$
 ${\mathrm{a_length}}{:=}{2}{}⟦{m}⟧$ (2)
 > $\mathrm{a_width}≔3m$
 ${\mathrm{a_width}}{:=}{3}{}⟦{m}⟧$ (3)
 > $\mathrm{an_area}≔\mathrm{a_length}\mathrm{a_width}$
 ${\mathrm{an_area}}{:=}{6}{}⟦{{m}}^{{2}}⟧$ (4)

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{x}^{4}\mathrm{ft}+4xy{\left(y-x\right)}^{2}\mathrm{ft}$
 $\left({3}{}{{x}}^{{4}}{+}{4}{}{x}{}{y}{}{\left({y}{-}{x}\right)}^{{2}}\right){}⟦{\mathrm{ft}}⟧$ (5)
 > $3{x}^{4}m+4xy{\left(y-x\right)}^{2}\mathrm{ft}$
 $\left({3}{}{{x}}^{{4}}{+}\frac{{762}}{{625}}{}{x}{}{y}{}{\left({y}{-}{x}\right)}^{{2}}\right){}⟦{m}⟧$ (6)

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.

 > $\mathrm{diff}\left(,xs\right)$
 $\left({12}{}{{x}}^{{3}}{+}\frac{{762}}{{625}}{}{y}{}{\left({y}{-}{x}\right)}^{{2}}{-}\frac{{1524}}{{625}}{}{x}{}{y}{}\left({y}{-}{x}\right)\right){}⟦\frac{{m}}{{s}}⟧$ (7)
 > $\mathrm{collect}\left(,x\right)$
 $\left({12}{}{{x}}^{{3}}{+}\frac{{2286}}{{625}}{}{y}{}{{x}}^{{2}}{-}\frac{{3048}}{{625}}{}{{y}}^{{2}}{}{x}{+}\frac{{762}}{{625}}{}{{y}}^{{3}}\right){}⟦\frac{{m}}{{s}}⟧$ (8)
 > $\cdot 625$
 $\left({7500}{}{{x}}^{{3}}{+}{2286}{}{{x}}^{{2}}{}{y}{-}{3048}{}{x}{}{{y}}^{{2}}{+}{762}{}{{y}}^{{3}}\right){}⟦\frac{{m}}{{s}}⟧$ (9)
 > $\mathrm{convert}\left(,'\mathrm{units}','\frac{\mathrm{mi}}{h}'\right)$
 $\left(\frac{{23437500}}{{1397}}{}{{x}}^{{3}}{+}\frac{{56250}}{{11}}{}{y}{}{{x}}^{{2}}{-}\frac{{75000}}{{11}}{}{{y}}^{{2}}{}{x}{+}\frac{{18750}}{{11}}{}{{y}}^{{3}}\right){}⟦\frac{{\mathrm{mi}}}{{h}}⟧$ (10)
 > $\mathrm{eval}\left(,\left[x=3⟦'s'⟧,y=4⟦'\mathrm{min}'⟧\right]\right)$
 ${10012333860}{}⟦{{s}}^{{2}}{}{m}⟧$ (11)

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\left(x\right)$ 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.

 > $\mathrm{Units}[\mathrm{UseSystem}]\left('\mathrm{strict}'\right):$
 > $3m\mathrm{ft}{x}^{3}$
 ${3}{}{\mathrm{ft}}{}{{x}}^{{3}}{}⟦{m}⟧$ (12)
 > $\mathrm{diff}\left(,x\right)$
 ${9}{}{\mathrm{ft}}{}{{x}}^{{2}}{}⟦{m}⟧$ (13)
 > $3m{x}^{3}⟦'\mathrm{ft}'⟧$
 $\frac{{1143}}{{1250}}{}{{x}}^{{3}}{}⟦{{m}}^{{2}}⟧$ (14)
 > $\mathrm{diff}\left(,x\right)$
 $\frac{{3429}}{{1250}}{}{{x}}^{{2}}{}⟦{{m}}^{{2}}⟧$ (15)