Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Metode Numerik & FORTRAN Mata Praktikum: Copyright © 2008. This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation.

Presentasi serupa


Presentasi berjudul: "Metode Numerik & FORTRAN Mata Praktikum: Copyright © 2008. This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation."— Transcript presentasi:

1 Metode Numerik & FORTRAN Mata Praktikum: Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

2 Pertemuan 5 … … 2008 Metode Sekan Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

3 I.Pendahuluan II.Metode Sekan III.Algoritma Sekan IV.Contoh Soal V.Contoh Program VI.Laporan Akhir VII.Laporan Pendahuluan Pertemuan 6 I II III IV V Daftar Isi VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

4 PENDAHULUAN I Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

5 PENDAHULUAN Dalam komputasi terkadang sering dihadapkan dengan permasalahan yang berkaiatan dengan analisa terhadap numeril. Salah satunya mencari nilai akar sautu persamaan. Dan untuk mencari akar dari suatu persamaan nonlinier dapat digunakan beberapa metode. Secara metode numerik, dapat digunakan 2 cara : 1.Tanpa menggunakan derivatif (turunan) - Metode Biseksi - Metode Regulafalsi - Metode Sekan - Metode Iterasi titik tetap 2.Menggunakan derivatif (turunan) - Metode Newton-Raphson II I Daftar Isi III IV V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

6 METODE SEKAN II Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

7 METODE SEKAN Metoda Sekan disebut juga metoda interpolasi linier. Dalam prosesnya tidak dilakukan penjepitan akar sehingga [x 0,x 1 ] tidak harus mengandung akar, serta f(x 0 ) dan f(x 1 ) bisa bertanda sama. Tarik garis lurus melalui (x 0, f(x 0 )) dan (x 1, f(x 1 )) dan memotong sumbu x di (x 2,0) Daftar Isi x0x0 x1x1 x2x2 0 f(x) x I II III IV V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

8 METODE SEKAN Iterasi berikutnya dengan pergeseran : x 0  x 1 x 1  x 2 Iterasi berlangsung sampai batas maksimum iterasi atau sampai Daftar Isi I II III IV V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

9 ALGORITMA SEKAN III Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

10 a)Tentukan x 0, x 1, T, iterasi maksimum dan F(x) b)Hitung x 2 = x 1 – f(x 1 ) (x 1 - x 0 ) / [f(x 1 ) – f(x 0 )] c)Jika nilai |(x 1 -x 2 ) / x 1 | < T, tulis x 2 sebagai akar dan akhiri program. Jika tidak, lanjutkan ke langkah berikutnya. d)Jika jumlah iterasi > iterasi maksimum, akhiri program. e)x 0 = x 1 f)x 1 = x 2 g)Kembali ke b Algoritma Sekan Daftar Isi II III I IV V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

11 CONTOH SOAL IV Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

12 1. Cari akar dari f(x) = x 3 – 2x – 5, dimana : - x 0 = 1 - x 1 = 2 - Toleransi (T) = 0,001 atau Jawab : Iterasi 1 : Contoh Soal Daftar Isi 1 / 4 II IV III I V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

13 Iterasi 2 : Contoh Soal Daftar Isi 2 / 4 II IV III I V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

14 Iterasi 3 : Contoh Soal Daftar Isi 3 / 4 II IV III I V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

15 Iterasi 4 : Contoh Soal Daftar Isi 4 / 4 Karena Tolerasi (T) yang didapat = 0,0005 < Jadi, akarnya adalah = 2,095 II IV III I V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

16 Representasi dalam bentuk tabel Daftar Isi Iterasix0x0 x1x1 x2x2 |(x 1 -x 2 ) / x 1 | 1122,20,1 222,22,0890,051 32,22,0892,0940,002 42,0892,0942,0950,0005 Karena Tolerasi (T) yang didapat = 0,0005 < Jadi, akarnya adalah = 2,095 II IV III I V VI VII Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

17 CONTOH PROGRAM V Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

