Fortran Case : Menghitung Volume Optimum

  • Uploaded by: septiadhi wirawan
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Fortran Case : Menghitung Volume Optimum as PDF for free.

More details

  • Words: 203
  • Pages: 4
Berikut merupakan contoh kasus yang paling basic diajarkan, dengan menggunakan metode Newton Raphson, Mahasiwa diuji logikanya untuk melakukan iterasi, menggunakan perhitungan yang berulang, sehingga terbentuk “Loop” Berikut merupakan kasus untuk menghitung volume reactor menggunakan metode newton raphson dengan subrutin persamaan redrich kwong

C 234567 C Septiadhi Wirawan C Tugas 1 C 07/250925/TK/32472

c Deklarasi common/EOS/a,b,omega,Pc,Tc,R,Vo,dV,tolV,s,alfa,P,T real*8 a,b,omega,Pc,Tc,R,Vo,dV,tolV,s,alfa,V integer iter,itermax write(*,*)'

Septiadhi Wirawan Tk/32472

write(*,*)'

Tugas 1

'

'

write(*,*)' Mencari Nilai V menggunakan metode Newton-Rhapson ' write(*,*)'========================================== ============' write(*,*)'Jumlah Iterasi

V1

Fnol

'

write(*,*)'========================================== ============'

T=500.0 P=40.0 Tc=425.5 Pc=3797/101.325 omega=0.1931

R=0.08206 Vo=R*T/P dV=0.01 tolV=0.001 itermax=100 iter=0

c Main Program metode Newton Raphson do while(iter.LE.itermax) iter=iter+1 call hitungF(Vo,Fo) call hitungF(Vo+dV,Fp) call hitungF(Vo-dV,Fm) Faks=(Fp-Fm)/2/dv V1=Vo-Fo/Faks if(abs(V1-Vo).GT.tolV)then Vo=V1 else V=V1 iter=itermax+1

endif

write(*,*)iter,V1,Fo enddo write(*,*)'Hasil seletah dilakukan iterasi maka nilai V adalah:'

write(*,*)V,'liter' end

c Subroutine menghitung nilai F subroutine hitungF(V,F) real*8 a,b,omega,Pc,Tc,R,Vnol,dV,tolV,s,alfa,V common/EOS/a,b,omega,Pc,Tc,R,Vnol,dV,tolV,s,alfa,P,T s=0.48508+1.5517*omega-0.1561*omega*omega a=0.4278*R*R*Tc*Tc/Pc b=0.0867*R*Tc/Pc alfa=(1+s*(1-(T/Tc)**0.5))**2 F=R*T/(V-b)-a*alfa/V/(V-b)-P end

Hasil RUN progam: c

Septiadhi Wirawan Tk/32472

c c

Tugas 1 Mencari Nilai V menggunakan metode Newton-Rhapson

c ================================================== ==== c Jumlah Iterasi

V1

Fnol

c ================================================== ==== c

1

0.579714

-9.12158

c

2

0.605534

0.207753

c

3

0.600356

c

101

0.600189

-6.673473E-02 -2.014705E-03

c Hasil seletah dilakukan iterasi maka nilai V adalah: c

0.600188612938

liter

Related Documents


More Documents from ""