





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Arne Morten Kvarving
Department of Mathematical Sciences
Norwegian University of Science and Technology
October 21 2008
many points.
interpolation - we express the solution over the whole domain
as one polynomial of degree N for N + 1 data points.
a = t 0 t 1 t 2 t 3 tn− 1 b = tn x
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
1
Figure: Runge’s example plotted on a grid with 100 equidistantly spaced
grid points.
−5 −4 −3 −2 −1 0 1 2 3 4 5
−
0
1
2
3
4
5
6
7
8
exact interpolated
Figure: Runge’s example interpolated using a 15th order polynomial
based on equidistant sample points.
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
1
Figure: Runge’s example interpolated using piecewise linear interpolation.
We have used 7 points to interpolate the function in order to ensure that
we can actually see the discontinuities on the plot.
datasets ⇒ we cannot do higher order interpolation.
interpolation.
of the solution is only C
0 .
t 1 t 2 t 3 tn− 1 x
s 1 (x) s 2 (x) s 0 (x)
sn− 1 (x)
a = t 0 b = tn
S(x) =
S 0 (x) = a 0 x
3
2
. . .
Sn− 1 (x) = an− 1 x
3
2
which satisfies
S(x) ∈ C
2 [t 0 , tn] :
Si− 1 (xi ) = Si (xi )
′ i− 1 (xi^ ) =^ S
′ i (xi^ )
S
′′ i− 1 (xi^ ) =^ S
′′ i (xi^ )
, i = 1, 2 , · · · , n − 1.
Given (xi , yi )
n i=
. Task: Find S(x) such that it is a cubic spline
interpolant.
3(n − 1) equations.
S(xi ) = yi , i = 0, · · · , n
which gives n + 1 equations.
n− 1 i=.
Task: Find S(x) such that it is a natural cubic spline.
it is a natural cubic spline is simply expressed as z 0 = zn = 0.
S
′′ (x) is a linear spline which interpolates (ti , zi ).
interpolant S
′′ (x), and then integrate that twice to obtain
S(x).
′′ i (x) =^ zi
x − ti+
ti − ti+
x − ti
ti+1 − ti
′′ (x) = zi+
x − ti
hi
ti+1 − x
hi
Si (x) =
zi+
6 hi
(x − ti )
3
zi
6 hi
(ti+1 − x)
3
system
Si (x) =
zi+
6 hi
(x − ti )
3
zi
6 hi
(ti+1 − x)
3
yi+
hi
zi+
hi
(x − ti )
yi
hi
hi
zi
(ti+1 − x).
′ i (x) =^
zi+
2 hi
(x − ti )
2 −
zi
2 hi
(ti+1 − x)
2
hi
(yi+1 − yi )
︸ ︷︷ ︸ bi
hi
(zi+1 − zi ).
′ i (ti^ ) =^ −^
zi hi + bi −
hi
zi+1 +
hi zi
′ i (ti+1) =^
zi+
2
hi + bi −
hi
6
zi+1 +
hi zi
Si− 1 (ti ) =
zi hi+1 +
hi− 1 zi− 1 + bi− 1
′ i (ti^ ) =^ Si−^1 (ti^ )^ ⇒
6 (bi − bi− 1 ) = hi− 1 z− 1 + 2 (hi− 1 + hi ) zi + hi zi+1.
v 1 h 1
h 1 v 2 h 2
h 2 v 3 h 3
.. .
. (^) hn− 2
hn− 2 vn− 1
z 1
z 2
z 3
. . .
zn− 2
zn− 1
u 1
u 2
u 3
. . .
un− 2
un− 1
i 0 1 2 3
xi 0.9 1.3 1.9 2.
yi 1.3 1.5 1.85 2.
hi = xi+1 − xi 0.4 0.6 0.
bi =
1 hi
(yi+1 − yi ) 0.5 0.5833 1.
vi = 2 (hi− 1 + hi ) 2.0 1.
ui = 6 (bi − bi− 1 ) 0.5 4
z 1
z 2