[Math] Cubic spline with clamped boundaries

interpolationnumerical methodssplinesystems of equations

I have a cubic spline interpolation problem to work through. I think I understand what is required of the question, but my biggest concern is the nature of clamped versus natural boundaries. All the problems I've looked at use natural boundaries, which affect the solution for the polynomials. For clamped boundaries, I'm a little confused as to how to solve for those conditions.

The question is:

$$
\begin{array}{c|c|c}
x & \sin{x} & \frac{d}{dx}\sin{x}=\cos{x} \\
\hline
0.30 & 0.29552 & 0.95534 \\
0.32 & 0.31457 & 0.94924 \\
0.35 & 0.34290 & 0.93927
\end{array}
$$

$$\text{Use the above values and five-digit rounding to construct a cubic spline Q with boundary conditions}$$

$$Q'(x_{0})= f'(x_{0}) \text{ and } Q'(x_{n})=f'(x_{n})$$

$$\text{which force the slopes of the spline to assume certain values (in our case the values }$$
$$f'(x_{0})\text{ and } f'(x_{n})$$
$$\text{ respectively) at the two boundaries. Use this spline to approximate }$$
$$\sin{0.33}$$

Here is my work so far:

Spline consists of two cubics. The first for interval [0.30, 0.32], denoted

$$Q_{0}=a_{0}+b_{0}(x-0.30)+c_{0}(x-0.30)^2+d_{0}(x-0.30)^3$$

and the other for [0.32, 0.35], denoted

$$Q_{1}=a_{1}+b_{1}(x-0.32)+c_{1}(x-0.32)^2+d_{1}(x-0.32)^3$$

This leaves 8 constants to be determined:

$$0.29552=f(0.30)=a_{0}$$
$$0.31457=f(0.32)=a_{0}+b_{0}+c_{0}+d_{0}$$
$$0.31457=f(0.32)=a_{1}$$
$$0.34290=f(0.35)=a_{1}+b_{1}+c_{1}+d_{1}$$
$$Q'_{0}(x_{i})=Q'_{1}(x_{i}) \Rightarrow Q'_{0}(0.32)=Q'_{1}(0.32)=b_{0}+2c_{0}+3d_{0}=b_{1}$$
$$Q''_{0}(x_{i})=Q''_{1}(x_{i}) \Rightarrow Q''_{0}(0.32)=Q''_{1}(0.32)=2c_{0}+6d_{0}=2c_{1}$$

However, this is where I'm a bit stuck:

$$Q'_{0}(x_{0})=f'(x_{0}) $$
$$Q'_{0}(x_{n})=f'(x_{n}) $$

I'm not sure I understand what the implications of the clamped boundaries are, and how to solve for them here. Could anyone kindly provide some insight as to how to approach this problem?

Thanks!

Best Answer

Instead of your last two equations you must use the following: $$ \begin{align} &Q_0'(x_0)=f'(x_0)=0.95534\cr &Q_0'(x_1)=Q_1'(x_1)=f'(x_1)=0.94924\cr &Q_1'(x_2)=f'(x_2)=0.93927\cr \end{align} $$ All in all you have then 8 equations for 8 unknowns, as expected.

Related Question