Improvements in Handling of Units in Maple 2024
Maple 2024 includes several improvements to the handling of units.

Faster computation with Matrices with Units• When working with matrices with entries with units, Maple can now perform operations
much faster than before. See the Performance Improvements in Maple 2024 help pagefor details.

The Statistics package• The Statistics package deals with many aspects of statistics. Its functionality is divided
up into a few large parts. Nearly all commands mentioned on the Descriptive Statistics,Random Variables, and Distributions help pages will work with units.

> with(Statistics):• Using a distribution will verify dimensional consistency of the units involved, and raise
an error if the units are inconsistent, either because a particular parameter cannot havea (nontrivial) unit, or because multiple parameters have to agree with each other.

> rv1 := RandomVariable(Normal(5*Unit(m), 2*Unit(s)));Error, (in Statistics:-Distribution) units problem in parameters for
distribution Normal; found contradictions {Distribution::(5*Units:-Unit(m)), Distribution::(2*Units:-Unit(s))}> rv1 := RandomVariable(Normal(5*Unit(m), 3*Unit(ft)));rv1 d _R
> rv2 := RandomVariable(Weibull(5*Unit(m), 2*Unit(m)));Error, (in Statistics:-Distribution) units problem in 2nd parameter, 2*Units:-Unit(m), for distribution Weibull; found nontrivial unit, but did
not expect one> rv2 := RandomVariable(Weibull(5*Unit(m), 2));rv2 d _R0
• We can compute various statistical properties of these distributions as follows.

> Mean(rv1);
5m> Variance(rv2);
25 L

25 p4m2

> Skewness(rv1 - rv2);
L61035156250

p pL340368949 L 9765625 p> evalf(L61035156250

3 2p pL340368949 L 9765625 p3 2 );L0.5078727141• The same commands are used to compute these properties of a data sample.

> sample := [.0377*Unit(ft), .578*Unit(ft), 2.05*Unit(ft), 3.60*Unit(ft), 4.92*Unit(ft), 5.45*Unit(ft), 5.75*Unit(ft), 6.21*Unit(ft),2.77*Unit(m), 3.41*Unit(m), 4.01*Unit(m), 4.54*Unit(m), 5.41*Unit(m), 5.54*Unit(m), 5.61*Unit(m), 6.18*Unit(m), 7.21*Unit(m), 9.34*Unit(m), 13.9*Unit(m), 14.9*Unit(m)];sample d 0.0377 ft, 0.578 ft, 2.05 ft, 3.60 ft, 4.92 ft, 5.45 ft, 5.75 ft, 6.21 ft, 2.77 m, 3.41 m, 4.01 m,4.54 m, 5.41 m, 5.54 m, 5.61 m, 6.18 m, 7.21 m, 9.34 m, 13.9 m, 14.9 m> Mean(sample);15.0157430049500 ft> Variance(sample);
189.446615326348 ft2> Skewness(sample);
1.18031316013932• Cumulants of quantities with units are not well-defined. The Cumulant command checks
for this and raises an error if appropriate.

> Cumulant(rv1, 3);
Error, (in Statistics:-Cumulant) unexpected input: expected _R1*Units:Unit(m) to not have units> distance := 3*Unit(m);distance d 3 m> Cumulant(rv2 / distance, 3);
3 2

25

2536p

125 p
125 p
L
C181083 2> evalf(252536p

125 p
125 p
LC18108);0.290470418

> Cumulant(sample, 3);
Error, (in Statistics:-Cumulant) unexpected input: expected Vector(20,[.1149096000e-1*Units:-Unit(m),.1761744000*Units:-Unit(m),.6248400000*Units:-Unit(m),1.097280000*Units:-Unit(m),1.499616000*Units:-Unit(m),1.661160000*Units:-Unit(m),1.752600000*Units:-Unit(m),1.892808000*
Units:-Unit(m),2.77*Units:-Unit(m),3.41*Units:-Unit(m),4.01*Units:-Unit(m),4.54*Units:-Unit(m),5.41*Units:-Unit(m),5.54*Units:-Unit(m),5.61*
Units:-Unit(m),6.18*Units:-Unit(m),7.21*Units:-Unit(m),9.34*Units:-Unit(m),13.9*Units:-Unit(m),14.9*Units:-Unit(m)]) to not have units• The second argument of the AbsoluteDeviation command must have the same
dimension as the first argument. If it doesn't, an error is raised.

> AbsoluteDeviation(sample, 5*Unit(s));
Error, (in Statistics:-AbsoluteDeviation) unable to convert `s` to `ft`
> AbsoluteDeviation(sample, 2*Unit(fathom));
10.1286139500500 ft> AbsoluteDeviation(rv2, Mean(sample));1.878130286 m• Covariance is defined for data samples with different dimensions. So is correlation. Note
how the covariance has a unit, but the correlation doesn't.

> Covariance(rv1 * rv2, rv1 + rv2);

125 C> evalf( 125 C40368949 pL
62500040368949 p
L625000

5255255Cp5p
22p5C

53mp223m );30.5302225 m3> Correlation(rv1 * rv2, rv1);
1143
1025p

40368949 L 9765625 p> sample2 := [33.15 * Unit(N), 32.92 * Unit(N), 55.91 * Unit(N), 34.00* Unit(N), 16.81 * Unit(N), 38.74 * Unit(N), 20.80 * Unit(N), -16.14* Unit(N), 19.70 * Unit(N), 48.93 * Unit(N), 1.10 * Unit(N), 42.43 *Unit(N), 1.53 * Unit(N), -26.54 * Unit(N), 15.59 * Unit(N), 8.764 *Unit(N), -27.57 * Unit(N), -13.60 * Unit(N), -40.35 * Unit(N),-64.21 * Unit(N)];sample2 d 33.15 N, 32.92 N, 55.91 N, 34.00 N, 16.81 N, 38.74 N, 20.80 N, L16.14 N, 19.70 N, 48.93 N,

sample2 d 33.15 N, 32.92 N, 55.91 N, 34.00 N, 16.81 N, 38.74 N, 20.80 N, L16.14 N, 19.70 N, 48.93 N,1.10 N, 42.43 N, 1.53 N, L26.54 N, 15.59 N, 8.764 N, L27.57 N, L13.60 N, L40.35 N, L64.21 N> Covariance(sample, sample2);
L109.525825439543 J> Correlation(sample, sample2);
L0.813010115206344

The IPS system• Maple supports several so-called systems of units, which are combinations of units thatare often used together. The default system is the SI system. Another system that isoften used, especially in North America, is the FPS (foot-pound-second) system. For
Maple 2024, we have added the IPS (inch-pound-second) system, demonstrated below.

> restart;> with(Units):
Automatically loading the Units[Simple] subpackage> UseSystem(IPS);> velocity := 1*Unit(inch/second);
velocity dins

> mass := 5*Unit(pound);mass d 5 lb
> velocity^2 * mass;2540
lbf in196133• Converting this quantity to the SI and FPS system can be done, for example, as follows.

> convert(2540
lbf in, 'system', 'SI');
196133731599133573
J
500000000000000> convert(2540
lbf in, 'system', 'FPS');
196133635
lbf ft588399• The IPS system is also available in the Units Formatting dialog.

• Maple also supports more specialized systems of units.

> convert(

2540
lbf in, 'system', 'Atomic');
1961333.356155884 # 1014 E0> convert(

2540
lbf in, 'system', 'ESU');196133731599133573
erg
50000000