 Tolerance - Maple Help

Introduction to the Tolerances Package Calling Sequence with(Tolerances) Description

 • The Tolerances package provides an environment to perform computations with quantities involving tolerances. Usage

 • After issuing the with(Tolerances) command, quantities involving tolerances can now be entered using a natural notation and any computations involving such quantities will return a value with the associated tolerance result.
 • The Tolerances package uses interval arithmetic to perform its computations. Entering Tolerances

 • Tolerances are entered by specifying the value, followed by the (absolute) tolerance, separated by a plus/minus ($±$) sign. To enter a plus/minus sign:
 – Use the palettes. See View>Palettes>Common Symbols. (Standard Worksheet interface only)
 – Use symbol completion.  Enter plusmn, and then press Esc. (Standard Worksheet interface 2-D input only)  For more information, see symbol completion.
 – Enter &+-.
 > with(Tolerances):
 > a := 2 &+- 0.1;
 ${a}{≔}{2.000}{±}{0.100}$ (1)
 > r := (Pi/2) &+- 0.2;
 ${r}{≔}{1.571}{±}{0.200}$ (2)
 Note: The plus/minus operator takes precedence over most operators, like ^ and *. As a result, parentheses are required around any non-atomic expression for a nominal value or a tolerance value. For more information, see operators/precedence. Computing with Tolerances

 • In addition to simple arithmetic, the following functions can be used with Tolerances:

 > with(Tolerances):
 > a := 2 &+- 0.1;
 ${a}{≔}{2.000}{±}{0.100}$ (3)
 > b := 3 &+- 0.05;
 ${b}{≔}{3.000}{±}{0.050}$ (4)
 > a+b;
 ${5.000}{±}{0.150}$ (5)
 > a*b;
 ${6.005}{±}{0.400}$ (6)
 > a^b;
 ${8.127}{±}{1.484}$ (7)
 > sin(a);
 ${0.905}{±}{0.042}$ (8)
 > exp(1/b);
 ${1.396}{±}{0.008}$ (9) Displaying Tolerances

 By default, the Tolerances package displays values with 3 digits even though computations are always performed at the precision indicated by the Digits variable.  Use interface(displayprecision) to control the number of displayed digits.
 > interface(displayprecision=10);
 ${-1}$ (10)
 > a := (1/3) &+- 0.1;
 ${a}{≔}{0.3333333332}{±}{0.1000000000}$ (11)
 > interface(displayprecision=3);
 ${10}$ (12)
 > a := (1/3) &+- 0.1;
 ${a}{≔}{0.333}{±}{0.100}$ (13) Nominal Value and Tolerance Value

 • The NominalValue command computes the nominal value of a quantity with a tolerance. The nominal value is the center of the confidence interval.
 • The ToleranceValue command computes the tolerance value of a quantity with a tolerance.  The tolerance is the width of the confidence interval divided by two.
 > a := 2 &+- 0.1;
 ${a}{≔}{2.000}{±}{0.100}$ (14)
 > b := 3 &+- 0.05;
 ${b}{≔}{3.000}{±}{0.050}$ (15)
 > a+b;
 ${5.000}{±}{0.150}$ (16)
 > NominalValue(a+b);
 ${5.000}$ (17)
 > ToleranceValue(a+b);
 ${0.150}$ (18) Tolerances and Units

 • Tolerances and Units can be used together in the same computation
 > with(Units):
 > a := 150 &+- 10 * Unit(m);
 ${a}{≔}{150.000}{±}{10.000}{}⟦{m}⟧$ (19)
 > b := 0.2 &+- 0.001 * Unit(km);
 ${b}{≔}{0.200}{±}{0.001}{}⟦{\mathrm{km}}⟧$ (20)
 > C := 2*a+2*b;
 ${C}{≔}{700.000}{±}{22.000}{}⟦{m}⟧$ (21)
 > A := a*b;
 ${A}{≔}{3.001}{×}{{10}}^{{4}}{±}{2.150}{×}{{10}}^{{3}}{}⟦{{m}}^{{2}}⟧$ (22)
 >