Simple Unit Worksheet - Maple Help

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, $\mathrm{sin}\left(3.0⟦\mathrm{degrees}⟧\right)$ evaluates the sine of 3 degrees and $\mathrm{max}\left(4⟦m⟧,10⟦\mathrm{ft}⟧\right)$  returns $4⟦m⟧$.

Arithmetic operators are overloaded to extract units from their operands. For example, $3⟦m⟧+4⟦\mathrm{cm}⟧$ evaluates to $\frac{76}{25}⟦m⟧$ and  evaluates to $11.39316239⟦\frac{m}{s}⟧$, which can be converted to $25.48577843⟦\mathrm{mph}⟧$.

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.

 > $\mathrm{restart}$
 > $\mathrm{with}\left(\mathrm{Units}\right):$

Simple Examples

Add 4 feet to 3 inches.

 > $4⟦\mathrm{ft}⟧+3⟦\mathrm{inches}⟧$
 $\frac{{6477}}{{5000}}{}⟦{m}⟧$ (1.1)
 > $\mathrm{convert}\left(,\mathrm{units},\mathrm{inches}\right)$
 ${51}{}⟦{\mathrm{in}}⟧$ (1.2)

How many meters are equivalent to 4 yards?

 > $4⟦\mathrm{yd}⟧$
 ${4}{}⟦{\mathrm{yd}}⟧$ (1.3)
 > $\mathrm{convert}\left(,\mathrm{units},m\right)$
 $\frac{{2286}}{{625}}{}⟦{m}⟧$ (1.4)

How many liters are equivalent to 5 UK gallons?

 > $\mathrm{convert}\left(5⟦\mathrm{gal}\left[\mathrm{UK}\right]⟧,\mathrm{units},L\right)$
 $\frac{{454609}}{{20000}}{}⟦{L}⟧$ (1.5)

How many liters are equivalent to 5 US gallons?

 > $\mathrm{convert}\left(5⟦\mathrm{gal}\left[\mathrm{US_liquid}\right]⟧,\mathrm{units},L\right)$
 $\frac{{473176473}}{{25000000}}{}⟦{L}⟧$ (1.6)

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

 > $\mathrm{convert}\left(⟦\mathrm{gal}\left[\mathrm{US_liquid}\right]⟧,\mathrm{units},⟦\mathrm{gal}\left[\mathrm{UK}\right]⟧\right)$
 $\frac{{473176473}}{{568261250}}{}⟦{{\mathrm{gal}}}_{{\mathrm{UK}}}⟧$ (1.7)