Professional Documents
Culture Documents
Interpolants
Polynomials are the most common choice
of interpolants because they are easy to:
Evaluate
Differentiate, and
Integrate.
where
a0 = f ( x0 )
a1 =
3
f (x1) f (x0 )
x1 x0
Quadratic Interpolation
Given ( x0 , y 0 ), ( x1 , y1 ), and ( x 2 , y 2 ), fit a quadratic interpolant through the data.
f 2 ( x) = a0 + a1 ( x x0 ) + a2 ( x x0 )( x x1 )
a0 = f ( x0 )
f ( x1 ) f ( x0 )
a1 =
x1 x0
f ( x2 ) f ( x1 ) f ( x1 ) f ( x0 )
x2 x1
x1 x0
a2 =
x2 x0
4
Example
The upward velocity of a rocket is given as a function of
time in Table 1. Find the velocity at t=16 seconds using
the Newton Divided Difference method for quadratic
interpolation.
Table. Velocity as a
function of time
0
10
15
20
22.5
30
0
227.04
362.78
517.35
602.97
901.67
Figure. Velocity vs. time data
for the rocket example
550
500
450
y s
400
f ( range )
f x desired
350
300
250
227.04
200
10
10
12
14
16
x s , range , x desired
18
20
20
a0 = v(t0 )
a1 =
= 227 . 04
a1 =
v (t1 ) v(t0 )
362.78 227.04
t1 t0
f ( x1 ) f ( x0 )
x1 x0
f ( x2 ) f ( x1 ) f ( x1 ) f ( x0 )
x2 x1
x1 x0
a2 =
x2 x0
15 10
= 27 . 148
v(t2 ) v (t1 )
a2 =
=
t2 t1
t1 t0
t2 t0
= 0 . 37660
7
v(t1 ) v(t0 )
517.35 362.78
=
362.78 227.04
20 15
15 10
20 10
At t = 16,
v(16) = 227.04 + 27.148(16 10) + 0.37660(16 10)(16 15) = 392.19 m/s
The absolute relative approximate error a obtained between the results from the first
order and second order polynomial is
a
392.19 393.69
=
x100
392.19
= 0.38502 %
8
f 2 ( x) = a0 + a1 ( x x0 ) + a2 ( x x0 )( x x1 )
where
a0 = f [ x0 ] = f ( x0 )
a1 = f [ x1 , x0 ] =
f ( x1 ) f ( x0 )
x1 x0
f ( x2 ) f ( x1 )
a2 = f [ x2 , x1 , x0 ] =
f [ x2 , x1 ] f [ x1 , x0 ]
x2 x0
f ( x1 ) f ( x0 )
x2 x1
x1 x0
x2 x0
Rewriting
General Form
Given (n + 1) data points, ( x0 , y 0 ), ( x1 , y1 ),......, ( x n 1 , y n 1 ), ( x n , y n ) as
Pn ( x) = a0 + a1 ( x x0 ) + .... + an ( x x0 )( x x1 )...( x xn 1 )
where
a0 = f [ x0 ]
a1 = f [ x1 , x0 ]
a2 = f [ x2 , x1 , x0 ]
an 1 = f [ xn 1 , xn 2 ,...., x0 ]
an = f [ xn , xn 1 ,...., x0 ]
10
General form
The third order polynomial, given ( x0 , y0 ), ( x1 , y1 ), ( x2 , y 2 ), and ( x3 , y3 ), is
P3 ( x) = f [ x0 ] + f [ x1 , x0 ]( x x0 ) + f [ x2 , x1 , x0 ]( x x0 )( x x1 )
+ f [ x3 , x2 , x1 , x0 ]( x x0 )( x x1 )( x x2 )
a0
x0
f (x0 )
a1
f [x1 , x0 ]
x1
a2
f [x2 , x1 , x0 ]
f (x1 )
f [x3 , x2 , x1 , x0 ]
f [x2 , x1 ]
x2
f (x2 )
f [x3 , x2 , x1 ]
f [x3 , x2 ]
x3
11
f (x3 )
a3
Example
The upward velocity of a rocket is given as a
function of time in Table 1. Find the velocity at
t=16 seconds using the Newton Divided Difference
method for cubic interpolation.
Table. Velocity as a
function of time
t (s )
v(t ) ( m/s)
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
12
Example
The velocity profile is chosen as
t0 = 10,
v(t 0 ) = 227.04
t1 = 15,
v(t1 ) = 362.78
t 2 = 20,
v(t 2 ) = 517.35
Example
a0
t0 = 10
a1
227.04
27.148
t1 = 15,
362.78
a2
0.37660
5.4347103
30.914
t2 = 20,
517.35
a3
0.44453
34.248
t3 = 22.5,
602.97
Hence
Example
v(t) =a0 +a1 (t t0 ) +a2 (t t0 )(t t1 ) +a3 (t t0 )(t t1 )(t t2 )
=227.04 + 27.148(t 10) +0.37660(t 10)(t 15)
3
15
392.06 392.19
x100
392.06
= 0.033427 %
Comparison Table
Order of
Polynomial
v(t=16)
m/s
Absolute Relative
Approximate Error
16
393.69
392.19
392.06
----------
0.38502 %
0.033427 %
10 t 22.5
10 t 22.5
So
16
s (1 6 ) s (1 1 ) =
v (t )d t
11
16
4 .2 5 4 1 + 2 1 .2 6 5t + 0 .1 3 2 0 4 t 2 + 0 .0 0 5 4 3 4 7 t 3 ) d t
11
16
t2
t3
t4
= 4 .2 5 4 1t + 2 1 .2 6 5
+ 0 .1 3 2 0 4
+ 0 .0 0 5 4 3 4 7
2
3
4 11
17
= 1605 m
19
20
21
22
dimana:
23
24
25
26
27
Latihan:
28
29
30
31
32
33
34
35