Natural Cubic Interpolating Spline

calchere

Junior Member
Joined
Sep 13, 2006
Messages
50
By hand calculation, find the natural cubic spline interpolant for this table:
x 1 2 3 4 5
y 0 1 0 1 0

Here is my work:

The equations i used (from the book):

\(\displaystyle \[\begin{array}{l} h_i = t_{i + 1} - t_i \\ b_i = \frac{1}{{h_i }}(y_{i + 1} - y_i ) \\ u_i = 2(h_{i - 1} + h_i ) \\ v_i = 6(b_i - b_{i - 1} ) \\ \end{array}\]\)

\(\displaystyle \[\begin{array}{l} z_i = \frac{{v_i - h_i z_{i + 1} }}{{u_i }} \\\)

\(\displaystyle s_i (x) = \frac{{z_{i + 1} }}{{6h_i }}(x - t_i )^3 + \frac{{z_i }}{{6h_i }}(t_{i + 1} - x)^3 + (\frac{{y_{i + 1} }}{{h_i }} - \frac{{h_i }}{6}z_{i + 1} )(x - t_i ) + (\frac{{y_i }}{{h_i }} - \frac{{h_i }}{6}z_i )(t_{i + 1} - x) \\ \end{array}\]\)

I got:
h0 = 1 h1 = 1 h2= 1 h3 = 1
b0 = 1 b1 = -1 b2 = 1 b3 = -1
v1 = -12 v2 = 12 v3 = -12
u1 = 4 u2 = 4 u3 = 4
z0 = 0 z1 = -63/16 z2 = 15/4 z3 = -3 z4=0

So, for s0 i get:

\(\displaystyle \[s_i (x) = \frac{{\frac{{ - 63}}{{16}}}}{6}(x - 1)^3 + (\frac{1}{1} - \frac{1}{6}\frac{{ - 63}}{{16}})(x - 1)\]\)


\(\displaystyle \[s_0 (x) = \frac{{ - 21}}{{32}}(x - 1)^3 + (\frac{{53}}{{32}})(x - 1)\]\)

However, the book has:

\(\displaystyle \[s_0 (x) = \frac{{ - 5}}{7}(x - 1)^3 + (\frac{{12}}{7})(x - 1)\]\)


Any help would be appreciated.

PS-I forgot how you make the texaide text bigger. It was something like adding LG or something to the beginning?
 
Top