Units - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Units : Manipulating Systems : Units/UseUnit

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] or Units[Natural] 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.

– 

In Maple 2015 and later versions, the double brackets around a unit are not displayed unless you are editing the unit.

withUnits:

3.23'mi''h'

3.23mih

(1)

combine3.23'mi''h','units'

1.443939200ms

(2)

We select a unit for the dimensions speed and length.

UseUnit'fts':UseUnit'mm':

combine3.23'mi''h','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.

withUnits[Standard]:UseSystem'SI':

speed32'm''s'

speed:=32ms

(6)

duration2's'

duration:=2s

(7)

speedduration

64m

(8)

Now we select the unit mm for lengths.

UseUnit'mm':

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]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam