~ Numerical Differentiation and Integration ~ Integration of Equations Chapter 22 Credit: Prof. Lale Yurttas, Chemical Eng., Texas A&M University Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Romberg Integration Successive application of the trapezoidal rule to attain efficient numerical integrals of functions. Richardson’s Extrapolation: In numerical analysis, Richardson extrapolation is a sequence acceleration method, used to improve the rate of convergence of a sequence. Here we use two estimates of an integral to compute a third and more accurate approximation. I I ( h) E ( h) h (b a) / n n (b a ) / h I (h1 ) E (h1 ) I (h2 ) E (h2 ) I = exact value of integral E(h) = the truncation error I(h): trapezoidal rule (n segments, step size h) ba 2 2 E h f O ( h ) 12 (assume f is constant for different step sizes) 2 1 2 2 E (h1 ) h E (h2 ) h I (h1 ) E (h2 )h1 / h2 2 h1 E (h1 ) E (h2 ) h2 2 I (h2 ) I (h1 ) I (h2 ) E (h2 ) E (h2 ) h1 / h2 2 1 I I ( h2 ) E ( h2 ) 1 I (h2 ) I (h1 ) I I ( h2 ) 2 h1 / h2 1 Improved estimate of the integral. It is shown that the error of this estimate is O(h4). Trapezoidal rule had an error estimate of O(h2). Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 I (h2 ) I (h1 ) I I (h2 ) 2 h1 / h2 1 If (h2 h1 / 2) I I (h2 ) 1 4 1 I ( h ) I ( h ) I ( h ) I (h1 ) 2 1 2 2 2 1 3 3 Example f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5 I (True Integral value) = 1.6405 Evaluate the integral of from a=0 to b=0.8. Segments h Integral εtr% Segments 1 & 2 combined to give : 4 1 (1.0688) (0.1728) 1.3675 3 3 E t 1.6405 1.3675 0.273 ( t 16.6%) 1 0.8 0.1728 89.5 2 0.4 1.0688 34.9 I Segments 2 & 4 combined to give : 4 0.2 1.4848 9.5 In each case, two estimates with error O(h2) are combined to give a third estimate with error O(h4) 4 1 (1.4848) (1.0688) 1.6234 3 3 E t 1.6405 1.6234 0.0171 ( t 1%) I Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3 In Example 22.1, we computed two improved estimates of O(h4). These two estimates can, in turn, be combined to yield an even better value with error O(h6). For the special case where the original trapezoidal estimates are based on successive halving of the step size, the equation used for O(h6) accuracy is: where Im and Il are more and less accurate estimates 16 1 I 15 Im 15 Il Similarly, two O(h6) estimates can be combined to compute an I that is O(h8). 64 1 I Im Il 63 63 4 Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Romberg Integration Algorithm I j ,k 4 k 1 I j 1,k 1 I j ,k 1 4 k 1 1 k=1 refers to trapezoidal rule, hence O(h2) accuracy. k=2 refers to O(h4) and k=3 O(h6) Index j is used to distinguish between the more (j+1) and the less (j) accurate estimates. 5 Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.