Hampiran numerik fungsi (Interpolasi dan Regressi) Pertemuan 6

Preview:

DESCRIPTION

Hampiran numerik fungsi (Interpolasi dan Regressi) Pertemuan 6. Matakuliah: K0342 / Metode Numerik I Tahun: 2006. TIK: Mahasiswa dapat membandingkan kelebihan/kekurangan berbagai metoda untuk menghampiri suatu fungsi. PERTEMUAN - 6. - PowerPoint PPT Presentation

Citation preview

1

Hampiran numerik fungsi Hampiran numerik fungsi (Interpolasi dan Regressi)(Interpolasi dan Regressi)

Pertemuan 6

Matakuliah : K0342 / Metode Numerik I

Tahun : 2006

TIK: Mahasiswa dapat membandingkan kelebihan/kekurangan berbagai metoda untuk menghampiri suatu fungsi

2

PERTEMUAN - PERTEMUAN - 66

Hampiran numerik fungsi Hampiran numerik fungsi (Interpolasi dan Regressi)(Interpolasi dan Regressi)

TIK: Mahasiswa dapat membandingkan kelebihan/kekurangan berbagai metoda untuk menghampiri suatu fungsi

3

http://www.chem.uoa.gr/applets/AppletPoly/Appl_Poly2.html

4

Curva Fitting

• Interpolasi Linier. Untuk mencari interpolasi antara dua titik xi dan xi+1

dibuat sebuah garis lurus di antara kedua titik tersebut seperti pada gambar berikut

5

y= f(x), dapat dicari dengan rumus yaitu dari persamaan garis

Sebagai contoh , pandang data sederhana berikut ini

Dari data ini dapat dikembangkan fungsi :

6

• Bentuk 3 polinomial f(x) a0, a1 dan a2 tidak diketahui

7

Dengan menggunakan matrik didapat

Dapat juga dilakakukan dengan eliminasi Gauss sehingga diperoleh

8

9

Lagrange InterpolationInterpolasi ini digunakan untuk mencari dependen variable y = f(x) pada intermediate value diantara x yang diberikan

Dibentuk fungsi dimana

merupakan polinomial Lagrange

10

Bentuk umum dari Polinomial Lagrange adalah

11

Untuk data di atas diperoleh dengan polinomial lagrange

12

13

14

15

16

17

Contoh : Nyatakan y sebagai fungsi dari x dari data-data berikut ini

18

19

Polynomial Newton

• p(x) = a0 + a1(x – x0) + a2(x – x0)(x – x1) + a3(x – x0)(x – x1)(x – x2) + … + an-1(x – x0)(x – x1)(x – x2) … (x – xn-2)

• Suku dengan faktor x – xi sama dengan nol untuk x = xi

– Use this and rule that p(xi) = yi to find ai

• a0 = y0, a1 = (y1 – y0) / (x1 – x0) • y2 = a0 + a1(x2 – x0) + a2(x2 – x0)(x2 – x1)

– Solve for a2 using results for a0 and a1

20

• y2 = a0 + a1(x2 – x0) + a2(x2 – x0)(x2 – x1)

))((

)(

))((

)(

1202

0201

0102

1202

021022 xxxx

xxxx

yyyy

xxxx

xxaaya

• Data determine coefficients

• Develop scheme known as divided difference table to compute ak

Polynomial Newton

21

Tabel Divided Difference

x0 y0 a0

a1

x1 y1 a2

x2 y2 a3

x3 y3

01

010 xx

yyF

12

121 xx

yyF

23

232 xx

yyF

02

010 xx

FFS

13

121 xx

FFS

03

010 xx

SST

22

Contoh Divided Difference

0 0 a0

a1

10 10 a2

20 40 a3

30 100

1010

0100

F

31020

10401

F

62030

401002

F

1.020

130

S

15.1030

361

S

600

1

030

15.2.0

T

23

Contoh Divided Difference

• Divided difference table gives a0 = 0, a1 = 1, a2 = .1, and a3 = 1/600

• Polynomial p(x) = a0 + a1(x – x0) + a2(x – x0)(x – x1) + a3(x – x0)(x – x1)(x – x2) = 0 + 1(x – 0) + 0.1(x – 0)(x – 10) + (1/600)(x – 0)(x – 10)(x – 20) = x + 0.1x(x – 10) + (1/600)x(x – 10)(x – 20)

• Check p(30) = 30 + .1(30)(20) + (1/600) (30)(20)(10) = 30 + 60 + 10 = 100 (correct)

24

Constant Step Size

• Divided differences work for equal or unequal step size in x

• If x = h is a constant we have simpler results

– Fk = Dyk/h = (yk+1 – yk)/h– Sk = D2yk/h2 = (yk+2 – 2yk-1 + yk)/h2

– Tk = D3yk/h3 = (yk+3 – 3yk+2 + 3yk+1 – yk)/h3

– Dnyk is called the nth forward difference– Can also define backwards and central differences

25

Cubic Spline Interpolation

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0 1 2 3 4 5 6

x values

y va

lues Known f'

Natural

No Knot

Data

26

Newton Interpolating Polynomial

-1

0

1

2

3

4

5

0 1 2 3 4 5 6

X Values

Y V

alues

Polynomial

Data

27

Double click dibawah ini untuk mencari polinomial Newton (NDD)

sls Newton's Divided Difference.mht

28