interpolasi: metode lagrange - · pdf fileinterpolasi: metode lagrange dr.eng. agus s....

18
INTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember 2012

Upload: hatram

Post on 05-Feb-2018

253 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

INTERPOLASI: METODE

LAGRANGE

Dr.Eng. Agus S. Muntohar

Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1

Pertemuan ke-12: 20 Desember 2012

Page 2: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Apa Interpolasi?

Dr.Eng. Agus S Muntohar Department of Civil Engineering

2

Diberikan data (x0,y0), (x1,y1), …… (xn,yn), nilai “y” diperoleh pada “x” yang tidak diketahui nilainya.

Gambar 1 Interpolasi data diskrit.

Page 3: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

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

Page 4: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Lagrangian

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

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

(x0,y0), (x1,y1),…,(xn-1,yn-1),(xn,yn) dan

Li(x) = fungsi bobot (weighting function) untuk hasil ke

(n-1) dimana untuk hasil j = I diabaikan

0

n

i i i

i

f x L x f x

0

nj

i

j i jj i

x xL x

x x

Page 5: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

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 m/s ,tv

Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1. Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode Lagrange.

Page 6: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Linier Lagrange (1)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

6

10 12 14 16 18 20 22 24350

400

450

500

550517.35

362.78

y s

f range( )

f x de sire d

x s1

10x s0

10 x s range x de sire d

1

0

0 0 1 1

( ) ( ) ( )

( ) ( )

i ii

v t L t v t

L t v t L t v t

0 0

1 1

15; 362.78

20; 517.35

t v t

t v t

Page 7: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Linier Lagrange (2)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

7

1

10

0 0 0 1

j

j jj i

t t t tL t

t t t t

1

01

0 1 1 0

j

j jj i

t t t tL t

t t t t

010 1

0 1 1 0

20 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 tt tv t v t v t

t t t t

t t

m s

Page 8: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Kuadratik Lagrange

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

8

Interpolasi polinomial pangkat 2 atau kuadratik

dapat dinyatakan sebagai

2

0

0 0 1 1 2 2

( ) ( ) ( )

( ) ( ) ( )

i ii

v t L t v t

L t v t L t v t L t v t

Page 9: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

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 m/s ,tv

Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1. Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode Kuadratik Lagrange.

Page 10: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Kuadratik Lagrange (2)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

10

10 12 14 16 18 20200

250

300

350

400

450

500

550517.35

227.04

y s

f range( )

f x de sire d

2010 x s range x de sire d

0 0

1 1

2 2

10; 227.04

15; 362.78

20; 517.35

t v t

t v t

t v t

2

1 20

0 0 0 1 0 2

j

j jj i

t t t t t tL t

t t t t t t

2

0 21

0 1 1 0 1 2

j

j jj i

t t t t t tL t

t t t t t t

2

0 12

0 2 2 0 2 1

j

j jj i

t t t t t tL t

t t t t t t

Page 11: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Kuadratik Lagrange (3)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

11

0 01 2 2 10 1 2

0 1 0 2 1 0 1 2 2 0 2 1

t t t tt t t t t t t tv 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.70100 0.38410%

392.19a

16 15 16 20 16 10 16 2016 227.04 362.78

10 15 10 20 15 10 15 20

16 10 16 15517.35

20 10 20 15

0.08 227.04 0.96 362.78 0.12 527.35 392.19 m/s

v

Page 12: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Kubik Lagrange

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

12

Interpolasi polinomial pangkat 3 atau kubik dapat

dinyatakan sebagai

3

0

0 0 1 1 2 2 3 3

( ) ( ) ( )

( ) ( ) ( ) ( )

i ii

v t L t v t

L t v t L t v t L t v t L t v t

10 12 14 16 18 20 22 24200

300

400

500

600

700602.97

227.04

y s

f range( )

f x de sire d

22.510 x s range x de sire d

Page 13: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Contoh 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 m/s ,tv

Kecepatan dorong sebuah roket diberikan sebagai fungsi waktu pada Tabel 1. Tentukan kecepatan roket pada t = 16 detik dengan menggunakan Metode Kubik Lagrange.

Page 14: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Interpolasi Kubik Lagrange (2)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

14

10 12 14 16 18 20 22 24200

300

400

500

600

700602.97

227.04

y s

f range( )

f x de sire d

22.510 x s range x de sire d

0 0 1 1

2 2 3 3

10; 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

31 20

0 0 0 1 0 2 0 3

j

j jj i

t t t tt t t tL t

t t t t t t t t

3

0 321

0 1 1 0 1 2 1 3

j

j jj i

t t t t t tt tL t

t t t t t t t t

3

0 312

0 2 2 0 2 1 2 3

j

j jj i

t t t t t tt tL t

t t t t t t t t

3

0 1 23

0 3 3 0 3 1 3 2

j

j jj i

t t t t t t t tL t

t t t t t t t t

Page 15: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Cubic Interpolation (contd)

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

15

3 0 3 0 31 2 2 11 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 tt t t t t t t tv 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

3v t

Kesalahan relatif terhadap interpolasi kuadratik

%033269.0

10006.392

19.39206.392

a

16 15 16 20 16 22.5 16 10 16 20 16 22.516 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 1517.35

20 10 20 15 20 22.5 22.5 10

v

6 15 16 20602.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

Page 16: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Perbandingan Hasil Hitungan Metode

Lagrange dan NDD

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

16

Pangkat Polinomial: 1 2 3

v(t=16) m/s 393.69 392.19 392.06

Kesalahan relatif -------- 0.38410% 0.033269%

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

Page 17: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

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.013195.0265.21245.4)( 32 ttttv 5.2210 t

16

11

)()11()16( dttvss

16

11

32 )00544.013195.0265.21245.4( dtttt

16

11

432

]4

00544.03

13195.02

265.21245.4[ttt

t

1605 m

)5727.2)(300065045()1388.4)(33755.7125.47(

)9348.1)(45008755.52()36326.0)(67505.10875.57()(

2323

2323

tttttt

tttttttv

Page 18: INTERPOLASI: METODE LAGRANGE - · PDF fileINTERPOLASI: METODE LAGRANGE Dr.Eng. Agus S. Muntohar Dr.Eng. Agus S. Muntohar Department of Civil Engineering 1 Pertemuan ke-12: 20 Desember

Acceleration from Velocity Profile

Dr.Eng. Agus S. Muntohar Department of Civil Engineering

18

,

Find the acceleration of the rocket at t=16s given that

32 00544.013195.0265.21245.4 tttdt

dtv

dt

dta

201632.026390.0265.21 tt

2)16(01632.0)16(26390.0265.21)16( a

665.29 2/ sm

,00544.013195.0265.21245.4)( 32 ttttv 5.2210 t