自编的三次样条插值matlab程序(含多种边界条件)(Three spline interpolation matlab procedures (including multiple boundary conditions))
The second big assignment is numerically calculated
- verify that the interpolation of cubic spline function has geometric invariance
(1) the given interpolation conditions are as follows:
I 0, 1, 2, 3, 4, 5, 6, 7
Xi. 8.125 9.0 9.485 9.959 10.17 10.2
Yi 0.0774 0.60 0.60 0.708 1.200 1.800 2.177
The boundary conditions of the endpoint are the first type of boundary conditions (given the first derivative) :
Y '.
0.01087
. 0.
'
100 Y.
7.
.
The construction process of the cubic spline function is as follows:
set
The x1.
X2.
The x3.
Xn. 1 xn altogether
N interpolation nodes, then data points
.
X1, y1.
,.
X2, y2.
,.,. Xn, yn.
Cubic spline
S.
X.
Is a set of cubic polynomials:
, S... 231111111112,, xabxxcxxdxxxxx... ,
.
.
23
.
.
.
A..
X.
X.
C..
X.
D. x.
X, x.. X, x,
S2, x, 2, b22.
2 x 2.
22.
23.
.
(1.1)
.
.
.
S. x.
X. 3, x.. X, x.
.
N.
......nnnnnnxabxxcxxd...
N.
N. 1 n.
.
The continuity of the node is known as follows:
S.
X..
Y, S.
X..
Y, I. 1, 2,.n. 1.
Ii, iii. I. 1
. A.
Yi,.1, 2,.n. 1.
ii
.
. Y y... 2321121121121 BXXCXXDXX... , (1.2),
..
.
.
Y.
Y.
B.
X.
X..
C. x.
X. 2.
D. x.
3 x.
.
Nn. N. 1 n. 1 n. 1 n. 1 n
The first and second order smoothness of the node is known:
Si
"'" "
11, iiiiiixSxSxS...
..
.
.
.. Xi.
1, 2, and n.
.
2
' '
0.
S. x..
S. x..
B.
2 c. X.
X..
3 d. X.
X..
b
12, 221121, 121, 2
.
..
.
2
' '
(1.3)
. 0.
Sn. 2.
Xn. 1..
Sn. 1.
Xn. 1..
Bn. 2.
2 cn. 2. Xn. 1.
Xn. 2.
3 dn. 2. Xn. 1.
Xn. 2.
Bn. 1
..
""
. 0.
S.
X..
S.
X..
2 c.
6 d. X.
X..
2 c
1222, 1121, 2
.
.
.
.
. 0.
Sn
""
211122 NNNNXSXC...
..
..
6 dn. 2.
Xn. 1.
Xn. 2.
1 2 cn.
And set up
Cn. Sn
"
1..
Xn.
2, remember
..
X.
X,..
Y.
Yi,.1, 2,., n. 1, can be:
Ii. 1 ii i. 1 I
C.
c
1 I i.
Di.
, I.
1, 2, n. 1. (1.4)
3. I
From (1.2) solution:
Bi.
I..
Ci. I.
Di i.
212 iiiicc...
.
.
.
. 1, 2, n. 1. (1.5)
I. i. 3
(1.4) and (1.5) are substituted into (1.3) :
.
.. 2. 1.
.. C.
2.. 1..
.
2.. 2 c3.
3
11 2 c