15
Flowchart Diferensiasi Numeris cara Forward Cara Forward : Dengan contoh soal : 10 REM Difereansiasi numeris dengan cara Forward 20 REM Oleh : WBS dan AP 30 REM Yogyakarta, 21 Desember 1994 40 CLS 50 INPUT “Harga x0 = “ , X0 60 INPUT “Interval diferensiasi = “ , EPS 70 X=X0+EPS 80 GOSUB 500 90 FPLUS=FX 100 X=X0-EPS 110 GOSUB 500 120 FMIN=FX 130 DFDX=(FPLUS-FMIN)/2/EPS 140 PRINT 150 PRINT “dy/dx pada x0 = “;X0;” adalah “;DFDX 160 END 500 REM subroutine menghitung F (X) 510 FX = X^3/3+X^2/4+1

Tugas Flowchart Komputasi Proses

  • Upload
    kdkade

  • View
    279

  • Download
    10

Embed Size (px)

DESCRIPTION

Flowchart Komputasi Proses- Metode Diferensiasi Numeris (Forward, Backward, Central)- Metode Bisection- Metode Simpson- Metode Newton-Raphson

Citation preview

Page 1: Tugas Flowchart Komputasi Proses

Flowchart Diferensiasi Numeris cara Forward Cara Forward :

Dengan contoh soal :

10 REM Difereansiasi numeris dengan cara Forward

20 REM Oleh : WBS dan AP

30 REM Yogyakarta, 21 Desember 1994

40 CLS

50 INPUT “Harga x0 = “ , X0

60 INPUT “Interval diferensiasi = “ , EPS

70 X=X0+EPS

80 GOSUB 500

90 FPLUS=FX

100 X=X0-EPS

110 GOSUB 500

120 FMIN=FX

130 DFDX=(FPLUS-FMIN)/2/EPS

140 PRINT

150 PRINT “dy/dx pada x0 = “;X0;” adalah “;DFDX

160 END

500 REM subroutine menghitung F (X)

510 FX = X^3/3+X^2/4+1

Page 2: Tugas Flowchart Komputasi Proses

JAWABAN:

Page 3: Tugas Flowchart Komputasi Proses

Flowchart Diferensiasi Numeris cara Backward Cara Forward :

Dengan contoh soal :

10 REM Difereansiasi numeris dengan cara Backward

20 REM Oleh : WBS dan AP

30 REM Yogyakarta, 21 Desember 1994

40 CLS

50 INPUT “Harga x0 = “ , X0

60 INPUT “Interval diferensiasi = “ , EPS

70 X=X0+EPS

80 GOSUB 500

90 FPLUS=FX

100 X=X0-EPS

110 GOSUB 500

120 FMIN=FX

130 DFDX=(FPLUS-FMIN)/2/EPS

140 PRINT

150 PRINT “dy/dx pada x0 = “;X0;” adalah “;DFDX

160 END

500 REM subroutine menghitung F (X)

510 FX = X^3/3+X^2/4+1

Page 4: Tugas Flowchart Komputasi Proses

JAWABAN :

Page 5: Tugas Flowchart Komputasi Proses

Flowchart Diferensiasi Numeris cara Center Cara Forward :

Dengan contoh soal :

10 REM Difereansiasi numeris dengan cara Center

20 REM Oleh : WBS dan AP

30 REM Yogyakarta, 21 Desember 1994

40 CLS

50 INPUT “Harga x0 = “ , X0

60 INPUT “Interval diferensiasi = “ , EPS

70 X=X0+EPS

80 GOSUB 500

90 FPLUS=FX

100 X=X0-EPS

110 GOSUB 500

120 FMIN=FX

130 DFDX=(FPLUS-FMIN)/2/EPS

140 PRINT

150 PRINT “dy/dx pada x0 = “;X0;” adalah “;DFDX

160 END

500 REM subroutine menghitung F (X)

510 FX = X^3/3+X^2/4+1

Page 6: Tugas Flowchart Komputasi Proses

JAWABAN :

Page 7: Tugas Flowchart Komputasi Proses

10 REM mencari akar pers. dengan metode BISECTION

20 REM oleh WBS dan AP

30 REM Yogyakarta, 22 desember 1994

40 CLS

50 INPUT “Batas bawah interval=”;XA

60 INPUT “Batas atas interval=”;XB

70 INPUT “Toleransi=”;TOL

80 PRINT

90 X=XA

100 GOSUB 1000

110 FXA=FX

120 X=XB

130 GOSUB 1000

140 FXB=FX

150 IF (FXA*FXB)<=0 THEN 190

160 PRINT

170 PRINT “Interval awal salah!”

180 GOTO 380

190 PRINT TAB(3);”xa”;TAB(15);”xb”;TAB(29);”f(xa)”;TAB(44);”f(xb)”

200 PRINT TAB(3);”----”;TAB(15);”----”;TAB(29);”----”;TAB(44);”----”

