next up previous contents
Next: 9.5 Roots of equations Up: 9.4 Interpolation and extrapolation Previous: 9.4.3 Whittacker's interpolation formula

9.4.4 The cubic spline

A problem with polynomial interpolation is that higher-order polynomials sometimes produce undesirable fluctuations when the polynomials are forced to fit the data exactly. Small errors in the data can then have undesirable effects on interpolated values. The spline provides a technique for obtaining a smoother interpolation formula. A cubic spline s(x) is constructed for each interval between data points by determining the four polynomial coefficients as follows. Two requirements are that the endpoints of the polynomial match the data:

\begin{displaymath}s(x_i)=f(x_i) \ \ \ \ {\rm and} \ \ \ \ s(x_{i+1})=f(x_{i+1}) \ . \end{displaymath} (9.33)

The two other constraints arise from the requirement that the first and second derivatives be the same as in adjoining intervals. (These constraints are shared with the nearby data intervals, so only provide two constraints.) It is conventional to specify that the second derivatives vanish at the endpoints of the data set. This then specifies a set of simultaneous equations to be solved for the interpolating function. Computer routines are readily available to perform these interpolations.




NCAR Advanced Study Program
http://www.asp.ucar.edu