Introduction to the Tolerances Package - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Science and Engineering : Tolerances

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>Arrange Palettes. (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.00}{±}{0.100}$ (1)
 > r := (Pi/2) &+- 0.2;
 ${r}{≔}{1.57}{±}{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.00}{±}{0.100}$ (3)
 > b := 3 &+- 0.05;
 ${b}{≔}{3.00}{±}{0.0500}$ (4)
 > a+b;
 ${5.00}{±}{0.150}$ (5)
 > a*b;
 ${6.00}{±}{0.400}$ (6)
 > a^b;
 ${8.13}{±}{1.48}$ (7)
 > sin(a);
 ${0.905}{±}{0.0415}$ (8)
 > exp(1/b);
 ${1.40}{±}{0.00776}$ (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}{≔}\left({150.000}{±}{10.000}\right){}⟦{m}⟧$ (19)
 > b := 0.2 &+- 0.001 * Unit(km);
 ${b}{≔}\left({0.200}{±}{0.001}\right){}⟦{\mathrm{km}}⟧$ (20)
 > C := 2*a+2*b;
 ${C}{≔}\left({700.000}{±}{22.000}\right){}⟦{m}⟧$ (21)
 > A := a*b;
 ${A}{≔}\left({30000.000}{±}{2150.000}\right){}⟦{{m}}^{{2}}⟧$ (22)
 > 

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam