Introduction to the Tolerances Package
Calling Sequence
Description
Usage
Entering Tolerances
Computing with Tolerances
Displaying Tolerances
Nominal Value and Tolerance Value
Tolerances and Units
with(Tolerances)
The Tolerances package provides an environment to perform computations with quantities involving tolerances.
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.
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
r := (Pi/2) &+- 0.2;
r≔1.571±0.200
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.
In addition to simple arithmetic, the following functions can be used with Tolerances:
sin
cos
tan
cot
csc
sec
arcsin
arccos
arctan
arccot
arccsc
arcsec
sinh
cosh
coth
tanh
csch
sech
arcsinh
arccosh
arccoth
arctanh
arccsch
arcsech
abs
sqrt
exp
ln
Ei
FresnelC
FresnelS
GAMMA
Psi
LambertW
Zeta
dilog
erf
erfc
b := 3 &+- 0.05;
b≔3.000±0.050
a+b;
5.000±0.150
a*b;
6.005±0.400
a^b;
8.127±1.484
sin(a);
0.905±0.042
exp(1/b);
1.396±0.008
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
a := (1/3) &+- 0.1;
a≔0.3333333332±0.1000000000
interface(displayprecision=3);
10
a≔0.333±0.100
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.
NominalValue(a+b);
5.000
ToleranceValue(a+b);
0.150
Tolerances and Units can be used together in the same computation
with(Units):
a := 150 &+- 10 * Unit(m);
a≔150.000±10.000⁢m
b := 0.2 &+- 0.001 * Unit(km);
b≔0.200±0.001⁢km
C := 2*a+2*b;
C≔700.000±22.000⁢m
A := a*b;
A≔3.001×104±2.150×103⁢m2
See Also
evalr
operators/precedence
ScientificErrorAnalysis
Units
Download Help Document