Sei sulla pagina 1di 5

M.

RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014

PROGRAM PERSAMAAN NON LINEAR

WRITE(*,*)"PROGRAM MENGHITUNG PERSAMAAN NON LINEAR"

WRITE(*,*)

WRITE(*,*)"OLEH M.RIZKY HARI SAPUTRA"

WRITE(*,*)

1 WRITE(*,*)"Metode : "

WRITE(*,*)"1. Bisection "

WRITE(*,*)"2. Newton - Raphson "

WRITE(*,*)

WRITE(*,*)"Pilihan Anda : "

READ(*,*)T

IF(T.EQ.1 ) THEN

WRITE(*,*)"Anda Memilih Metode Bisection"

WRITE(*,*)

WRITE(*,*)" Ketelitian 2 Desimal "

WRITE(*,*)

WRITE(*,*)" F(X): 3X^3+4X^2+3X-5"

WRITE(*,*)

2 WRITE(*,*)"Masukkan Nilai A pada Fungsi : "

READ(*,*)A

FA = 3*(A**3)+4*(A**2)+3*A-5

WRITE(*,*)"F(A) : ",FA

WRITE(*,*)

WRITE(*,*)"Masukkan Nilai B pada Fungsi "

READ(*,*)B

M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014 1


M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014

FB = 3*(B**3)+4*(B**2)+3*B-5

WRITE(*,*)"F(B) : ",FB

WRITE(*,*)

WRITE(*,*)"Pengecekan Nilai A dan B"

WRITE(*,*)

IF(FA.NE.FB) THEN

C = (A+B)/2

FC = 3*(C**3)+4*(C**2)+3*C-5

WRITE(*,*)"C = (A+B)/2"

WRITE(*,*)

WRITE(*,*)"Nilai C : ",C

WRITE(*,*)"F(C) : ",FC

WRITE(*,*)

WRITE(*,*)"Lakukan Iterasi Ke - 1"

WRITE(*,*)

WRITE(*,*)

B1 = B

C1 = C

FC1 = 3*(C1**3)+4*(C1**2)+3*C1-5

FB1 = 3*(B1**3)+4*(B1**2)+3*B1-5

WRITE(*,*)""

M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014 2


M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014

WRITE(*,*)"F(A) : ",FC1

WRITE(*,*)

WRITE(*,*)"F(B) : ",FB1

C1 = (B1+C1)/2

FC1 = 3*(C1**3)+4*(C1**2)+3*C1-5

WRITE(*,*)

WRITE(*,*)" C : ",C1

WRITE(*,*)"F(C) : ",FC1

WRITE(*,*)

WRITE(*,*)"Lakukan Iterasi Ke - 2"

WRITE(*,*)

WRITE(*,*)

B2 = C

C2 = C1

FC2 = 3*(C2**3)+4*(C2**2)+3*C2-5

FB2 = 3*(B2**3)+4*(B2**2)+3*B2-5

WRITE(*,*)""

WRITE(*,*)"F(A) : ",FC2

WRITE(*,*)

WRITE(*,*)"F(B) : ",FB2

C2 = (B2+C2)/2

FC2 = 3*(C2**3)+4*(C2**2)+3*C2-5

M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014 3


M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014

WRITE(*,*)

WRITE(*,*)"C : ",C2

WRITE(*,*)"F(C) : ",FC2

ELSE IF(FA.EQ.FB) THEN

WRITE(*,*)"Pilih Nilai Awal yang Baru"

WRITE(*,*)

GOTO 2

END IF

ELSE IF(T.EQ.2) THEN

END IF

WRITE(*,*)"Ingin Menghitung Lagi ?"

WRITE(*,*)"1. Gas"

WRITE(*,*)"2. Wes,ngelu ndas ku"

WRITE(*,*)

WRITE(*,*)"Pilihan Anda : "

READ(*,*)P

IF(P.EQ.1 ) THEN

GOTO 1

ELSE IF(P.EQ.2) THEN

M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014 4


M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014

WRITE(*,*)

WRITE(*,*)"Suwun Bro"

END IF

STOP

END

M.RIZKY HARI SAPUTRA/125060101111008/18/TUGAS PROKOM/8 MEI 2014 5