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

Online Help

All Products    Maple    MapleSim


Units

  

UseUnit

  

set a default unit

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

UseUnit(unit)

Parameters

unit

-

unit name or unit expression ; default unit to use for its dimension

Description

• 

The UseUnit command is used to select a unit that is to be used for computations in the Units package. The return value is either true or false, indicating whether this overwrites a previous selection given with the same command.

• 

If the Units[Standard], Units[Natural], or Units[Simple] package is loaded, then whenever different unit expressions are multiplied, Maple converts units into the default unit for that dimension. When adding unit expressions with different units (but with the same dimension), Maple does the same. If the packages are not loaded, then the same can be achieved by using the combine/units procedure. There are two ways to control what the default unit for a given dimension is:

– 

The Units[UseSystem] command can be used to select a coherent system of units that the default units are taken from, such as the SI system or the FPS system. One can define a new, custom system using the Units[AddSystem] command.

– 

This command, Units[UseUnit], can be used to override the choice of unit for any single dimension.

• 

To set a default unit for a given dimension for all future Maple sessions, add the UseUnit command to your Maple initialization file. For more information, see Create Maple Initialization File.

• 

By default, running the Units[UseSystem] command will overwrite the current set of units selected with the UseUnit command. This can be prevented by using the keepOverrides option to that command. Furthermore, the convert/system command will by default convert purely to the system specified, disregarding units selected with UseUnit. This can be prevented by using the respectOverrides option to the convert/system command.

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:

Automatically loading the Units[Simple] subpackage

3.23Unitmih

3.23mih

(1)

combine3.23Unitmih,units

1.443939200ms

(2)

We select a unit for the dimensions speed and length.

UseUnitfts:UseUnitUnitmm:

combine3.23Unitmih,units

4.737333333fts

(3)

convert3.23,system,ft,SI

0.9845040000

(4)

convert3.23,system,ft,SI,respectOverrides

984.5040000

(5)

We load the Units[Standard] package and reset the overridden units by selecting the (default) SI system.

withUnitsStandard:UseSystemSI:

speed32Unitms

speed32ms

(6)

duration2Units

duration2s

(7)

speedduration

64m

(8)

Now we select the unit mm for lengths.

UseUnitmm:

speedduration

64000mm

(9)

Compatibility

• 

The Units[UseUnit] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Create Maple Initialization File

infolevel

unassign

Units

Units/Commands

Units/Index

Units/Systems

Units[AddSystem]

Units[GetSystem]

Units[GetSystems]

Units[HasSystem]

Units[Natural]

Units[RemoveSystem]

Units[Standard]

Units[UsingSystem]