convert/units - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Units : Conversions : convert/units

convert/units

convert between units

 Calling Sequence convert(u, 'units', unitFrom, unitTo, opts) convert(u*Unit(unitFrom), 'units', unitTo, opts)

Parameters

 u - expression unitFrom - symbol; unit to be converted from unitTo - symbol; unit to be converted to opts - (optional) equation(s) of the form option=value where option is one of energy or symbolic; specify options for the conversion

Description

 • The convert(u, 'units', unitFrom, unitTo) function multiplies the value u by the conversion factor from UnitFrom to UnitTo.
 • The units unitTo and unitFrom can be labeled in any way accepted by the Units package, for example, name, abbreviation, or symbol.
 Note: Thermodynamic temperature conversions are for temperature intervals, not absolute temperatures. For example, 1 degree Celsius is converted to 1 kelvin, not 274.15 kelvin.  For conversions of absolute temperatures, use convert/temperature.
 • You can modify the properties of the conversion by including options opts. The opts argument can contain one or more of the following equations.
 'energy'=truefalse
 If this option is set to true, the conversion can be between energy units, not necessarily units with the same dimensions. Furthermore, UnitTo can be set to $1$ to convert to a dimensionless quantity.  For more information about energy transformations, see Energy Conversions.
 'symbolic'=truefalse
 This option specifies whether annotations to units should be ignored.  By default, this option is set to false.

Examples

 > $\mathrm{convert}\left(100.0,'\mathrm{units}','\mathrm{ft}','m'\right)$
 ${30.48000000}$ (1)
 > $\mathrm{convert}\left(46145,'\mathrm{units}','\mathrm{yards}','\mathrm{kilometers}'\right)$
 $\frac{{10548747}}{{250000}}$ (2)
 > $\mathrm{convert}\left(120,'\mathrm{units}','W','\mathrm{hp}'\right)$
 $\frac{{2000000000000000}}{{12428331193037837}}$ (3)
 > $\mathrm{convert}\left(1,'\mathrm{units}','{\mathrm{permittivity}}_{\mathrm{Atomic}}',1,'\mathrm{energy}'=\mathrm{true}\right)$
 ${1}$ (4)
 > $\mathrm{convert}\left(5⟦Nm\left(\mathrm{radius}\right)⟧,'\mathrm{units}',Nm,'\mathrm{symbolic}'=\mathrm{true}\right)$
 ${5}{}⟦{N}{}{m}⟧$ (5)

In the following example, the expression being converted has a unit associated with it. Here, only the unitTo parameter needs to provided.

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 $\mathrm{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.
 > $\mathrm{with}\left(\mathrm{Units}[\mathrm{Standard}]\right):$
 > $3⟦\frac{'\mathrm{kg}''m'}{'s'}⟧$
 ${3}{}⟦\frac{{\mathrm{kg}}{}{m}}{{s}}⟧$ (6)
 > $\mathrm{convert}\left(,'\mathrm{units}',\frac{'\mathrm{lb}''\mathrm{ft}'}{'h'}\right)$
 $\frac{{450000000000000}}{{5760623099}}{}⟦\frac{{\mathrm{lb}}{}{\mathrm{ft}}}{{h}}⟧$ (7)