Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Integration Romberg Extrapolation. Acceleration The term acceleration is a term sometimes used in numerical analysis that refers to how you.

Similar presentations


Presentation on theme: "Numerical Integration Romberg Extrapolation. Acceleration The term acceleration is a term sometimes used in numerical analysis that refers to how you."— Presentation transcript:

1 Numerical Integration Romberg Extrapolation

2 Acceleration The term acceleration is a term sometimes used in numerical analysis that refers to how you can improve the results of an iterative algorithm by applying another algorithm to it. In the example we use here we can show how we can use the results of the trapezoid method to improve (give a more accurate estimate of the integral) how quickly it arrives at the answer in terms of the number of calculations that need to be performed. The example of acceleration I will show you is called an extrapolation method (specific case of Richardson extrapolation). Define a sequence of values A i where: A 0 = Trapezoid method with 2 0 =1 partition (i.e. ½( b-a )( f(a)+f(b) ) A 1 = Trapezoid method with 2 1 =2 partitions A 2 = Trapezoid method with 2 2 =4 partitions A 3 = Trapezoid method with 2 3 =8 partitions Each A i calculation is considered an iteration.

3 Extrapolation Methods In the first chapter we discussed acceleration techniques. An acceleration technique changed how you were calculating something to get an improved calculation method that was shorter and more accurate. An extrapolation method is a technique for getting a more accuracy from two previous step sizes. Romberg Integration Romberg Integration is an extrapolation of two results of the trapezoid method applied to a regular partition cut into subintervals of sizes that are consecutive powers of 2. We discussed this exact method when we talked about acceleration in the beginning of the course.

4 The values for Romberg’s Method of integration can be arranged in a triangular matrix. 012345 0 A0A0 1 A1A1 B1B1 2 A2A2 B2B2 C1C1 3 A3A3 B3B3 C2C2 D1D1 4 A4A4 B4B4 C3C3 D2D2 E1E1 5 A5A5 B5B5 C4C4 D3D3 E2E2 F1F1 Since we will run out of letters after 26 rows we express this with R(i,j). 012345 0 R(0,0) 1 R(1,0)R(1,1) 2 R(2,0)R(2,1)R(2,2) 3 R(3,0)R(3,1)R(3,2)R(3,3) 4 R(4,0)R(4,1)R(4,2)R(4,3)R(4,4) 5 R(5,0)R(5,1)R(5,2)R(5,3)R(5,4)R(5,5) The best possible estimate in each row is the right most entry: R(i,i) The best possible estimate in each row is the right most entry: A 0,B 1,C 1,D 1,E 1,F 1

5 The R(i,j) can be obtained in the following way: R(i,0) is always the trapeziod method applied with a partition size of 2 i. For the rest of them a triangular pattern exists as how you fill in the other entries. 012345 0 R(0,0) 1 R(1,0)R(1,1) 2 R(2,0)R(2,1)R(2,2) 3 R(3,0)R(3,1)R(3,2)R(3,3) 4 R(4,0)R(4,1)R(4,2)R(4,3)R(4,4) 5 R(5,0)R(5,1)R(5,2)R(5,3)R(5,4)R(5,5)

6 Example: Apply Romberg Extrapolation to the data to the right to get the best possible estimate for: ixixi y i =f(x i ) 000 1½1 214 33/29 4216 j-1j i-1R(i-1,j-1) iR(i,j-1)R(i,j) The pattern that exists for the Romberg Entries is as follows: Note: This only applies for i >0 and j >0.

7 Algorithm for Romberg Integration Method function intf ( a, b, n ) deltax = ( b - a )/ n xi = a + deltax intsum = f(a)+f(b) for( i =1, i  n, i ++, intsum = intsum + 2 f(xi) xi = xi + deltax ) intf = (1/2)* deltax * intsum prevvals = {(1/2)( b - a )( f(a)+f(b) )} for( i = 1, i  number of requested rows, i ++, nextvals = { intf ( a, b,2^ i )} for( j = 1, j  i, j ++ nextvals = Append[ nextvals,(4^ j * nextvals j – prevvals j )/(4^ j -1)]) Print[ nextvals ] prevvals = nextvals ) In this implementation of the Romberg Method of Integration the stopping condition is given by the number of rows of the triangular array you want to compute. This could use the standard Cauchy Error by taking as your sequence the last entry in the last row.

8 Example Estimate the integral to the right with 3 rows of the Romberg Method of integration. Building the triangular matrix:


Download ppt "Numerical Integration Romberg Extrapolation. Acceleration The term acceleration is a term sometimes used in numerical analysis that refers to how you."

Similar presentations


Ads by Google