You are on page 1of 16

1



Hermite
Cubic Spline



.f ) , ( x 0, y 0 )K( x n, y n
f(xi ) =y.i
-
N
. ) N

( .
- n-
, n+1 .



,
) c0 0 (x 0 ) + c11 (x 0 ) + K + c N N (x 0 ) = f (x 0
) c (x ) + c (x ) + K + c (x ) = f (x
0 0 1
1 1
1
N N
1
1

M
) c0 0 (x N ) + c11 (x N ) + K + c N N (x N ) = f (x N



.
4


n
n
n
n+1:
p(x) = a 0 + a 1 x + L + a n x
a 0 L a n
" n+1
.

1 x 0 L L x 0n a 0 y 0


M
M
M
M
M

M M
M M
M M
M M = M


M
M
M
M
M

M M
1 x L L xn a y
n

n
n n


'
(0,0) (1,1) (2,4)
1 x x

1 0 0 c1 0
0
r 2
1 1 1 c2 = 1

c = 0 = x
1 2 4 c3 4
1

'
) , ,(
:
Pn 1 ( x ) = L 1 ( x ) y 1 + L 2 ( x ) y 2 + K + L n ( x ) y n

b2 4ac

) ( x x1 )( x x2 )K( x xn1 )( x xn
= )Li (x
= )Li ( x
) ( xi x1 )( xi x2 )K( xi xn1 )( xi xn
j=0 xi x j
x xj

ji

)(x 1)(x 2) (x 0)(x 2


)(x 1)(x 0
P2 (x) = 0
+1
+4
= x2
)(0 1)(0 2
)(1 0)(1 2
)(2 1)(2 0
7

-
:
) PN( x) =y0 +y10(xx0 ) +y210(xx0 )(xx1 ) +K+yN(N1)...0(xx0 )(xx1 )K(xxN1
y ( n 1)...1 y ( n 1)...0
= y n( n 1)...0
xn x0

Example 1
Find the Newton polynomial which passes
through (1,5),(2,7),(4,11)(6,15)
1

5
2

0
2

1 1

0
2

6
P ( x )

1 5
=

2 ( x

1 )
9

Cubic spline
spline
. 2
2

spline

' .


n+1 n-1
natural cubic
spline 0
10


hi = xi+1 xi
a i 1

1
1
h0
6
0

hi
(h + h i +1 )
h
(y yi ) (y i y i 1 )
+ ai i
+ a i +1 i +1 = i +1
+
, i = 1,K , n 1
6
6h i
6
hi
h i 1
0

0
1
h1
6

1
(h0 + h1 )
3
1
1
h1
(h2 + h1 )
6
3

...

....

1
h2
6

:
:
0

a0

y2 y1 y1 y0

a1
h0
: h1

:
=

an


(-a)
natural cubic
spline

:
y
(x i+1 x)3
(x x i )3 yi
h
h
Si (x) = a i
+ a i+1
+ a i i (x i+1 x) + i+1 a i+1 i (x x i ), i = 0,K , n 1
h
h
6h i
6h i
6
6
i
i
11

:
natural cubic spline

h
a0 a4 , 0 -a.
1
2
1
a0 + a1 + a2
;) = (y 2 y 1 ) (y 1 y 0
6
3
6
1
2
1
a1 + a2 + a3
;) = (y 3 y 2 ) (y 2 y 1
6
3
6
1
2
1
;) a 2 + a 3 + a 4 = (y 4 y 3 ) (y 3 y 2
6
3
6
12

i = 1:
i = 2:
i = 3:

a 0 + 4a 1 + a 2
a 1 + 4a 2 + a 3

= 24
= 18

a 1 = 4.607 a 2 = 5.57 a 3 = 8.89

a 2 + 4a 3 + a 4 = 30
spline

yi+1
(xi+1 x)3
(x xi )3 yi
hi
hi
Si (x) = ai
+ ai+1
+ ai (xi+1 x) + ai+1 (x xi ), i = 0,K, n 1
6hi
6hi
6
6
hi
hi
4.607 (x +1)3 4x + (14.607 )(x +1),
1 x 0
6
6

4.607 (1 x)3 + 5.577 x3 + (14.607 )(1 x) + (2 5.577 )x


0 x 1

6
6
6
6
S(x) =
3
3
5.5776 (2 x) 8.896 (x 1) + (2 5.5776)(2 x) + (6 +8.896)(x 1) 1 x 2

8.89 (3 x)3 + (6 +8.89 )(3 x) + 5(x 2),


2 x 3
6
6

13

spline .
a0 = a2 = 0
a0 h 2 a1 h a2 h ( ) ( )
( 2 + )
+
+
=

a1 = 1.5
6
3
6
h
h
h2
( 2 + )( x + h)3 x 2 +
S0 =

+
( x + h)
h h
4h 3
4h

i =1

( 2 + )(h x)3 2 +
S1 =
+

x
+
x
(
)

4h 3
h
4
h
h

14

y = ax + b

y

==a
=
x
h
h
= 2 + = 0
:

15

x
S0 =
)+ ( )(x + h
h
h

S1 = (h x) + x
h
h

=
) (x + h)3 ( ) x (
= S0

+(
))(x + h
4h 3
h
h
4h
) ( ) * (3x 2 + 6xh + 2h 2
S' = +
=
h h
4h 3
) ( )4h 2 + ( ) * (3x 2 + 6xh + 2h 2
=
=
4h 3
( )(4h 2 3x 2 6xh 2h 2 ) ( ) 2
=
)(5h 3h 2 3x 2 6xh
3
3
4h
4h
) ( )(5h 2 3(x + h)2
=
4h 3

] [-h,0
0
.
] [-h,0

) ( )(5h 2 3h 2 ) (
=
3
4h
2h
16

You might also like