Topic 13.3: Romberg Integration (Examples)

Contents Previous Chapter Start of Chapter Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

Example 1

Integrate the function sin(x) on the interval [ab] = [0, &pi]. From calculus, you know that the answer is 2. Continue iterating until εstep < 1e-5.

Let h = b - a = π. Then

R0, 0 = T(h) = ½(sin(0) + sin(π))π = 0

Now, for i = 1, 2, ..., we calculate:

i = 1

R1,0 = T(π/2) = 1.5707963267948966192

i = 2

R2,0 = T(π/4) = 1.8961188979370399

i = 3

R3,0 = T(π/8) = 1.9742316019455508

i = 4

R4,0 = T(π/16) = 1.9935703437723393

Finally, |1.9999999945872902 - 2.0000055499796705| ≈ 0.00000556, and thus we may halt and our approximation of the integral is 1.9999999945872902 .

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.