Romberg Integration MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Spring 019
Objectives and Background In this lesson we will learn to obtain high accuracy approximations to definite integrals using the Composite Trapezoidal Rule. b f (x) dx = h n 1 f (a) + f (x j ) + f (b) (b a)f (µ) 1 a where h = b a n j=1 and x j = a + jh for j = 0, 1,..., n. h
Objectives and Background In this lesson we will learn to obtain high accuracy approximations to definite integrals using the Composite Trapezoidal Rule. b f (x) dx = h n 1 f (a) + f (x j ) + f (b) (b a)f (µ) 1 a where h = b a n j=1 and x j = a + jh for j = 0, 1,..., n. We will use Richardson s Extrapolation to develop O(h m ) approximations to the definite integral. h
Alternative Truncation Error If f C [a, b] then we may write the truncation error of the Composite Trapezoidal Rule as b f (x) dx = h n 1 f (a) + f (x j ) + f (b) a where the coefficients K i are constants. j=1 + K 1 h + K h 4 + K 3 h 6 + The truncation error contains only even powers of h and we have seen Richardson s extrapolation be very effective in this situation. Extrapolation applied to this quadrature formula is called Romberg integration.
Outline Given b a f (x) dx, use the Composite Trapezoidal rule with n = 1,, 4, 8,..., k,... to form approximations labeled respectively R 1,1, R,1, R 3,1, R 4,1,... R k+1,1,... Since these are O(h ) approximations we can combine them using Richardson s extrapolation to form O(h 4 ) approximations.
Outline Given b a f (x) dx, use the Composite Trapezoidal rule with n = 1,, 4, 8,..., k,... to form approximations labeled respectively R 1,1, R,1, R 3,1, R 4,1,... R k+1,1,... Since these are O(h ) approximations we can combine them using Richardson s extrapolation to form O(h 4 ) approximations. For example, for k =, 3,.... R k, = R k,1 + 1 3 ( Rk,1 R k 1,1 ),
Test Case Throughout this presentation we will use the following definite integral to evaluate the performance of the various approximations. π 0 x cos 3x dx = 1 9 cos 3x + 1 3 x sin 3x π = 9 0. 0
Example (1 of 5) Approximate the definite integral using the Composite Trapezoidal Rule. k R k+1,1 Abs. Err. 0 4.9348 4.7158 1.4674.4518 0.361343 0.1391 3 0.49811 0.075889 4 0.8761 0.0063855
Example ( of 5) Now form the O(h 4 ) approximations using the formula Note that R k, = R k,1 + 1 3 ( Rk,1 R k 1,1 ) k R k+1,1 R k+1, Abs. Err. 0 4.9348 1.4674 1.64493 1.471 0.361343 0.340677 0.56899 3 0.49811 0.1634 0.00958818 4 0.8761 0.1744 0.0004784 R, = R,1 + 1 3 (R,1 R 1,1 ) =.4674 + 1 (.4674 ( 4.9348)) 3 = 1.64493
Example (3 of 5) Now form the O(h 6 ) approximations using the formula R k,3 = R k, + 1 15 ( Rk, R k 1, ) k R k+1,1 R k+1, R k+1,3 Abs. Err. 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 0.69573 3 0.49811 0.1634 0.4951 0.0799 4 0.8761 0.1744 0.351 0.00019087 Note that R 4,3 = R 4, + 1 15 (R 4, R 3, ) = 0.1634 + 1 ( 0.1634 0.340677) 15 = 0.4951
Example (4 of 5) Now form the O(h 8 ) approximations using the formula R k,4 = R k,3 + 1 63 ( Rk,3 R k 1,3 ) k R k+1,1 R k+1, R k+1,3 R k+1,4 Abs. Err. 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 3 0.49811 0.1634 0.4951 0.60991 0.0387686 4 0.8761 0.1744 0.351 0.19 0.00030185 Note that R 4,4 = R 4,3 + 1 63 (R 4,3 R 3,3 ) = 0.4951 + 1 ( 0.4951 0.473051) 63 = 0.60991
Example (5 of 5) Now form the O(h 10 ) approximations using the formula R k,5 = R k,4 + 1 ( ) Rk,4 R k 1,4 55 k R k+1,1 R k+1, R k+1,3 R k+1,4 R k+1,5 Abs. Err. 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 3 0.49811 0.1634 0.4951 0.60991 4 0.8761 0.1744 0.351 0.19 0.1767 0.000455403 Note that R 5,5 = R 5,4 + 1 55 (R 5,4 R 4,4 ) = 0.19 + 1 ( 0.19 ( 0.60991)) 55 = 0.1767
Remarks Since n increases by a factor of each time, R k+1,1 uses all the function evaluations of R k,1 and adds the function evaluations half-way between the previous nodes. The old function evaluations do not need to be re-computed, only the k new values must be computed.
Remarks Since n increases by a factor of each time, R k+1,1 uses all the function evaluations of R k,1 and adds the function evaluations half-way between the previous nodes. The old function evaluations do not need to be re-computed, only the k new values must be computed. We can express the Composite Trapezoidal rule in a recursive manner.
Recursion Define h k = b a, then k 1 R 1,1 = b a = h 1 [f (a) + f (b)] [f (a) + f (b)]
Recursion Define h k = b a, then k 1 R 1,1 = b a = h 1 R,1 = b a 4 [f (a) + f (b)] [f (a) + f (b)] [ f (a) + f (b) + f = h [f (a) + f (b) + f (a + h )] = 1 [R 1,1 + h 1 f (a + h )] ( a + b a )]
Recursion Define h k = b a, then k 1 R 1,1 = b a = h 1 R,1 = b a 4 [f (a) + f (b)] [f (a) + f (b)] [ f (a) + f (b) + f = h [f (a) + f (b) + f (a + h )] = 1 [R 1,1 + h 1 f (a + h )] ( a + b a )] R 3,1 = 1 {R,1 + h [f (a + h 3 ) + f (a + 3h 3 )]}. R k,1 = 1 k R k 1,1 + h k 1 f (a + (i 1)h k ) i=1
Romberg Table Once we have calculated R k,1 for k = 1,,..., n we use the extrapolation formula below to produce the O(h j k ) approximation. R k,j = R k,j 1 + for k = j, j + 1,.... 1 ( ) Rk,j 1 4 j 1 R k 1,j 1 1 k O(hk ) O(h4 k ) O(h6 k ) O(h8 k ) O(hn k ) 1 R 1,1 R,1 R, 3 R 3,1 R 3, R 3,3 4 R 4,1 R 4, R 4,3 R 4,4........ n R n,1 R n, R n,3 R n,4 R n,n
Romberg Table Once we have calculated R k,1 for k = 1,,..., n we use the extrapolation formula below to produce the O(h j k ) approximation. R k,j = R k,j 1 + for k = j, j + 1,.... 1 ( ) Rk,j 1 4 j 1 R k 1,j 1 1 k O(hk ) O(h4 k ) O(h6 k ) O(h8 k ) O(hn k ) 1 R 1,1 R,1 R, 3 R 3,1 R 3, R 3,3 4 R 4,1 R 4, R 4,3 R 4,4........ n R n,1 R n, R n,3 R n,4 R n,n Remark: calculate the table one row at a time.
Example Add another row to our previously calculated table. k R k+1,1 R k+1, R k+1,3 R k+1,4 R k+1,5 R k+1,6 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 3 0.49811 0.1634 0.4951 0.60991 4 0.8761 0.1744 0.351 0.19 0.1767
Example Add another row to our previously calculated table. k R k+1,1 R k+1, R k+1,3 R k+1,4 R k+1,5 R k+1,6 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 3 0.49811 0.1634 0.4951 0.60991 4 0.8761 0.1744 0.351 0.19 0.1767 5 0.3836 0.194 0.4 0. 0.3 0.3
Example Add another row to our previously calculated table. k R k+1,1 R k+1, R k+1,3 R k+1,4 R k+1,5 R k+1,6 0 4.9348 1.4674 1.64493 0.361343 0.340677 0.473051 3 0.49811 0.1634 0.4951 0.60991 4 0.8761 0.1744 0.351 0.19 0.1767 5 0.3836 0.194 0.4 0. 0.3 0.3 Remark: Romberg integration is efficient since only the entries in the R k,1 column are calculated by evaluating f (x). All others are found by weighted averaging.
Romberg Algorithm INPUT Endpoints a, b and integer n. STEP 1 Set h = b a; set R 1,1 = h (f (a) + f (b)). STEP OUTPUT R 1,1. STEP 3 For i =, 3,..., n do STEPS 4 8. STEP 4 Set R,1 = 1 i R 1,1 + h f (a + (k 0.5)h). STEP 5 For j =, 3,..., i set k=1 R,j = R,j 1 + R,j 1 R 1,j 1 4 j 1. 1 STEP 6 For j = 1,,..., i OUTPUT R,j. STEP 7 Set h = h. STEP 8 For j = 1,,..., i set R 1,j = R,j. STEP 9 STOP.
Homework Read Section 4.5. Exercises: 1ad, 3ad, 5ad, 18, 19