INTERPOLASI: METODE
LAGRANGE
Dr.Eng. Agus S. Muntohar
Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1
Pertemuan ke-12:
20 Desember 2012
Apa Interpolasi?
2
Diberikan data (x
0
,y
0
), (x
1
,y
1
), …… (x
n
,y
n
), nilai “y”
diperoleh pada “x” yang tidak diketahui nilainya.
Interpolan
Dr.Eng. Agus S Muntohar Department of Civil Engineering
3
Bentuk polinomial merupakan interpolan yang
paling sering dipilih karena mudah untuk
melakukan:
Evaluasi
Turunan, dan
Integral
Interpolasi Lagrangian
4
Interpolasi polinomial Langrangian dinyatakan sebagai
Dimana n = pangkat polinomial ke-n yang didekati
dengan fungsi y = f(x) untuk setiap (n+1) titik data
(x
0
,y
0
), (x
1
,y
1
),…,(x
n-1
,y
n-1
),(x
n
,y
n
) dan
L
i
(x) = fungsi bobot (weighting function) untuk hasil ke
(n-1) dimana untuk hasil j = I diabaikan
0 n i i i if x
L x f x
0 n j i j i j j ix x
L x
x
x
Contoh 1
Dr.Eng. Agus S Muntohar Department of Civil Engineering
5
0
0
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1 Data kecepatan dan waktu
Gambar 2 Plot data kecepatan dan waktu
untuk Contoh 1
s
,
t
v
t
,
m/s
Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1.
Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode
Lagrange.
Interpolasi Linier Lagrange (1)
6 10 12 14 16 18 20 22 24 350 400 450 500 550 517.35 362.78 ys f range( ) f x de sire d xs 110 xs 010 xsrangexde sire d
1 0 0 0 1 1( )
( ) ( )
( )
( )
i i iv t
L t v t
L t v t
L t v t
0 0 1 115;
362.78
20;
517.35
t
v t
t
v t
Interpolasi Linier Lagrange (2)
Dr.Eng. Agus S. Muntohar Department of Civil Engineering
7
1 1 0 0 0 0 1 j j j j it t
t t
L t
t
t
t
t
1 0 1 0 1 1 0 j j j j it t
t t
L t
t
t
t
t
0 1 0 1 0 1 1 020
15
362.78
517.35
15 20
20 15
16 20
16 15
362.78
517.35
15 20
20 15
0.8 362.78
0.2 517.35
393.7
t t
t t
v t
v t
v t
t
t
t
t
t
t
m s
Interpolasi Kuadratik Lagrange
8
Interpolasi polinomial pangkat 2 atau kuadratik
dapat dinyatakan sebagai
2 0 0 0 1 1 2 2( )
( ) ( )
( )
( )
( )
i i iv t
L t v t
L t v t
L t v t
L t v t
Contoh 2
Dr.Eng. Agus S Muntohar Department of Civil Engineering
9
0
0
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1 Data kecepatan dan waktu
Gambar 2 Plot data kecepatan dan waktu
untuk Contoh 1
s
,
t
v
t
,
m/s
Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1.
Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode
Kuadratik Lagrange.
Interpolasi Kuadratik Lagrange (2)
10 10 12 14 16 18 20 200 250 300 350 400 450 500 550 517.35 227.04 ys f range( ) f x de sire d 20 10 xsrangexde sire d
0 0 1 1 2 210;
227.04
15;
362.78
20;
517.35
t
v t
t
v t
t
v t
2 1 2 0 0 0 0 1 0 2 j j j j it t
t t
t t
L t
t
t
t
t
t
t
2 0 2 1 0 1 1 0 1 2 j j j j it t
t t
t t
L t
t
t
t
t
t
t
2t t
t t
t t
Interpolasi Kuadratik Lagrange (3)
Dr.Eng. Agus S. Muntohar Department of Civil Engineering
11
1 2
0 2
0 1
0 1 2 0 1 0 2 1 0 1 2 2 0 2 1t t
t t
t t
t t
t t
t t
v t
v t
v t
v t
t
t
t
t
t t
t t
t
t
t
t
Kesalahan relatif terhadap interpolasi linier
392.19 393.70
100 0.38410%
392.19
a
16 15
16 20
16 10
16 20
16
227.04
362.78
10 15
10 20
15 10
15 20
16 10
16 15
517.35
20 10
20 15
0.08 227.04
0.96 362.78
0.12 527.35
392.19 m/s
v
Interpolasi Kubik Lagrange
12
Interpolasi polinomial pangkat 3 atau kubik dapat
dinyatakan sebagai
3 0 0 0 1 1 2 2 3 3( )
( ) ( )
( )
( )
( )
( )
i i iv t
L t v t
L t v t
L t v t
L t v t
L t v t
400 500 600 700 602.97 ys f range( ) f x de sire dContoh 3
Dr.Eng. Agus S Muntohar Department of Civil Engineering
13
0
0
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1 Data kecepatan dan waktu
Gambar 2 Plot data kecepatan dan waktu
untuk Contoh 1
s
,
t
v
t
,
m/s
Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1.
Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode
Kubik Lagrange.
Interpolasi Kubik Lagrange (2)
14 300 400 500 600 700 602.97 ys f range( ) f x de sire d
0 0 1 1 2 2 3 310;
227.04;
15;
362.78
20;
517.35;
22.5;
602.97
t
v t
t
v t
t
v t
t
v t
3 1 2 3 0 0 0 0 1 0 2 0 3 j j j j it t
t t
t t
t t
L t
t
t
t
t
t
t
t
t
3 0 2 3 1 0 1 1 0 1 2 1 3 j j j j it t
t t
t t
t t
L t
t
t
t
t
t
t
t
t
3 0 1 3 2 0 2 2 0 2 1 2 3 j j j j it t
t t
t t
t t
L t
t
t
t
t
t
t
t
t
3t t
t t
t t
t t
Cubic Interpolation (contd)
Dr.Eng. Agus S. Muntohar Department of Civil Engineering
15
1 2 3
0 2 3
0 1 3
1 2 2 0 1 0 2 0 3 1 0 1 2 1 3 2 0 2 1 2 3 1 1 2 3 1 3 1 3 2 t t t t t t t t t t t t t t t t t t v t v t v t v t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t v t
3 Kesalahan relatif terhadap interpolasi kuadratik
%
033269
.
0
100
06
.
392
19
.
392
06
.
392
a
16 15 16 20 16 22.5 16 10 16 20 16 22.5 16 227.04 362.78 10 15 10 20 10 22.5 15 10 15 20 15 22.5 16 10 16 15 16 22.5 16 10 1 517.35 20 10 20 15 20 22.5 22.5 10 v
6 15 16 20 602.97 22.5 15 22.5 20 0.0416 227.04 0.832 362.78 0.312 517.35 0.1024 602.97 392.06 m/s Perbandingan Hasil Hitungan Metode
Lagrange dan NDD
16Pangkat Polinomial:
1
2
3
v(t=16) m/s
393.69
392.19
392.06
Pangkat Polinomial:
1
2
3
v(t=16) m/s
393.69
392.19
392.06
Kesalahan relatif
--- 0.38502 % 0.033427 %
Metode NDD
Metode Lagrange
Distance from Velocity Profile
Dr.Eng. Agus S. Muntohar Department of Civil Engineering
17
Find the distance covered by the rocket from t=11s to
t=16s ?
,
00544
.
0
13195
.
0
265
.
21
245
.
4
)
(
t
t
t
2t
3v
10
t
22
.
5
16 11)
(
)
11
(
)
16
(
s
v
t
dt
s
16 11 3 20
.
00544
)
13195
.
0
265
.
21
245
.
4
(
t
t
t
dt
16 11 4 3 2
]
4
00544
.
0
3
13195
.
0
2
265
.
21
245
.
4
[
t
t
t
t
1605
m
)
5727
.
2
)(
3000
650
45
(
)
1388
.
4
)(
3375
5
.
712
5
.
47
(
)
9348
.
1
)(
4500
875
5
.
52
(
)
36326
.
0
)(
6750
5
.
1087
5
.
57
(
)
(
2 3 2 3 2 3 2 3
t
t
t
t
t
t
t
t
t
t
t
t
t
v
Acceleration from Velocity Profile
18
,