Simple Units Environment - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Applications and Example Worksheets : Language and System : examples/SimpleUnits

Simple Units Environment

The Simple Units environment is an environment designed for computations with units. This environment is set up by using the command with(Units[Simple]), or alternatively by using the command with(Units).

 

Various procedures are overloaded to handle units. For example, sin3.0degrees evaluates the sine of 3 degrees and max4m,10ft  returns 4m.

 

Arithmetic operators are overloaded to extract units from their operands. For example, 3m+4cm evaluates to 7625m and 53.32km 1.3h evaluates to 11.39316239ms, which can be converted to 25.48577843mph.

 

Note: Although easier to use, it is slower, in general, to perform computations in the Simple Units environment than to use the conversion routines at the top-level.

 

These computations can also be done in the Standard Units or Natural Units environment or at the top-level by using only conversion routines (see Default Units). Each example in this worksheet is also in the other worksheets to show how you can perform the computations in the other environments.

restart

withUnits:

Automatically loading the Units[Simple] subpackage


Simple Examples

Add 4 feet to 3 inches.

4ft+3inches

64775000m

(1.1)

convert,units,inches

51in

(1.2)

How many meters are equivalent to 4 yards?

4yd

4yd

(1.3)

convert,units,m

2286625m

(1.4)

How many liters are equivalent to 5 UK gallons?

convert5galUK,units,L

45460920000L

(1.5)

How many liters are equivalent to 5 US gallons?

convert5galUS_liquid,units,L

47317647325000000L

(1.6)

How many US liquid gallons are equivalent to a UK gallon?

convertgalUS_liquid,units,galUK

473176473568261250galUK

(1.7)

Return to Index for Example Worksheets