Error Propagation The analysis of uncertainties (errors) in measurements and calculations is essential in the physics laboratory. We will start with a review of differentials from calculus, introduce partial derivatives, and then derive the general equation for error propagation. Review From Calculus If y = f(x), and x changes from some initial value xo to a final value x1, then there is corresponding change in y from yo = f(xo) to y1 = f(x1). Thus, the increment ∆x = x1 – xo (1) produces a corresponding increment ∆y = y1 – yo = f(x1) - f(xo) (2) From equation (1) we have x1 = xo + ∆x and thus (2) can be written as ∆y = f(xo + ∆x) - f(xo) (3) We will drop the zero subscript on xo and use x to denote some initial position as well as the variable. Equation (3) now becomes ∆y = f(x + ∆x) - f(x) (4) 1 The derivative can now be defined in the following equivalent forms: dy ∆y = lim dx ∆x →0 ∆x dy f ( x + ∆x ) − f ( x ) = lim dx ∆x →0 ∆x ∆f ∆x →0 ∆x f ′( x) = lim Differentials dy is the symbol for the derivative. Up to now the symbols dy and dx, called dx differentials, have no meaning by themselves. However, we shall now define them so that they do have a meaning. The symbol Let’s suppose that x is fixed and define dx to be an independent variable than can be assigned any value. If f(x) is differentiable at x, we define by the formula dy = f ′( x)dx (5) If dx ≠ 0 , then we can divide both sides to obtain dy = f ′( x) dx (6) dy is equal to the slope of the tangent line to f(x) at x. Therefore, dy and dx dx correspond to the rise and run of this tangent line. But f ′( x) = In general, the increment ∆y and the differential dy are different. To see the difference let’s consider the case when dx = ∆x and look at the tangent line to y = f(x) at x. 2 a) ∆y is the change in y that occurs if we start at x and move along the curve until we have moved a distance ∆x. b) dy is the change in y that occurs if we start at x and move along the tangent line until we have moved a distance ∆x. Consider the function f(x) evaluated at the point xo. The figure below shows that for x close to xo, the tangent line to the curve at xo is a good approximation to the curve f(x). The tangent line goes through the point (xo, f(xo)) and has slope f ′( xo ) . Using the pointslope form of a line for the tangent line, y - yo = m(x – xo) or y = yo + m(x – xo) Since we are considering x close to xo, then the height y of this tangent line will closely approximate the height f(x) of the curve and then y ≈ f(x). Thus, f(x) ≈ f(xo) + f ′( xo ) ∆x (7) But ∆x = x - xo implies that x = ∆x + xo, thus f(xo+ ∆x) ≈ f(xo) + f ′( xo ) ∆x (8) This is called the linear approximation of f(x) near x when ∆x is small. 3 Example - Use equation (8) to approximate 9.1 f ( x) = x x = 9.1 xo = 9.0 ∆x = x − xo = 0.1 f (9.1) ≈ f (9.0) + f ′(9.0)(0.1) f (9.0) = 9.0 = 3 1 f ′( x) = 2 x 1 f ′(9) = = 0.167 2 9 f (9.1) ≈ 3.0167 This gives a 0.0026% error when comparing to the true value of 9.1 = 3.0166 . Going back to Eq. (8) and rearranging gives the following, f(xo+ ∆x) ≈ f(xo) + f ′( xo ) ∆x f ( xo + ∆x) − f ( xo ) ≈ f ′( x0 )∆x ∆y ≈ f ′( x0 )∆x If we drop the subscript on xo ∆y ≈ f ′( x)∆x (9) Now recall that, dy = f ′( x)dx (10) Now comparing Eq. (9) and Eq. (10) we see that if ∆x = dx, then ∆y = dy (11) Thus, if ∆x is relative “small” and we ensure that ∆x = dx, then to a very good approximation dy = f ′( x)dx 4 df can be written in the following form ∆y = ∆x . Using f instead of y : dx df ∆f = ∆x dx (12) This equation allows us to determine the error (uncertainty) in the function f associated with the error (uncertainty) ∆x in the physical measurement x. In this way we say that the error ∆x propagates to produce an error ∆f in the calculated value of f. We refer to this as propagation of error. Equation (12) is valid only for functions of one variable. Later we will generalize this equation to include functions of more than one variable. Example – A sphere has radius r = 50.00 cm ± 0.02 cm. Calculate the uncertainty in the volume. dV ∆V = ∆r dr 4 V = π r3 3 dV = 4π r 2 dr ( ) ∆V = 4π r 2 ∆r ∆V = 4π (50.00cm) 2 (0.02cm) ∆V = 600cm3 V = 5.236 × 105 ± 600 cm3 Partial Derivatives There are many formulas in which a function depends on two or more variables. For example, the volume of a box of lengths b, w, and h V = bwh Likewise, the function z = f(x,y) is a function of two independent variable x and y. As an example z = f(x,y) = x2 + 3xy is a function of the independent variable x and y. 5 Let f = f(x,y). If we hold y constant, then f(x,y) is a function of x alone. The derivative of ∂f f(x,y) with respect to x is denoted by and is called the partial derivative of f with ∂x respect to x. Likewise, we could have fixed x and taken the partial derivative of f with ∂f . Using the above function respect to y. This would be denoted by ∂y z = x2 + 3xy ∂z = 2x + 3y ∂x ∂z = 3x ∂y Example Let f = 4xyz + x2 +3yz3 ∂f = 4 yz + 2 x ∂x ∂f = 4 xz + 3z 3 ∂y ∂f = 4 xy + 9 yz 2 ∂z Propagation of Errors For a function of one variable we’ve shown that df ∆f = ∆x . dx Extending this equation to a function of 3 variables f = f(x,y,z) the result is ∂f ∂f ∂f ∆f = ∆x + ∆y + ∆z ∂x ∂z ∂y where the derivatives are partial derivatives. I have stated this result without proof but df the proof is similar to the derivation of ∆f = ∆x . dx Suppose you make a series of measurements determining sets of values for the variables x, y, and z with uncertainties σx, σy, and σz. We will now show how to calculate the uncertainty in f = f(x,y,z) produced by such uncertainties. 6 If the uncertainties of the measurements are random and independent (uncertainties must also be “small”), then after repeated measurements the measurements will be distributed (centered) about the mean. The distribution that results is called a Gaussian or Normal Distribution (bell-shaped curve) which is given by the following formula: ( x − x )2 − 1 2 f ( x) = e 2σ σ 2π σ = standard deviation x = mean The following are graphs of the Normal Distribution equation with different values of the standard deviation σ. This function has very important properties in probability and statistics. For our purpose we will focus on the representation of the quantity σ which is called the standard deviation. The standard deviation is defined by the following statistical expression n σ= ∑(X i =1 i − X )2 n Some of the properties of the standard deviation are the following: 1. 2. 3. 4. Measure of the average deviation from the mean. Measure of the dispersion of a set of data from the mean. 68% of data falls within one standard deviation. 68% probability that a measurement falls within one standard deviation. 7 5. Small σ corresponds to a sharp Gaussian Distribution and a large σ corresponds to a broad distribution. The standard deviation σ can also be written as σ= ∑ ( ∆x ) 2 n where ∆x = xi − x is the deviation of a single measurement from the mean. We shall now define the standard deviation σ to be equal to the uncertainty of a single measurement. The uncertainty in the function f = f(x,y,z) is given by σf = ∑ ( ∆f ) 2 n (13) where ∆f is given by ∂f ∂f ∂f ∆f = ∆x + ∆y + ∆z ∂x ∂z ∂y (14) Substituting Eq. (14) into Eq. (13) gives 8 σ 2f = ∑ ( ∆f ) n ∂f 1 ∂f ∂f σ = ∑ ∆x + ∆y + ∆z n ∂x ∂z ∂y 2 2 f σ 2f = ∂f ∂f 1 ∂f ∂f ∂f ∂f ∆x + ∆y + ∆z ∆x + ∆y + ∆z ∑ n ∂x ∂z ∂x ∂z ∂y ∂y 2 2 ∂f 2 ∂f ∂f 2 2 2 ∂f ∂f ∂f ∂f ( ∆x ) + ( ∆y ) + ( ∆z ) + 2 ∆x∆y + 2 ∆x∆z + 1 ∂x ∂z ∂x ∂y ∂x ∂z ∂y σ 2f = ∑ n ∂f ∂f 2 ∆y∆z ∂y ∂z ∂f ( ∆y ) ∂f ( ∆z ) ∂f ∂f 1 ∑ n + ∂y ∑ n + ∂z ∑ n + 2 ∂x ∂y n ∑ ∆x∆y ∂f ∂f 1 ∂f ∂f 1 +2 ∑ ∆x∆z + 2 ∑ ∆y∆z ∂x ∂z n ∂y ∂z n ∂f σ = ∂x 2 f 2 ( ∆x ) 2 2 2 2 2 Since the uncertainties in the measurement x, y, and z are random and independent, then Σ∆x∆y = 0 Σ∆x∆z = 0 Σ∆y∆z = 0 Therefore, 2 2 2 ∂f ∂f ∂f σ = σ x2 + σ y2 + σ z2 ∂x ∂z ∂y 2 f 2 2 2 ∂f ∂f ∂f σ f = σ x2 + σ y2 + σ z2 ∂x ∂z ∂y General Error Propagation Equation Example f=x +y 9 ∂f =1 ∂x ∂f =1 ∂y σ f = σ x2 + σ y2 Example f = xy ∂f =y ∂x ∂f =x ∂y σ f = y 2σ x2 + x 2σ y2 σf xy = 2 2 y 2σ x2 x σ y + x2 y 2 x2 y 2 σ σ σ f = f x + y x y 2 Example 2 Calculate the value of z and the uncertainty if z = wx + y w = 4.52 ± 0.02 cm x = 2.0 ± 0.2 cm y = 3.0 ± 0.6 cm 2 10 z = zbest ± σ z 2 2 2 ∂z ∂z ∂z σ z = σ x2 + σ y2 + σ w2 ∂x ∂w ∂y ∂z = w = 4.52cm ∂x ∂z = 2 y = 6.0cm ∂y ∂z = x = 2.0cm ∂w σ z = (4.52cm) 2 (0.2cm) 2 + (6.0cm) 2 (0.6cm) 2 + (2.0cm) 2 (0.02cm) 2 σ z = 3.7cm 2 ≈ 4cm 2 2 zbest = wbest xbest + ybest zbest = (4.52cm)(2.0cm) + (3.0cm) 2 = 18.0400cm 2 ≈ 18cm 2 zbest = 18 ± 4cm 2 11