Chapter Three Error Propagation in Calculations 3.1 Absolute and Relative Errors When an uncertainty or an error estimate is expressed in the same units as the measured quantity it is called an absolute uncertainty or error . For example, in = 5.13 ± 0.05 m, the uncertainty is expressed in absolute units. The relative error is simply the ratio of absolute error to the measured quantity. In the above above exa examp mple le,, the rel relat ativ ivee error error is is 0.05 0.05 m 5.13 5.13 m = 0.01 0.01. Note that relative errors have no units. They are often stated as percentages, e.g. ( 0.05 m 5.13 m) × 100 % =1 % . When quoting the results of an experiment, it is normal to express the associated uncertainties in absolute units. Use the following example as a guide for quoting results in scientific notation: F G = (7.624 ± 0.003) × 10 4 N.
3.2
Maximum Possible Errors
The rules used to propagate the errors through the calculations depend, in part, on the nature of calculation being done — whether the numbers with errors are added, subtracted, multi plied, divided, or raised to some power. The simplest approach in error analysis is to consider the possible error in a calculated result, i.e., we use the uncertainties to estimate the maximum range possible in the result. 3.2.1 Addition and Subtraction
Suppose the calculation involves addition, where the measured quantities with their associated estimates of uncertainty are x ± δ x and y ± δ y , and we want to determine the error in the result f = x + y . The two extreme values for f for f are given by Max ( f ) = ( x + y ) + ( δ x + δ y ) and
Min( f ) = ( x + y ) − ( δ x + δ y ) .
So the possible error in the sum is
δ f = δx + δ y .
(3.1)
A similar analysis applied to subtraction gives exactly the same result. The absolute uncertainties δ x and δ y are expressed in terms of the measured units, as is the error δ f in the result.
The basic rule for the propagation of errors in addition or subtraction is that the absolute error in the result is the sum of the absolute uncertainties of the uantities used in the calculation.
9
Physics Laboratory Companion 3.2.2
Error Propagation
Multiplication by a Constant Coefficient
Suppose the calculation is of the form f = ax + y , in which a is a given constant. Since multiplication by a is the same as adding x to itself a times, the possible error in f is given by
δ = aδ x + δ y
(3.2)
More generally, if the calculation is of the form f = ax + by − cz , in which a, b, and c are constants, then the possible error in f is given by
δ f = aδx + bδ y + cδ z .
(3.3)
The basic rule when multiplication by a constant is involved is that the absolute error in the result is the product of the constant and the absolute uncertainty in the quantity.
3.2.3 Multiplication and Division
Consider the product of two measured quantities, f ± δ f = (x ± δ x )× ( y ± δ y ) . To arrive at an expression for δ f , consider the maximum and minimum values of f that can be obtained: Max ( f ) = ( x + δ x ) × ( y + δ y ) = xy + xδy + yδx + δx δ y and
Min( f ) = ( x − δ x ) × ( y − δ y ) = xy − xδ y − yδx + δx δ y .
Since uncertainties are normally a small fraction of the measured quantity, the term δ x δ y is much, much smaller than the other terms in these equations so, to a very good approximation, the absolute error in f is given by δ f = xδ y + yδ x . A more convenient and revealing equation for propagating the errors through multiplication can be arrived at by dividing both sides of the equation by f itself. As the next few lines of algebra will show, doing this results in the fractional error, more commonly referred to as the relative error in the product. We get xδ y yδ x xδ y δ f yδ = + = + x , f f f xy xy or
δ f f
=
δ y y
+
δ x x
.
(3.4)
Equation (3.4) shows that the relative error in the result is just the sum of the relative errors in the measured quantities.
10
Physics Laboratory Companion
Error Propagation
The derivation of the rule for division is a little more complex but, as you will see, it leads to the same result. Consider the quotient f ± δ f = (x ± δ x ) ÷ ( y ± δ y ) . The maximum and minimum values that can be obtained are Max( f ) = ( f + δ f ) = ( x + δ x ) ÷ ( y − δ y ) and
Min( f ) = ( f − δ f ) = ( x − δ x ) ÷ ( y + δ y ) .
These two equations can be rewritten for the quantity x instead of f as
and
( + δ x ) = ( f + δ f )( y − δy ) = ( − δ x ) = ( f − δ f )( y + δy ) =
fy − f δy + yδ f = x − f δy + y δ f fy + f δy − yδ f = x + f δy − y δ f
where the terms in δ f δ y have been neglected in both equations. From either one of them, it’s possible to deduce that δ x = yδ f − f δ y , which can be rearranged to give
δ f = δ f
or
f
δ x y
=
+ f
δ x x
+
δ y y
δ y y
.
(3.5)
A comparison between equations (3.4) and (3.5) shows that the result for division is exactly the same as for multiplication. In the more general case, where the calculation is of the form f = ax × by ÷ cz , the relative error in f is given by δ f f
=
δ x x
+
δ y y
+
δ z z
.
(3.6)
The basic rule for the propagation of errors in multiplication or division is that the relative error in the product or quotient is the sum of the relative uncertainties in the quantities used in the calculation.
3.2.4 Powers
Raising a quantity to some power is the same as multiplying the quantity by itself as many times as the power. Consequently, if y = x n then the relative error in y is just n-times the relative uncertainty in x. For example, the area of a circle is given by A = π r 2 , so the relative δ δ error in the area is given by A = 2 r . (There is no uncertainty in π .) A r
11
Physics Laboratory Companion
Error Propagation
3.2.5 Trigonometric Functions
It is more complicated to derive the expressions for the error in calculations involving trigonometric functions. The technique using trigonometric identities outlined in this section works easily for sines and cosines, but a more general and elegant method suitable for any trigonometric, exponential, or logarithmic function is presented in §3.6 on differential error analysis. Consider as an example y ± δ y = sin ( x ± δ x ) . The right hand side can be expanded using the trigonometric identity for the sine of the sum of two angles: sin( x ± δ x ) = sin x cos δ x ± cos x sin δ x . Normally the uncertainty δ x is very small, so cos δ x ≅ 1 . Moreover, when a small angle is ex pressed in radians the sine of the angle is approximately equal to the angle itself, i.e., sinδ x ≅ δ x . Substitution of these two facts into the expansion gives sin( x ± δ x ) = sin x ± δ x cos x , from which we can deduce that the absolute error is δ y = δ x cos , and that the relative error is
δ y y
=
δ x cos x sin x
= δ x cot x .
However, if the uncertainty δ x is expressed in degrees of arc then the absolute error in δ y is given by δ y = 0.0175 × δ x cos , where 0.0175 is the number of radians in one degree. The derivation for the error in the cosine follows the same approach as that for the sine; those for the error in the tangent and cotangent are rather more complicated. Rather than show them here, the results are listed in Table 3.2. Table 3.1 Errors in Trigonometric Functions
Function sine
12
Absolute Error (radians) ±δ x cos x
Relative Error (radians) ±δ x cot x
cosine
∓δ x sin
∓δ x tan
tangent
±δ x sec2 x
±δ x sec csc x
cotangent
∓δ x csc
2
∓δ x sec x csc x
Physics Laboratory Companion
Error Propagation
3.3 Examples Involving Maximum Possible Errors 3.3.1 Simple Addition and Subtraction
Calculate the sum of two masses, m1 = 41.63 ± 0.02 kg and m2 = 2.13 ± 0.03 kg . mT = 41.63 kg + 2.13 kg
= 43.76 kg and the maximum possible error associated with mT is
δT = δ1 + δ 2 = 0.02 kg + 0.03 kg
= 0.05 kg
.
If, instead, we wanted to know the difference between the two masses, m1 − m2 = 39.50 kg , the error would still be 0.05 kg. 3.3.2 Multiplication by a Constant
Consider the total mass of a system, given by mT = m1 + 3m 2 . The error in mT is then
δT = δ1 + 3δ 2 . If m1 = 41.63 ± 0.02 kg and m2 = 2.13 ± 0.03 kg , then mT = 41.63 kg + (3 × 2.13 kg) = 48.02 kg ,
δ T = 0.02 kg + (3× 0.03 kg) = 0.11 kg, , and the result would be expressed as mT = 48.02 ± 0.11 kg. If the calculation had involved subtraction, mT = m1 − 3m2 then the result would have been mT = 35.24 ± 0.11 kg . 3.3.3 Simple Multiplication and Division Multiplication
A car travels at a speed υ = 100 ± 5 km /h
for t = 3.2 ± 0.1 hours. The distance traveled by the car is given by d = υ × t = 100 km/h × 3.2 h
= 320 km. The relative error in the distance is δ d d
=
5 100
+
0.1 3.2
= 0.05 + 0.03 = 0.08 .
Division
If, instead, the car travels 100 ± 5 km in 3.2 ± 0.1 hours, the average speed is
υ = 100 km 3.2 h = 31 km /h . The relative error in the calculated result is 0.08, the same as in the first example. However, the absolute error is quite different: δ υ = 0.08× 31 km/h = 2.5 km/h.
In percentage terms, this amounts to 8%, while absolute error is
δ d = 0.08 × 320 km = 26 km.
13
Physics Laboratory Companion 3.3.4
Error Propagation
Compound Calculations
More often than not, the equations that you use in the analysis of an experiment are more complicated, involving combinations of addition, subtraction, multiplication, division, etc. The following examples are typical of the kinds of error calculations you may encounter in the first year physics labs, and they illustrate the strategies one should employ in error calculations in general. Example 1: Suppose the equation is d = υ0 t + at , and you know from experiment that 2
d = 75 ± 1 cm , υ0 = 28 ± 1 cm/s , and t = 9.5 ± 0.5 s . The quantity required from the calculation is the acceleration, so the equation can be rearranged to give either a = ( d − υ0 t ) t 2 or a = d t 2 − υ0 t . Either one of these forms will give the same answer for a, but only the second form is appropriate for working out the error calculation. An important feature to notice about the second form is that each term has been rationalized, so that no variable appears both in the numerator and the denominator of that particular term. This is important to do because otherwise the error estimate would be inflated artificially. (For example, 1 t = t t 2 = t 2 t3 = … : the result of each quotient is the same, and the error estimate in 1 t should be exactly the same as for t t 2 , etc.) So, proceed with the error calculation using a = d t 2 − υ0 t as the basic equation. 1. Evaluate the first term: d t 2 = 0.831 cm/s2 2. The relative uncertainty in the first term is
δd d
+2
δ t t
=
1 75
+
2 × 0.5 9.5
= 0.119 .
3. The absolute uncertainty in the first term is 0.119 × 0.831 cm/s2 = 0.0986 cm/s2 . 4. Evaluate the second term: −
υ0 t
= −2.947 cm/s2 .
5. The relative uncertainty in the second term is
δ υ0 υ0
+
δ t t
=
1 28
+
0.5 9.5
= 0.0883
6. The absolute uncertainty in the second term is 0.0883 × 2.947 = 0.2604 . (Ignore the sign because we only want the magnitude of the error.) 7. Evaluate the result: a = ( 0.831 − 2.947) cm/s2 = − 2.116 cm/s2 8. The absolute uncertainty in the result is ( 0.0986 + 0.2604) cm/s2 = 0.3590 cm/s2 You can use the uncertainty estimate to determine the number of significant digits to retain for the answer. With reference to the guidelines given in §1.3, a = − 2.12 ± 0.36 m/s2 would be acceptable, but a = − 2.1 ± 0.4 m/s2 would be better.
14
Physics Laboratory Companion
Error Propagation
Sometimes an elegant and easy-to-use error equation can be derived from the equation used to calculate the result. If you can see a way to do this, you should. The previous example doesn’t really lend itself to this approach, but it can be used to illustrate the technique. 1. Let A = d t 2 and B = υ0 t . 2. Then δ A =
=
d δd
t2 d
+2
δ t
and δ B =
t
δ t 1 2 d δ + d t2 t
=
υ0 δ υ0
δ + t t υ0 t
1 t 2
(t δ
υ0
+ υ0δ t )
3. Since a = A + B ,
δa = δ A + δ B
=
1
d + υ0 δ t + t δ υ t
δd + 2
t2
0
4. Now plug in all the values and do the arithmetic!
δ a =
2 × 75 cm 1 cm + 9.5 s + 28 cm/s ( 0.5 s) + ( 9.5 s)(1 cm/s) ( 9.5 s ) 1
2
= 0.36 cm/s2 1
=
1
+
1
can be solved for z as z =
y
, but this form wouldn’t be appropriate z x y + y for the error calculation, since both x and y appear in both the numerator and the denominator. The uncertainty in each term of the first form of the equation is the same, since they are all reciprocals. Simply apply the rule for calculating the error in a power, i.e., r x = 1 x = x −1 , and ignore Example 2:
the negative sign since only the magnitude of the error is important. 1. The relative error in r x is δ r x r x = δ x x , equal to the relative error in x. 2. Do the same for r y . 2 3. The absolute error in r x is δr x = δ x x .
4. Do the same for r y . 5. Calculate the absolute error in r z , δr z = δr x + δ r y .
δ x
6. Calculate the absolute error in z , δ z = z 2 ⋅ δ r z , or δ z = z 2
2 x
+
δ y
.
y2
The significant result of this example is that the absolute error in the reciprocal is just the absolute error in the quantity itself divided by the square of the quantity, as given in step 3. 15
Physics Laboratory Companion
Error Propagation
An equation that you might encounter in an experiment to determine the specific cw mw∆T g heat of a substance is c s = , in which cw is a known constant and all the other m s ∆Tl − mc∆Tg Example 3:
quantities on the RHS of the equation are measured. Obviously, in this form the equation cannot be used to work out the error because ∆T g appears in both the numerator and the denominator. Instead, rewrite the equation as c s = D = m s ( ∆Tl
∆Tg
cw mw m s ( ∆Tl
∆Tg
)−m
and proceed from here. Start with
c
) − m and work out the relative error δ c
D
D . Then
δc s c s
=
δ mw mw
+
δ D D
, etc.
3.4 Probable Errors The most elementary methods for propagating errors through calculations were presented in §3.1, where rules for computing the maximum possible error were deduced. Such computations tend to inflate the error estimates because they assume that the measurement of each quantity is correlated with every other one involved in the computation — a “worst case” scenario. However, it is often more reasonable to treat the measurement of the different quantities as being completely independent (like orthogonal vectors), and under such an assumption we compute the probable error in a quantity by adding the uncertainties in quadrature. 3.4.1 Addition and Subtraction
The rule for both is that the absolute errors are added in quadrature, weighted by the square of their coefficients. Consider the case where the calculation is of the form
f ( x, y, z) = ax + by + cz ,
(3.7)
where the measured quantities with their associated uncertainties are x ± δ x , y ± δ y , and z ± δ z . The probable error is given by
δ f = a2δx2 + b2δ y2 + c 2δ z 2 .
(3.8)
Equation (3.8) also applies when the calculation involves subtraction. 3.4.2 Multiplication and Division
The rule for both is that the relative errors are added in quadrature. Consider the case where the calculation is of the form
f ( x , y , z ) = ax × by ÷ cz .
(3.9)
Regardless of whether multiplication or division are involved, the relative error in f is given by
δ f f
16
2
=
2
2
δ x δ y δ z x + y + z .
(3.10)
Physics Laboratory Companion
Error Propagation
3.4.3 Powers
When a quantity is raised to some power, the error in the result is found by multiplying the relative (or percent) error in the quantity by the power. This is the same rule that was presented in §3.2.4 in the context of maximum possible error calculations. It may seem to contradict the rule for propagating probable errors through multiplication, but the reasoning applied here is slightly different. When we compute the probable error in a product of independently measured quantities, we assume that the uncertainties are not correlated. This isn’t the case when a quantity is raised to a power. For example, in f = x3 = x ⋅ x ⋅ x , each occurrence of x simultaneously has the same error. If the value of x increases in one term, it does so in all three terms.
3.5 Example Calculations Involving Probable Error 3.5.1 Addition and Subtraction
Consider the total mass of a system, given by mT = m1 + 3m 2 . The error in mT is then
δT = δ 12 + 9δ 22 . If m1 = 41.63 ± 0.02 kg and m 2 = 2.13 ± 0.03 kg , then δ T = (0.02 kg)2 + 9(0.03 kg)2 = 0.09 kg, an the result would be expressed as mT = 43.76 ± 0.09 kg. If the calculation had involved subtraction, i.e. mT = m1 − 3m 2 , then the result would have been mT = 39.50 ± 0.09 kg . 3.5.2 Multiplication and Division Multiplication
Division
Consider a car travelling at a speed υ = 100 ± 5 km /h for t = 3.2 ± 0.1 hours. The distance traveled by the car is given by
Calculate the speed of a vehicle that travels 100 ± 5 km in 3.2 ± 0.1 hours. The speed of the vehicle is given by
d = υ × t
υ = d ÷ t
= 100 km/h ×3.2 h = 320 km. The relative error in the calculated distance is 2
2
5 0.1 = + 3.2 = 0.06 . d 100
δ d
In percentage terms, the uncertainty in the distance traveled is 6%. The absolute error in the distance traveled is
= 100 km 3.2 h = 31 km/h . The relative error in the result is 0.06, exactly the same as in the example for multi plication because the calculation involves exactly the same numbers in exactly the same way. However, the absolute error is quite different:
δ υ = 0.06× 31 km/h = 2 km/h.
δ d = 0.06 × 320 km = 19 km.
17
Physics Laboratory Companion
Error Propagation
3.5.3 Powers
In y = x 2 , x = 5.1 ± 0.1 m = 5.1 m ± 2% . Then y = 26 m 2 ± 4% , or y = 26 ± 1 m2 . However the calculation of errors involving powers can be a little tricky when the equation through which the errors are being propagated is a bit more complex. For example, consider an equation of the form z = x 2 + y 3 . The absolute error in the first term is just 2 xδ x and 3 y 2δ y in the second term. These two terms are then added in quadrature to give 2
( 2 xδx ) + ( 3 y 2 δ y )
δ z =
2
.
3.6 Differential Error Analysis The basic rules for determining the uncertainty in a computed quantity when the computation involves addition, subtraction, multiplication, or division are relatively easy to apply. It’s also quite easy to derive expressions for the uncertainties propagated through the calculation of trigonometric functions simply by using the identities for the sums and differences of angles. But there are situations where the computations are more complex, so we need a more general way of deriving expressions for the propagation of experimental errors. The methods of differential calculus provide some insight as to what is needed. For example, consider the Taylor expansion of the function f ( x ± δ x ) : f ( x ± δ x ) = f ( x) ± δ x f ′( x) +
(δ x ) 2 2!
f ′′( x) ±
(δ x ) 3 3!
f ′′′( x) + …
(3.11)
The first term on the RHS of equation (3.11) is just the function itself, evaluated at the point x, so all of the remaining terms taken together give the expression for the uncertainty in the function δ f . That is,
δ f = ±δ x f ′( x) +
(δ x ) 2 2!
f ′′( x) ±
(δ x ) 3 3!
f ′′′( x) + …
(3.12)
When the uncertainties are much smaller than the measured quantities themselves (something that we always try to achieve in designing an experiment) then only the linear term on the RHS of equation (3.12) contributes significantly to the uncertainty calculation. So, to a first order ap proximation, the uncertainty in the function f is given by
δ f = ± δ x f ′( x)
(3.13)
The technique of differential error analysis is generalized for the computation of probable errors in the following way. For a function of several variables, f ( a, b, c,…) , the uncertainties in each measured quantity ( a, b, c, …) propagate in quadrature as follows: 2
2
2
∂ f ∂f ∂f 2 2 (δ f ) = ( ) ( ) ( δc ) 2 + … δ δ + + a b ∂a ∂b ∂c 2
18
(3.14)
Physics Laboratory Companion Example 1:
Error Propagation
An object experiencing a constant acceleration a, travels a distance d =
the time t . Simple differentiation gives ∂d ∂a = (3.14) and doing a little algebra we get
1
2
1
2
at 2 in
t 2 and ∂d ∂t = at . After applying equation
2
2
δ 2δ = a + t . d a t
δd
Note that the error in t 2 propagates the same way as presented earlier in the discussion of powers. If the acceleration were a known constant with no error, then δ d d = 2 δ t t . The focal length of a thin lens, expressed in terms of the image and object distances, is given by1 f = 1 a + 1 b . It’s relatively easy to show, after differentiation and a little algebra, that Example 2:
2
2
δa δ b = a 2 + b2 f 2 δ f
The tension in a cord wrapped around a cylinder can be expressed as T = T 0 exp(− µθ ) , where θ is the angle of contact. Differentiation with respect to θ gives
Example 3:
dT = − µ T 0 exp ( − µθ ) d θ . In this case, the (somewhat) surprising result is δ T T = µδ θ ; that is, the relative error in the tension is proportional to the absolute error in the angle of contact. Example 4:
The index of refraction of an equilateral prism is given by
= sin ( A+2 D ) sin( A2 ) ,
where A is the apex angle, and D is the angle of minimum deviation. It’s quite easy to show that 1 ∂µ
A + D A δ A cot = cot − , µ ∂ A 2 2 2 1 ∂µ
A + D δ D = cot 2 . 2 µ ∂ D
and that
When these are put together in the form suggested by equation (3.14), the result is
δ µ µ
=
1 2
2
2
A + D A + D A 2 2 cot cot ( ) − δ + 2 A 2 cot 2 (δ D ) .
19
Physics Laboratory Companion
20
Error Propagation