Example
1 Investigate Romberg integration for
approximating the integral
.
Use the tolerances
. Compare
with the analytic or "true value" of the integral.
Solution 1.
1 (a). Plot the function over the interval [0, 1.25].
![[Graphics:../Images/RombergMod_gr_27.gif]](../Images/RombergMod_gr_27.gif)
![[Graphics:../Images/RombergMod_gr_28.gif]](../Images/RombergMod_gr_28.gif)
1 (b). Construct the Romberg
table using tol = 0.001
What do the entries in the first column mean ?
What do the entries in the second column mean ?
Which entries in the table are used to determine if Romberg
integration is converging ?
1 (c). The last entry in the
table is
. Let's
find it.
(This is possible
because j is a global variable in the
subroutine.)
1 (d). Look at 10 digits
in
.
1 (e). Are all 10 digits
correct ? Why ?
Be sure to support your answer to this question !
NO. The subroutine was called with the
accuracy
.
1 (f). Determine how to call
the Romberg integration subroutine so that it will achieve 10 digits
of accuracy.
You will need to experiment to find the solution. Do it
!
Report the answer with 10 digits of accuracy.
How many function evaluations were required to achieve this answer
?
We suspect the following answer might have 10 digits of accuracy.
Since the last row was row 7, the sequential trapezoidal rule used the following number of function calls.
1 (g). Use Mathematica to find the analytic solution to the integral, i.e. the "true value" of the integral.
1 (h). How close did our last numerical approximation using Romberg integration come to the "true value" of the integral.
![[Graphics:../Images/RombergMod_gr_70.gif]](../Images/RombergMod_gr_70.gif)
(c) John H. Mathews 2004