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 hi=ti+1−tibi=hi1(yi+1−yi)ui=2(hi−1+hi)vi=6(bi−bi−1)\)
\(\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 si(x)=616−63(x−1)3+(11−6116−63)(x−1)\)
\(\displaystyle s0(x)=32−21(x−1)3+(3253)(x−1)\)
However, the book has:
\(\displaystyle s0(x)=7−5(x−1)3+(712)(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?
x 1 2 3 4 5
y 0 1 0 1 0
Here is my work:
The equations i used (from the book):
\(\displaystyle hi=ti+1−tibi=hi1(yi+1−yi)ui=2(hi−1+hi)vi=6(bi−bi−1)\)
\(\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 si(x)=616−63(x−1)3+(11−6116−63)(x−1)\)
\(\displaystyle s0(x)=32−21(x−1)3+(3253)(x−1)\)
However, the book has:
\(\displaystyle s0(x)=7−5(x−1)3+(712)(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?