Professional Documents
Culture Documents
Curve Fitting 4 (Spline Interpolation) Update
Curve Fitting 4 (Spline Interpolation) Update
𝑎𝑎1 𝑥𝑥 + 𝑏𝑏1
𝑎𝑎3 𝑥𝑥 + 𝑏𝑏3
𝑎𝑎2 𝑥𝑥 + 𝑏𝑏2
3
2.5 − 1
m= = 0.6
7 − 4.5
𝑓𝑓 5 − 𝑓𝑓(4.5)
0.6 =
5 − 4.5
f 5 = 1.3
there are n intervals and n +1 data points. The example shown is for n=3.
5
i=2
𝑎𝑎1 𝑥𝑥12 + 𝑏𝑏1 𝑥𝑥1 + 𝑐𝑐1 = 𝑓𝑓(𝑥𝑥1 )
𝑎𝑎2 𝑥𝑥12 + 𝑏𝑏2 𝑥𝑥1 + 𝑐𝑐2 = 𝑓𝑓(𝑥𝑥1 )
8
IDeqUntion -> C 1 S) = SCLUATION
9
13
Cubic Splines
• Cubic Splines attempt to solve the problem of the
smoothness of a graph as well as reduce error.
• Polynomial interpolation uses a single polynomial to meet
all data points, while splines use several low degree
polynomials.
• Cubic splines consist of polynomials of degree 3. Cubic
splines add curvature to an interpolation that would
otherwise be only line segments.
• Base points for cubic splines are called knots. Every sections
of a spline begins and ends with a knot.
14
( )= + ( )+ ( ) + ( )
fi bi hi ci hi2 di hi3 fi 1
16
x xi : si ( xi ) fi ai bi ( xi xi ) ci ( xi xi )2 d i ( xi xi )3 ai
x xi 1 : si ( xi 1 ) fi 1 ai bi ( xi 1 xi ) ci ( xi 1 xi )2 d i ( xi 1 xi )3
2. First derivatives at the interior nodes must be equal:
( )= +2 ( )+3 ( )
( )= ( )
+2 +3 = (n-1) equations
17
Two additional conditions are needed (arbitrary)
s1 ( x 1 ) 0 2c1
sn 1 ( x n ) 0 2cn 1 6 d n 1 hn 1
s1 ( x 1 ) 0 c1 0
sn 1 ( x n ) 0 cn cn 1 3d n 1 hn 1 0
3( f [ x i 1 , x i ] f [ x i , x i 1 ])
hn 2 2( hn 2 hn 1 ) hn 1 cn 1
1 cn
0
3 f [ x 3 , x 2 ] f [ x 2 , x1 ] ทบทวน ่ากระจา ย ง
3 f [ x4 , x3 ] f [ x3 , x2 ]
Tridiagonal matrix
3 f [ xn , xn 1 ] f [ xn 1 , xn 2 ]
0
21
ว่
ยั
CUDI) spline
D- I Constrain +
4
Constraints
#
PD Unknown S, PM- 2
4)
econstraints extr
>X
is is is &
913x = dicx- xistbixx- xi)" + <i < X- Xi) + di
~
constraint ↑4 UnknownS
&1 = 4
sainit (bini + ( i = ( +
saini + ebi = 2bit1
With_ Hi
Thibi + ICHit DitISbit) +
Initbit = Hits Hi
Start 1= 3
·
·
·
เ น 84
=
262 (1 + DLC2
มอง A -
(1 = · SALC 1 =
·
( ) 2.5 1
, = = = 0.6
7 4.5
3( , , )=4.8
1 2.5
, = = 1
4.5 3
22
ป็
ci 1 ci fi 1 fi hi
ai fi , d i , bi 2ci ci 1
3 hi hi 3
23
S2(x=5) =1.1028
24
Cubic equation for each interval
Two unknows are second derivatives at the end of each interval, so we can determine them from
the following equation
25
i=1, x1=4.5
3 = 9 =0
i=2, x2=7
26
27
0 ใบ
Quiz
constreng ทเร ีย
1)
2)
29
SIX) cubic spline -> FICX), flCX) cubic spline
=121 = =2 ( 1
รา (1) ==2 (1
า(1) ==2 (1
Fico) = 8, file) =
="IXO) = 0 , ↑"3 Ans =
SIX) At X= /
fl( KS = 1 + &- OX" + by
( 2- 1+1 = (
1tb = 1- 1
fil ( X) = 1 - 2 &X + 3bx 2
1:
='(x) at X= 1
fi ( X = - ( &+66X
Ot
1- 3 :
+&( X- 1) + 2 CX-
2) + ( X- 2) 153b = Its ,
Fil X) =
=- - - - 5
- 2)
="(X) At X= /
f's ( X) = +21( /- 2) + 33
66 = - 6 > b=- 1
ว (X) ==27 +61x-1
:. b = - 1. 6 = 2.=- 5
fico 3 = 0 -> a =
(2) =->>- 2
ร่
ร่
ร้