Arithmetic Operators - Maple Help

Arithmetic Operators in the Simple Units Environment

Description

 • In the Simple Units environment, the arithmetic operators (+, -, *, /, and ^) are modified so that they perform the necessary operations on expressions with units.
 • Every command in the Simple Units environment that needs to determine whether an expression is valid or not, does so using the Units[TestDimensions] command.
 • Given units x and y, the properties of the five arithmetic operators are:

$\left(a\mathrm{Unit}\left(x\right)\right)+\left(b\mathrm{Unit}\left(x\right)\right)↦\left(a+b\right)\mathrm{Unit}\left(x\right)$

$\left(a\mathrm{Unit}\left(x\right)\right)+\left(b\mathrm{Unit}\left(y\right)\right)↦\left(a\mathrm{za}+b\mathrm{zb}\right)\mathrm{Unit}\left(z\right)$

$-\left(a\mathrm{Unit}\left(x\right)\right)↦\left(-a\right)\mathrm{Unit}\left(x\right)$

$\left(a\mathrm{Unit}\left(x\right)\right)\left(b\mathrm{Unit}\left(y\right)\right)↦\left(ab\right)\mathrm{z0}\mathrm{Unit}\left(z\right)$

$\frac{1}{\left(a\mathrm{Unit}\left(x\right)\right)}↦\frac{1}{a}\mathrm{Unit}\left(\frac{1}{x}\right)$

${\left(a\mathrm{Unit}\left(x\right)\right)}^{r}↦{a}^{r}\mathrm{Unit}\left({x}^{r}\right)$

${a}^{b}↦{a}^{b}$

 where r is a rational number; z is an appropriate unit from the currently selected system; and za, zb, and z0 are appropriate multipliers.
 Note: Prior to Maple 2015, units were displayed surrounded by double brackets.
 > with(Units[Simple]):
 > 3*Unit('m')+7*Unit('ft');
 $\frac{{6417}}{{1250}}{}⟦{m}⟧$ (1)
 > (3*Unit('cm'/'s'^2))*(7*Unit('g'));
 $\frac{{21}}{{100000}}{}⟦{N}⟧$ (2)
 > -(32*Unit('m'));
 ${-}{32}{}⟦{m}⟧$ (3)
 > 1/(32*Unit('S'));
 $\frac{{1}}{{32}}{}⟦\frac{{1}}{{S}}⟧$ (4)
 > (3*Unit('m'))^2;
 ${9}{}⟦{{m}}^{{2}}⟧$ (5)
 > 4^x;
 ${{4}}^{{x}}$ (6)