18 $ title: Sekan c Contoh program Sekan REAL X0,X1,X2,T INTEGER ORDO, ITER DIMENSION KOEF(20) WRITE (*,’(24(/))’) WRITE (*,’(30X,A)’) ‘Input Persamaan’ WRITE (*,’(30X,A)’) ‘===============’ WRITE (*,*) WRITE (*,’(a,\)’) ‘Orde/Derajat : ’ READ (*,’(I2)’) ORDO CONTOH PROGRAM II V Daftar Isi III IV I VI VII 1/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

19 WRITE (*,*) DO 10 I=ORDO+1, 1, -1 WRITE (*,’(A,I2,A,\)’) ‘Koefisien X^’,I-1,‘ = ’ READ (*,’(I3)’) KOEF(I) 10CONTINUE WRITE (*,*) WRITE (*,*) ‘Persamaan yang diinput : ’ WRITE (*,*) CALL OUTPUT (ORDO,KOEF) PAUSE CONTOH PROGRAM II V Daftar Isi III IV I VI VII 2/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

20 WRITE (*,’(24(/))’) WRITE (*,’(20X,A)’) ‘Pencarian Akar Menggunakan Metode Sekan’ WRITE (*,’(20X,A)’) ‘==========================’ WRITE (*,*) CALL OUTPUT(ORDE,KOEF) WRITE (*,*) WRITE (*,’(A,\)’) ‘X0(Batas Bawah) = ’ READ (*,*) X0 WRITE (*,’(A,\)’) ‘X1(Batas Atas) = ’ READ (*,*) X1 CONTOH PROGRAM II V Daftar Isi III IV I VI VII 3/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

21 WRITE (*,’(A,\)’) ‘Toleransi Kesalahan = ’ READ (*,*) T WRITE (*,*) X2 = X1 – (FNG(ORDO,KOEF,X1)*(X1-X0))/ - (FNG(ORDO,KOEF,X1)-FNG(ORDO,KOEF,X0)) ITER = 1 WRITE (*,*) ‘ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄ - ÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿’ WRITE (*,'(2(A,3X),7(A,6X),A,3X,A)') '³', - ' ITERASI','³','X0','³','X1','³','X2','³', - 'F(X2)','³’ WRITE (*,*) ‘ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄ - ÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´’ CONTOH PROGRAM II V Daftar Isi III IV I VI VII 4/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

22 WHILE (( ABS((X1-X2)/X1).GT. T).AND. - ( FNG(ORDO,KOEF,X2).NE. 0 )) DO WRITE (*,'(A,5X,I3,6X,A,4(1X,F12.7,1X,A))') - '³',ITER,'³',X0,'³',X1,'³',X2,'³', - FNG(ORDO,KOEF,X2),'³' X0 = X1 X1 = X2 X2 = X1 - (FNG(ORDO,KOEF,X1)*(X1-X0))/ - (FNG(ORDO,KOEF,X1)-FNG(ORDO,KOEF,X0)) ITER = ITER + 1 PAUSE ENDWHILE CONTOH PROGRAM II V Daftar Isi III IV I VI VII 5/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

23 WRITE (*,'(A,5X,I3,6X,A,4(1X,F12.7,1X,A))') - '³',ITER,'³',X0,'³',X1,'³',X2,'³', - FNG(ORDO,KOEF,X2),'³' WRITE (*,*) 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄ - ÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ' WRITE (*,*) WRITE (*,*) 'SOLUSINYA = ',X2 END SUBROUTINE OUTPUT (ORDO,KOEF) DIMENSION KOEF(20) INTEGER ORDO WRITE (*,'(A,\)') 'F(X) = ' CONTOH PROGRAM II V Daftar Isi III IV I VI VII 6/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

