Graphics Programs Reference
In-Depth Information
EXAMPLE 3.5
Use naturalcubicsplinetodetermine y at x
=
1
.
5. The datapoints are
x
1
2
3
4
5
y
0
1
0
1
0
Solution The fiveknots areequally spacedat h
1. Recalling that the second deriva-
tiveofanaturalspline iszero at the first and last knot, wehave k 1 =
=
k 5 =
0
.
The second
derivatives at the other knots areobtained fromEq. (3.12). Using i
=
2
,
3
,
4 we get the
simultaneousequations
0
+
4 k 2 +
k 3 =
6 [0
2(1)
+
0]
=−
12
k 2 +
4 k 3 +
k 4 =
6 [1
2(0)
+
1]
=
12
k 3 +
4 k 4 +
=
+
=−
0
6 [0
2(1)
0]
12
The solutionis k 2
=
k 4
=−
30
/
7, k 3
=
36
/
7.
5 lies in the segment between knots 1 and 2. The corresponding
interpolant isobtained fromEq. (3.10) by setting i
The point x
=
1
.
=
1. With x i
x i + 1 =−
h
=−
1, we
obtain
6 ( x
x 2 ) +
6 ( x
x 1 )
k 1
k 2
x 2 ) 3
x 1 ) 3
f 1 , 2 ( x )
=−
( x
( x
[ y 1 ( x
x 2 )
y 2 ( x
x 1 )]
Therefore,
(1
1)
1
6
30
7
1) 3
.
=
.
=
+
.
.
.
=
.
y (1
5)
f 1 , 2 (1
5)
0
5
(1
5
[0
1(1
5
1)]
0
7679
The plot of the interpolant, which in thiscase is made up of four cubicsegments, is
shown in the figure.
1.00
0.80
0.60
0.40
0.20
0.00
1.00
1.50
2.00
2.50
3.00
3.50
4.00
4.50
5.00
x
Search WWH ::




Custom Search