Overview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Overview of the Units:-Simple Subpackage

 

Basic Functionality

Examples

Compatibility

Basic Functionality

• 

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, 5m+x is a valid expression if x is unassigned, because x may represent a length. On the other hand, 5m+x6s+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');

203100m

(1)

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.

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 unit and then enter the unit.

– 

When you edit a unit, double brackets appear around it.

withUnits:-Simple&colon;

a_length2Unitm

a_length2m

(2)

a_width3Unitm

a_width3m

(3)

an_areaa_lengtha_width

an_area6m2

(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.

3x4Unitft+4xyyx2Unitft

3x4+4xyyx2ft

(5)

3x4Unitm+4xyyx2Unitft

3x4+762xyyx2625m

(6)

diff&comma;xUnits

12x3+762yyx26251524xyyx625ms

(7)

collect&comma;x

12x3+2286625yx23048625y2x+762625y3ms

(8)

625

7500x3+2286yx23048y2x+762y3ms

(9)

convert&comma;units&comma;mih

234375001397x3+5625011yx27500011y2x+1875011y3mih

(10)

eval&comma;x=3Units&comma;y=4Unitmin

10012333860s2m

(11)

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.

x2tx1t+80.6Unitm&colon;

Then the velocity of the front and back of the train car are always the same.

diffx2t&comma;t

&DifferentialD;&DifferentialD;tx1t

(12)

Compatibility

• 

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