Example
1 Investigate cubic spline quadrature for
approximating the integral
.
Use 11, 21, 41 and 81 nodes. 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/SplineQuadMod_gr_28.gif]](../Images/SplineQuadMod_gr_28.gif)
![[Graphics:../Images/SplineQuadMod_gr_29.gif]](../Images/SplineQuadMod_gr_29.gif)
1 (b). Construct the cubic spline for 11 nodes and use it for quadrature.
1 (c). Construct the cubic spline for 21 nodes and use it for quadrature.
1 (d). Construct the cubic spline for 41 nodes and use it for quadrature.
1 (e). Construct the cubic spline for 41 nodes and use it for quadrature.
1 (f). Compare the results from parts b-d.
|
m sample points |
|
|
11 |
|
|
21 |
|
|
41 |
|
|
81 |
|
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/SplineQuadMod_gr_62.gif]](../Images/SplineQuadMod_gr_62.gif)
(c) John H. Mathews 2004