0% found this document useful (0 votes)
47 views15 pages

6-01-Interpolasi Langsung

1) The document describes the direct method of interpolation, which involves fitting a polynomial through discrete data points to determine the value of an unknown data point. 2) Polynomials such as linear, quadratic, and cubic functions are commonly used as interpolants because they are easy to evaluate, differentiate, and integrate. 3) The direct method involves setting up equations using the known data points to solve for the coefficients of the polynomial interpolant, then substituting the unknown x-value into the polynomial to determine the corresponding y-value.

Uploaded by

naufal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views15 pages

6-01-Interpolasi Langsung

1) The document describes the direct method of interpolation, which involves fitting a polynomial through discrete data points to determine the value of an unknown data point. 2) Polynomials such as linear, quadratic, and cubic functions are commonly used as interpolants because they are easy to evaluate, differentiate, and integrate. 3) The direct method involves setting up equations using the known data points to solve for the coefficients of the polynomial interpolant, then substituting the unknown x-value into the polynomial to determine the corresponding y-value.

Uploaded by

naufal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Direct Method of

Interpolation

1
What is Interpolation ?
Given (x0,yy0),
) (x1,yy1),
) …… (xn,yyn),
) find the value of ‘y’
y at a
value of ‘x’ that is not given.

Figure 1 Interpolation of discrete.


2
Interpolants
Polynomials are the most common
choice of interpolants
p because theyy
are easy to:
Evaluate
l
Differentiate, and
Integrate

3
Direct Method
Given ‘n+1’ data points (x0,y0), (x1,y1),………….. (xn,yn),
pass a polynomial of order ‘n’ through the data as given
below:

y = a0 + a1 x + .................... + an x . n

where a0, a1,………………. an are real constants.


„ Set
S up ‘‘n+1’1’ equations
i to find
fi d ‘n+1’
‘ 1’ constants.
„ To find the value ‘y’ at a given value of ‘x’, simply
substitute the value of ‘x’ in the above p
polynomial.
y

4
Example 1
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
direct method for linear interpolation.
T bl 1 Velocity
Table V l it as a function
f ti
of time.

t , (s ) v(t ), (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 2 Velocity vs. time data for the
rocket example
5
Linear Interpolation
v(t ) = a0 + a1t y

v(15) = a 0 + a1 (15) = 362.78 (x1 , y1 )

v(20) = a 0 + a1 (20) = 517.35 (x0 , y0 )


f1 (x )

Solving the above two equations gives, x

a0 = −100.93 a1 = 30.914 Figure 3 Linear interpolation.

Hence
v(t ) = −100.93 + 30.914t , 15 ≤ t ≤ 20.
v(16) = −100.93 + 30.914(16) = 393.7 m/s

6
Example 2
The upward velocity of a rocket is given as a
function of time in Table 2.
Find the velocity at t=16 seconds using the
direct method for quadratic interpolation.
T bl 2 Velocity
Table V l it as a function
f ti
of time.

t , (s ) v(t ), (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 5 Velocity vs. time data for the
rocket example
7
Quadratic Interpolation
y

v(t ) = a0 + a1t + a2t 2 (x1 , y1 )


v(10) = a0 + a1 (10) + a2 (10) = 227.04
2 (x2 , y2 )

v(15) = a0 + a1 (15) + a2 (15) = 362.78


2

f 2 (x )
v(20) = a0 + a1 (20) + a2 (20) = 517.35
2
( x0 , y 0 )
x

Figure 6 Quadratic interpolation.

Solving the above three equations gives


a0 = 12.05 a1 = 17.733 a2 = 0.3766
8
Quadratic Interpolation (cont.)
550
517.35

v (t ) = 12 .05 + 17 .733t + 0.3766 t , 10 ≤ t ≤ 20


500
2
450

ys

v(16 ) = 12.05 + 17.733(16 ) + 0.3766(16 )


400
2 f ( range)

(
f x desired ) 350

= 392.19 m/s 300

250

227.04 200
10 12 14 16 18 20
10 x s , range, x desired 20

The absolute relative approximate error ∈a obtained between


the results from the first and second order polynomial is
392.19 − 393.70
∈a = ×100
392.19
= 0.38410%
9
Example 3
The upward velocity of a rocket is given as a
function of time in Table 3.
Find the velocity at t=16 seconds using the
direct method for cubic interpolation.
T bl 3 Velocity
Table V l it as a function
f ti
of time.

t , (s ) v(t ), (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 6 Velocity vs. time data for the
rocket example
10
Cubic Interpolation
y

(x3 , y3 )
v(t ) = a0 + a1t + a2t + a3t
2 3

(x1 , y1 )
v(10) = 227.04 = a0 + a1 (10) + a2 (10) + a3 (10)
2 3

f 3 (x )
( x2 , y 2 )
v(15) = 362.78 = a0 + a1 (15) + a2 (15) + a3 (15)
2 3
(x0 , y0 )

v(20) = 517.35 = a0 + a1 (20) + a2 (20) + a3 (20)


2 3 x

Figure 7 Cubic interpolation.


v(22.5) = 602.97 = a0 + a1 (22.5) + a2 (22.5) + a3 (22.5)
2 3

a0 = −4.2540 a1 = 21.266 a2 = 0.13204


3 0 a3 = 0.0054347

11
Cubic Interpolation (contd)
v(t ) = −4.2540 + 21.266t + 0.13204t 2 + 0.0054347t 3 , 10 ≤ t ≤ 22.5
v (16 ) = − 4 .2540 + 21 .266 (16 ) + 0 .13204 (16 ) + 0.0054347 (16 )
2 3

= 392 .06 m/s


700

The absolute percentage relative


602.97

approximate error ∈a between


600

ys 500 second and third order polynomial is


f ( range)

(
f x desired )

392 .06 − 392 .19


400

300
∈a = × 100
392 .06
227.04 200
10
10
12 14 16 18
x s , range, x desired
20 22 24
22.5
= 0.033269 %

12
Comparison Table

Table 4 Comparison of different orders of the polynomial.


Order of
1 2 3
Polynomial
v(t = 166) m/s
/s 393.7 392.19 392.06
Absolute Relative
---------- 0.38410 % 0.033269 %
Approximate Error

13
Distance from Velocity Profile
Fi d the
Find th distance
di t covered
d by
b the
th rocket
k t ffrom tt=11s
11 tto tt=16s
16 ?
ν (t ) = −4.2540 + 21.266t + 0.13204 2 + 0.0054347t 3 ,10 ≤ t ≤ 22.5
16
s (16 ) − s (11) = ∫ v(t )dt
11

( )
16
= ∫ − 4.2540 + 21.266t + 0.13204t 2 + 0.0054347 t 3 dt
11
16
⎡ t2 t3 t4 ⎤
= ⎢− 4.2540t + 21.266 + 0.13204 + 0.0054347 ⎥
⎣ 2 3 4 ⎦11
= 1605 m

14
Acceleration from Velocity Profile
Find
i d theh acceleration
l i off theh rocket
k at t=16s16 giveni that
h
ν (t ) = −4.2540 + 21.266t + 0.13204 2 + 0.0054347t 3 ,10 ≤ t ≤ 22.5

a (t ) = v(t )
d
dt
=
d
dt
(
− 4.2540 + 21.266t + 0.13204t 2 + 0.0054347 t 3 )
= 21.289 + 0.26130t + 0.016382t 2 , 10 ≤ t ≤ 22.5

a(16 ) = 21.266 + 0.26408(16 ) + 0.016304(16 )


2

= 29.665 m/s 2

15

You might also like