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:
a⁢Unit⁡x+b⁢Unit⁡x↦a+b⁢Unit⁡x
a⁢Unit⁡x+b⁢Unit⁡y↦a⁢za+b⁢zb⁢Unit⁡z
−a⁢Unit⁡x↦−a⁢Unit⁡x
a⁢Unit⁡x⁢b⁢Unit⁡y↦a⁢b⁢z0⁢Unit⁡z
1a⁢Unit⁡x↦1a⁢Unit⁡1x
a⁢Unit⁡xr↦ar⁢Unitxr
ab↦ab
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');
64171250⁢m
(3*Unit('cm'/'s'^2))*(7*Unit('g'));
21100000⁢N
-(32*Unit('m'));
−32⁢m
1/(32*Unit('S'));
132⁢1S
(3*Unit('m'))^2;
9⁢m2
4^x;
4x
See Also
arithmetic operators
Units
Units/Simple
Download Help Document