Propagation of Error
Propagation of Error
Peter J. Hansen
Department of Chemistry
Northwestern College
101 7th Street SW
Orange City, IA 51041
[email protected]
The Problem: Chemists often measure one or more variables, but then use these variables
to calculate a chemical or physical parameter. The reliability of the parameter will depend, of
course, upon the reliability of the measured variables. This raises a question, "How do you
compute the uncertainty in the parameter if you know the uncertainties in each of the
measured variables?" The answer to this question is the focus of what scientists refer to as,
"Propagation of Error."
Example: Given below are the dimensions of a rectangle, stated as confidence intervals.
Calculate the area of the rectangle and its uncertainty:
Question: The sum of the uncertainties in the height and width is clearly not equal to
the uncertainty in the area. Why is this obvious? Hint: consider their units.
Question: The product of the uncertainties in the height and width does have the correct
units, but it also is not equal to the uncertainty in the area. Why is this apparent from the
figure below? Hint: which rectangle in the figure corresponds to this product?
height uncertainty b
height = 3.47
Examination of this rectangle may suggest that the uncertainty in its area corresponds to
the sum of the areas of all of the colored rectangles. This sum, however, overestimates the
uncertainty in the rectangle's area since it fails to account for the likelihood that often the
errors in the width and height are opposite in sign and tend to cancel each other.
where, the epsilons (ε) can be either uncertainties or standard deviations, and δz /δx and
δz /δy are partial derivatives. (For functions of more than two independent variables,
additional terms are added on the right.)
Example (cont.): To apply Eq (1) to our rectangle problem, first change its notation to
that of the equation for area, then calculate partial derivatives, and finally substitute the
expression for each partial derivative into the modified Eq (1). Beyond this point, what
remains is arithmetic.
A h. w (equation for area)
2 2
2 δA 2 δA . 2
εA . ε
h
εw (change Eq (1) notation to A, h & w)
δh δw
δA δA
w and h (calculate partial derivatives)
δh δw
2 2 2 2 2
εA w . εh h . εw (substitute for partial derivatives)
2 2 2 2 2
εA ( 15.73 ) . ( 0.10 ) ( 3.47 ) . ( 0.15 ) (substitute numeric values)
2
εA 2.474 0.2709 (simplify)
Note, although the uncertainty in the width (εw = 0.15) is 50% greater than the uncertainty
in the height (εh = 0.10), the latter makes a much greater contribution to the uncertainty in
the area (εA ). Error propagation calculations help one distinguish between major and
minor sources of error.
2
εA 2.745 (combine terms)
By convention, the uncertainty in the final result is rounded to two significant digits and the
result itself is rounded to the same number of decimal places.
Calculating partial derivatives of complicated functions is not easy and this can make error
propagation calculations intimidating. The template below provides all steps in an
example error propagation calculation (on the left), but provides space for you to perform a
parallel calculation (on the right). If you need more space, insert it using [Ctrl] [F9]. This
example consists of calculating density from mass and volume.
Step #1. Define the function whose uncertainty you wish to compute. Be sure to list the
independent variables in parentheses on the left.
m
d( m , V )
V
Step #2. Change the notation of Eq (1) to that of your function. (The equal sign used here is
the [Ctrl] [=].)
2 2
2 δz 2 δz 2
εz . ε
x
. ε
y
δx δy
2 2
2 δd . ( εm ) 2 δd . ( εV ) 2
( εd )
δm δV
Step #3. Calculate partial derivatives. Enter the derivative symbol [Shift] [?] once for
each independent variable. Enter each independent variable into a denominator
placeholder, and Copy and Paste your function into the argument placeholders. Select
each expression, enter [Ctrl] [.] and hit [Enter].
d 1
d( m , V )
dm V
d m
d( m , V )
dV 2
V
2 2
2 δd . ( εm ) 2 δd . ( εV ) 2
( εd )
δm δV
2 2
2 1 . ( εm ) 2 m . ( εV ) 2
( εd )
V 2
V
This equation provides the relationship between the uncertainty (or standard deviation) in the
density and the uncertainties (or standard deviations) in both mass and volume; which is what
we wanted. What remains now is only arithmetic.
m 10.2943
εm 0.0010
V 10.000
εV 0.020
Step #6. Compute separately the value of each term on the right hand side of the equation
you derived in Step #4. This allows one to compare the relative contribution of each
independent variable to the total error. (Use Copy and Paste.)
2
1 . εm 2
term1
V
8
term1 = 1 10
2
m . εV2
term2
2
V
6
term2 = 4.239 10
Step #7. Compute the square root of the sum of the terms. (Use the backslash key \ to
obtain the square root function.)
εd term1 term2
3
εd = 2.061 10
d( m , V ) = 1.02943
Step #8. Round the uncertainty to two significant digits, and then round the result to as
many decimal places as the uncertainty. Use [Alt] [0177] (with Num Lock ON) from the
number keypad to produce the plus/minus sign (±).
Footnote: Often equations like the one derived in Step #4 mask the fundamental
relationship between the uncertainties. Sometimes a simpler expression can be derived by
dividing this equation by the square of the original function, i.e., z2 = f(x,y)2
2 2
2 1 . ( εm ) 2 m . ( εV ) 2
( εd )
V 2
V
2
2 m
d
V
2 2 2 2 2
( εd ) 1 . ( εm ) m . ( εV )
2 V 2 2 2
d m V m
V V
2 2 2 2 2
εd εm . V m . εV
2 2 2
d m .V
2 2 2
εd εm εV
d m V
This result indicates that the square of the relative error in density is equal to the sum
of the squares of the relative errors in mass and volume.
——————————————————————————————— —————————
Acknowledgment: PJH acknowledges the National Science Foundation for support of the 1997
NSF-UFE Workshop on "Numerical Methods in the Undergraduate Chemistry Curriculum Using
the Mathcad Software" and its organizers Jeff Madura, Andrzej Wierzbicki and Sidney Young,
Department of Chemistry, University of South Alabama, Mobile, AL 36688-0002.
————————————————————————————————————————