Module

for

Cubic Spline Quadrature

 

Background for Cubic Spline.

    Suppose that  
[Graphics:Images/SplineQuadMod_gr_1.gif]  are  n+1  points, where  [Graphics:Images/SplineQuadMod_gr_2.gif].  The function  [Graphics:Images/SplineQuadMod_gr_3.gif]  is called a cubic spline if there exists  n  cubic polynomials  [Graphics:Images/SplineQuadMod_gr_4.gif]  with coefficients  [Graphics:Images/SplineQuadMod_gr_5.gif]  that satisfy the properties:

I.      [Graphics:Images/SplineQuadMod_gr_6.gif][Graphics:Images/SplineQuadMod_gr_7.gif]  
    for  [Graphics:Images/SplineQuadMod_gr_8.gif].  

II.      [Graphics:Images/SplineQuadMod_gr_9.gif]  for  [Graphics:Images/SplineQuadMod_gr_10.gif].  
    The spline passes through each data point.


III.      [Graphics:Images/SplineQuadMod_gr_11.gif]  for  [Graphics:Images/SplineQuadMod_gr_12.gif].
    The spline forms a continuous function over [a,b].

IV.      [Graphics:Images/SplineQuadMod_gr_13.gif]  for  [Graphics:Images/SplineQuadMod_gr_14.gif].
    The spline forms a smooth function.

IV.      [Graphics:Images/SplineQuadMod_gr_15.gif]  for  [Graphics:Images/SplineQuadMod_gr_16.gif].
    The second derivative is continuous.

Natural Spline.  There exists a unique cubic spline with the free boundary conditions  [Graphics:Images/SplineQuadMod_gr_17.gif]  and  [Graphics:Images/SplineQuadMod_gr_18.gif].

Cubic Spline Quadrature.  Integrate the natural cubic spline over the interval [a,b].

Proof  Cubic Spline Quadrature  Cubic Spline Quadrature  

 

Algorithm Natural Cubic Spline.  To construct and evaluate the cubic spline interpolant [Graphics:Images/SplineQuadMod_gr_19.gif] for the  [Graphics:Images/SplineQuadMod_gr_20.gif] data points  [Graphics:Images/SplineQuadMod_gr_21.gif],  using the free boundary conditions  [Graphics:Images/SplineQuadMod_gr_22.gif]  and  [Graphics:Images/SplineQuadMod_gr_23.gif]. Then integrate the natural cubic spline for a quadrature method.

 

Animations (Natural Cubic Spline Quadrature  Natural Cubic Spline Quadrature).  

 

Computer Programs  Cubic Spline Quadrature  Cubic Spline Quadrature  

 

Mathematica Subroutine (Natural Cubic Spline).

Execute the following large group of cells:

[Graphics:Images/SplineQuadMod_gr_24.gif]

Example 1  Investigate cubic spline quadrature for approximating the integral  [Graphics:Images/SplineQuadMod_gr_25.gif].  
Use  11, 21, 41 and 81 nodes.  Compare with the analytic or "true value" of the integral.
Solution 1.

 

Example 2.  Use cubic spline quadrature to compute a numerical approximation to the integral  [Graphics:Images/SplineQuadMod_gr_67.gif].  
Use the tolerances [Graphics:Images/SplineQuadMod_gr_68.gif].  Compare with the analytic or "true value" of the integral.
Solution 2.

 

Example 3.  Use cubic spline quadrature to compute a numerical approximation to the integral  [Graphics:Images/SplineQuadMod_gr_110.gif].  
Use the tolerances [Graphics:Images/SplineQuadMod_gr_111.gif].  Compare with Mathematica's "numerical value" of the integral.
Solution 3.

 

Example 4.  Use cubic spline quadrature to compute a numerical approximation to the integral  [Graphics:Images/SplineQuadMod_gr_146.gif].  
Use the tolerances [Graphics:Images/SplineQuadMod_gr_147.gif].  Compare with the analytic or "true value" of the integral.
Solution 4.

 

Example 5.  Use cubic spline quadrature to compute a numerical approximation to the integral [Graphics:Images/SplineQuadMod_gr_187.gif].  
Use the tolerances [Graphics:Images/SplineQuadMod_gr_188.gif].  Compare with the analytic or "true value" of the integral.
Solution 5.

 

Various Scenarios and Animations for Cubic Spline Quadrature.

Example 6.   Let  [Graphics:Images/SplineQuadMod_gr_228.gif]  over  [Graphics:Images/SplineQuadMod_gr_229.gif].  Use cubic spline quadrature to approximate the value of the integral.  
Solution 6.

 

Animations (Natural Cubic Spline Quadrature  Natural Cubic Spline Quadrature).  

 

Download this Mathematica Notebook Cubic Spline Quadrature

 

Return to Numerical Methods - Numerical Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004