Example 1. Use
Adaptive Simpson's rule to compute a numerical approximation to the
integral
.
Use the tolerances
. Compare
with the analytic or "true value" of the integral.
Solution 1.
|
tol |
0.001` |
produces |
|
|
tol |
0.00001` |
produces |
|
|
tol |
1.`*^-7 |
produces |
|
|
true |
value |
is |
|
Did the adapt subroutine behave as expected ?
The following graph illustrates the example.
![[Graphics:../Images/AdaptQuadMod_gr_22.gif]](../Images/AdaptQuadMod_gr_22.gif)
![[Graphics:../Images/AdaptQuadMod_gr_23.gif]](../Images/AdaptQuadMod_gr_23.gif)
(c) John H. Mathews 2003