Example 1  Investigate Romberg integration for approximating the integral  [Graphics:Images/RombergMod_gr_23.gif].  
Use the tolerances [Graphics:Images/RombergMod_gr_24.gif].  Compare with the analytic or "true value" of the integral.

Solution 1.

[Graphics:../Images/RombergMod_gr_25.gif]
[Graphics:../Images/RombergMod_gr_26.gif]

1 (a). Plot the function over the interval  [0, 1.25].

[Graphics:../Images/RombergMod_gr_27.gif]

[Graphics:../Images/RombergMod_gr_28.gif]

[Graphics:../Images/RombergMod_gr_29.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 ?

[Graphics:../Images/RombergMod_gr_30.gif]


[Graphics:../Images/RombergMod_gr_31.gif]
[Graphics:../Images/RombergMod_gr_32.gif]
[Graphics:../Images/RombergMod_gr_33.gif]
[Graphics:../Images/RombergMod_gr_34.gif]
[Graphics:../Images/RombergMod_gr_35.gif]
[Graphics:../Images/RombergMod_gr_36.gif]

1 (c). The last entry in the table is  [Graphics:../Images/RombergMod_gr_37.gif].  Let's find it.
    (This is possible because  j  is a global variable in the subroutine.)

[Graphics:../Images/RombergMod_gr_38.gif]


[Graphics:../Images/RombergMod_gr_39.gif]
[Graphics:../Images/RombergMod_gr_40.gif]

1 (d). Look at 10 digits in  [Graphics:../Images/RombergMod_gr_41.gif].

[Graphics:../Images/RombergMod_gr_42.gif]


[Graphics:../Images/RombergMod_gr_43.gif]

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  [Graphics:../Images/RombergMod_gr_44.gif].  

 

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.

[Graphics:../Images/RombergMod_gr_45.gif]


[Graphics:../Images/RombergMod_gr_46.gif]
[Graphics:../Images/RombergMod_gr_47.gif]
[Graphics:../Images/RombergMod_gr_48.gif]
[Graphics:../Images/RombergMod_gr_49.gif]
[Graphics:../Images/RombergMod_gr_50.gif]
[Graphics:../Images/RombergMod_gr_51.gif]
[Graphics:../Images/RombergMod_gr_52.gif]
[Graphics:../Images/RombergMod_gr_53.gif]
[Graphics:../Images/RombergMod_gr_54.gif]

Since the last row was row 7, the sequential trapezoidal rule used the following number of function calls.

[Graphics:../Images/RombergMod_gr_55.gif]

[Graphics:../Images/RombergMod_gr_56.gif]

1 (g). Use Mathematica to find the analytic solution to the integral, i.e. the "true value" of the integral.

[Graphics:../Images/RombergMod_gr_57.gif]


[Graphics:../Images/RombergMod_gr_58.gif]
[Graphics:../Images/RombergMod_gr_59.gif]
[Graphics:../Images/RombergMod_gr_60.gif]
[Graphics:../Images/RombergMod_gr_61.gif]
[Graphics:../Images/RombergMod_gr_62.gif]
[Graphics:../Images/RombergMod_gr_63.gif]
[Graphics:../Images/RombergMod_gr_64.gif]
[Graphics:../Images/RombergMod_gr_65.gif]

1 (h). How close did our last numerical approximation using Romberg integration come to the "true value" of the integral.

[Graphics:../Images/RombergMod_gr_66.gif]


[Graphics:../Images/RombergMod_gr_67.gif]
[Graphics:../Images/RombergMod_gr_68.gif]


[Graphics:../Images/RombergMod_gr_69.gif]

[Graphics:../Images/RombergMod_gr_70.gif]

[Graphics:../Images/RombergMod_gr_71.gif]
[Graphics:../Images/RombergMod_gr_72.gif]
[Graphics:../Images/RombergMod_gr_73.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004