210 PRINT TAB(2);XA;TAB(14);XB;TAB(28);FXA;TAB(43);FXB

220 IF FXA=0 THEN X=XA : FX=FXA : GOTO 360

230 IF FXB=0 THEN X=XB : FX=FXB : GOTO 360

240 IF (XB-XA)<TOL THEN 320

250 XM=(XA+XB)/2

260 X=XM:FXA=FXM

Page 8: Tugas Flowchart Komputasi Proses

270 IF (FXA*FXM)<0 THEN 300

280 XA=XM:FXB=FXM

290 GOTO 210

300 XB=XM:FXB=FXM

310 GOTO 120

320 X=(XA+XB)/2

330 GOSUB 1000

340 PRINT TAB(3);”----“;TAB(15);”----“;TAB(29);”----“;TAB(44);”----“

350 PRINT

360 PRINT “akar persamaan=”;X

370 PRINT “F(x)=”;FX

380 END

1000 REM menghitung F(x)

1010 FX=X^3-8

1020 RETURN

Page 9: Tugas Flowchart Komputasi Proses

XB=XM

FXB=FXM

X=(XA+XB)/2

PRINT akar pers.X, f(x)=FX

SELESAI

B

A

MULAI

INPUTXA,XB,€

PRINT JUDUL KOLOM X=XA A

FX=X^3-8

FXA=FX

PRINT Interval awal salah FXA*FXB≤0

PRINT XA,XB,f(XA), f(XB) FXA=0;X=XA;FX=FXA

A B

X=XB

A B

FXB=FX

FXA=0;X=XA;FX=FXB

(XB-XA)<€XM=(XA+XB)/

2

X=XM

FXM=FX

FXA*FXM<0XA=XM

XA=FXM

Page 10: Tugas Flowchart Komputasi Proses

REM integrasi numeris-metode simpson

REM bentuk fungsi : y = exp(x) + sqr(x)

CLS

PRINT “Batas bawah integrasi =”;:INPUT XO

PRINT “Batas atas integrasi =”;: INPUT XN

PRINT “Jumlah interval =”;: INPUT N

DELX = (XN-XO)/N

REM perhitungan integrasi numeris dengan rumus simpson

AREA = 0

X = XN

GOSUB 10

AREA = AREA + Y

FOR I = 1 TO N - 1

X = XO + I * DELX

GOSUB 10

Y = 2 * Y

IF ((-1) ^ I < 0) THEN Y = 2 * Y

AREA = AREA + Y

NEXT I

X = XN

GOSUB 10

AREA = AREA + Y

AREA = AREA * DELX/3

PRINT

PRINT “Hasil hitungan : ”

PRINT “-----------------”

PRINT “Hasil integrasi = ”; AREA

PRINT: PRINT “--selesai--”

END

10 ‘SUBROUTINE MENGHITUNG Y

Y = EXP(X) + SQR(X)

RETURN

Page 11: Tugas Flowchart Komputasi Proses

MULAI

PRINTX0,XN,N

PRINTHasil hitungan, hasil

integrasi

PRINTJUDUL KOLOM

AREA=0

X=XN

FOR I=1 To N-1ɑ=X0+I*DELX

A

A

NEXT I

AREA=AREA+Y

Y=2*Y

IF((-1)^I<0

X=XN

A

AREA=AREA+Y

AREA=AREA*DELX/

B

SELESAI

A By = EXP(X) + SQR (X)

Page 12: Tugas Flowchart Komputasi Proses

10 REM mencari akar pers. dengan newton-rapshon

20 REM diferensial analitis

40 yogyakarta, 22 desember 1994

50 CLS

60 INPUT “harga awal x=”;XOLD

70 INPUT “toleransi=”;TOL

80 PRINT

90 PRINT TAB(6);”x-old”;TAB(18);”f(x-old)”

100 PRINT TAB(6);”----“;TAB(18);”--------“

110 X=XOLD

120 GOSUB 1000

130 PRINT TAB(5);XOLD;TAB(17);FX

140 XNEW=XOLD-FX/DFX

150 IF ABS (XNEW-XOLD)<TOL YHEN 180

160 XOLD=XNEW

170 GOTO 110

180 X=XNEW

190 GOSUB 1000

200 PRINT TAB(6);”-----“;TAB;”------“

210 PRINT

220 PRINT “akar persamaan, x=”;XNEW

230 END

1000 REM menghitung f(x) dan f’(x)

1010 FX=X^3-8

1020 DFX=3*X^2

1030 RETURN

Page 13: Tugas Flowchart Komputasi Proses

MULAI

INPUTXA, ,€ᶓ

PRINT JUDUL KOLOM X=XA A X=XA

PRINT XA,FA

X=XA-€

X=XA+€

DFDX=(FPLUS-FMIN)/(2*€)

XB=XA-FA/DFDX

XB-XA<ᶓ

X=XB

A

XA=XB

B PRINT akar pers. x=XB,f(x)=FX

SELESAI

FX=X^3-8A B