combine/units - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Units : Combining : combine/units

combine/units

combine units

 Calling Sequence combine(expr, 'units', opts)

Parameters

 expr - algebraic expression opts - equation(s) of the form option=value where option is one of 'mode' or 'system'; specify options for combining units

Description

 • The combine/units function combines, if possible, expressions involving units into a unit-free expression multiplied by a Unit object.
 • The conversion $\mathrm{convert}\left(\mathrm{expr},'\mathrm{metric}'\right)$ can be implemented as combine(expr, 'units', 'mode'='natural').
 • The opts argument can contain one or more of the following equations that set options for how units are interpreted and combined.
 'mode'=standard or natural or simple
 The mode standard indicates that Maple uses routines and operations from the Units[Standard] environment, whereas the mode natural indicates routines and operations from the Units[Natural] environment and simple indicates routines and operations from the Units[Simple] environment.
 The default mode is set by the UseMode command, which is called if you load Units[Standard], Units[Natural], or Units[Simple]. If the command hasn't been called, the default mode is standard.
 'system'=symbol
 By default, any result is converted to the default system of units, which by default is SI.  By specifying a different system of units, the result is converted, if possible, to that system.

Examples

Note: Prior to Maple 2015, units were displayed surrounded by double brackets.

 > $\mathrm{combine}\left(4'\mathrm{ft}'+3'\mathrm{inches}','\mathrm{units}','\mathrm{mode}'='\mathrm{natural}'\right)$
 $\frac{{6477}}{{5000}}{}⟦{m}⟧$ (1)
 > $\mathrm{combine}\left('\mathrm{yards}','\mathrm{units}','\mathrm{mode}'='\mathrm{natural}'\right)$
 $\frac{{1143}}{{1250}}{}⟦{m}⟧$ (2)
 > $\mathrm{combine}\left(5'{\mathrm{gallons}}_{\mathrm{UK}}','\mathrm{units}','\mathrm{mode}'='\mathrm{natural}'\right)$
 $\frac{{454609}}{{20000000}}{}⟦{{m}}^{{3}}⟧$ (3)
 > $\mathrm{combine}\left(5'{\mathrm{gallons}}_{\mathrm{US_liquid}}','\mathrm{units}','\mathrm{mode}'='\mathrm{natural}'\right)$
 $\frac{{473176473}}{{25000000000}}{}⟦{{m}}^{{3}}⟧$ (4)
 > $\mathrm{with}\left({\mathrm{Units}}_{\mathrm{Natural}}\right):$
 > $\mathrm{d1}≔3\mathrm{ft}$
 ${\mathrm{d1}}{≔}{3}{}⟦{\mathrm{ft}}⟧$ (5)
 > $\mathrm{t1}≔13s$
 ${\mathrm{t1}}{≔}{13}{}⟦{s}⟧$ (6)
 > $\mathrm{speed}≔\mathrm{subs}\left(\mathrm{dx}=\mathrm{d1},\mathrm{dt}=\mathrm{t1},\frac{\mathrm{dx}}{\mathrm{dt}}\right)$
 ${\mathrm{speed}}{≔}\frac{{3}}{{13}{}⟦{s}⟧}{}⟦{\mathrm{ft}}⟧$ (7)
 > $\mathrm{combine}\left(\mathrm{speed},'\mathrm{units}'\right)$
 $\frac{{1143}}{{16250}}{}⟦\frac{{m}}{{s}}⟧$ (8)
 > $\mathrm{combine}\left(\mathrm{speed},'\mathrm{units}','\mathrm{system}'='\mathrm{FPS}'\right)$
 $\frac{{3}}{{13}}{}⟦\frac{{\mathrm{ft}}}{{s}}⟧$ (9)