24 DO 20 I = ORDO + 1, 1, -1 IF (I.GT. 2) THEN IF (KOEF(I).EQ. (-1)) THEN WRITE (*,'(A,I2,\)') '- X^',I – 1 ELSEIF ((KOEF(I).NE. 1).AND. - (KOEF(I).NE. 0)) THEN WRITE (*,'(I3,A,I2,\)') KOEF(I),'X^',I – 1 ELSEIF (KOEF(I).NE. 0) THEN WRITE (*,'(A,I2,\)') 'X^',I – 1 ENDIF IF (KOEF(I-1).GT. 0) THEN WRITE (*,'(A,\)') ' + ‘ ENDIF CONTOH PROGRAM II V Daftar Isi III IV I VI VII 7/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

25 ELSEIF (I.EQ. 2) THEN IF (KOEF(I).EQ. (-1)) THEN WRITE (*,'(A,\)') '-X ‘ ELSEIF ((KOEF(I).NE. 1).AND. - (KOEF(I).NE. 0)) THEN WRITE (*,'(I3,A,\)') KOEF(I),' X ‘ ELSEIF (KOEF(I).NE. 0) THEN WRITE (*,'(A,\)') ' X ‘ ENDIF IF (KOEF(I-1).GT. 0) THEN WRITE (*,'(A,\)') ' + ‘ ENDIF ELSEIF (KOEF(I).NE. 0) THEN CONTOH PROGRAM II V Daftar Isi III IV I VI VII 8/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

26 WRITE (*,'(I3)') KOEF(I) ENDIF 20 CONTINUE END REAL FUNCTION FNG(ORDO,KOEF,MX) INTEGER ORDO DIMENSION KOEF(20) REAL MX FNG = 0 DO 30 I = ORDO + 1, 1, -1 IF (MX.NE. 0) FNG = FNG + (KOEF(I)*MX**(I-1)) 30 CONTINUE RETURN END CONTOH PROGRAM II V Daftar Isi III IV I VI VII 9/11 Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

27 Input Persamaan =============== Orde/Derajat : 3 Koefisien X^ 3 = 1 Koefisien X^ 2 = 0 Koefisien X^ 1 = -2 Koefisien X^ 0 = -5 Persamaan yang diinput : F(X) = X^ 3 -2 X -5 CONTOH OUTPUT PROGRAM II V Daftar Isi III IV I VI VII 10/11 Bersambung ke slide berikutnya Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

28 Pencarian Akar menggunakan Metode Sekan ======================================= F(X) = X^ 3 -2 X -5 X0(Batas Bawah) = 1 X1(Batas Atas) = 2 Toleransi Kesalahan = ┌──────────┬───────────┬───────────┬───────────┬───────────────┐ │ ITERASI │ X0 │ X1 │ X2 │ F(X2) │ ├──────────┼───────────┼───────────┼───────────┼───────────────┤ │ 1 │ │ │ │ │ │ 2 │ │ │ │ │ │ 3 │ │ │ │ │ │ 4 │ │ │ │ │ └──────────┴───────────┴───────────┴───────────┴───────────────┘ Solusinya = CONTOH OUTPUT PROGRAM II V Daftar Isi III IV I VI VII 11/11 Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

29 LAPORAN AKHIR VI Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

30 1. Tuliskan Logika untuk program yang telah ditulis. 2. Logika tidak boleh sama. LAPORAN AKHIR VI Daftar Isi V VII II III IV I Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

31 LAPORAN PENDAHULUAN PERTEMUAN 6 VII Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

32 1.Sebutkan dan jelaskan metode yang dapat digunakan untuk mencari invers suatu matriks ! 2.Diketahui sebuah matriks : │ │ │ │ │ │ │ │ │ │ Tentukan : a. Matriks adjoin ? b. Eliminasi Gauus Jordan ? LAPORAN PENDAHULUAN PERTEMUAN 6 VII Daftar Isi V VI II III IV I Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.

33 Sampai bertemu lagi di Pertemuan ke 6 Daftar Isi Copyright © This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation is for education purpose only.


Download ppt "Metode Numerik & FORTRAN Mata Praktikum: Copyright © 2008. This presentation is dedicated to Laboratorium Informatika Universitas Gunadarma. This presentation."

Presentasi serupa


Iklan oleh Google