Fortran 4

  • 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 4 as PDF for free.

More details

  • Words: 336
  • Pages: 6
Berikut merupakan kasus penggunaan fortran untuk menghitung hubungan antara Konversi Maksimal dengan suhu operasi Pada perhitungan ini digunakan metode penghitungan Golden section sebagai main progam untuk memaksimasi konversi dan metode runge kuta sebagai sub rutin untuk mengerjakan pengintegrasian secara numeris

C Rendy Kurniawan C Task 4 c 07/250822/TK/32411 winapp real*8 el,ell,n,toa,tob,tp,tq,wa,wb,wp,wq,topt,wopt,dz,tolt common/task4/dz,eLL,N

c Data Main Program tolt=0.1 eLL=1000 N=1000 dz=eLL/N el=((5**0.5)-1)/2 toa=400 tob=475

c Output Label write(*,*)'------------------------------------------------------' write(*,*)'******** Rendy Kurniawan 07/250822/TK/32411 *********' write(*,*)'------------------------------------------------------' write(*,*)' write(*,*)'

Task 4' Computer Programming class B'

write(*,*)'------------------------------------------------------'

c Main Program call calculate w(toa,wa) call calculate w(tob,wb) tp=toa+(1-el)*(tob-toa) call calculate w(tp,wp) tq=toa+(el)*(tob-toa) call calculate w(tq,wq)

while (abs(tob-toa).gt.tolt) do write(*,*)toa,tob,wa,wb if(wp.lt.wq) then toa=tp wa=wp wb=wb tob=tob tp=tq wp=wq tq=toa+el*(tob-toa) call calculate w(tq,wq) else toa=toa wa=wa tob=tq wb=wq tq=tp wq=wp tp=toa+(1-el)*(tob-toa) call calculate w(tp,wp) end if

end while topt=(toa+tob)/2 call calculate w(topt,wopt)

c Iteration finish write(*,*)'Optimation Temperature is' write(*,*)topt,'KELVIN' write(*,*)'Maximum Convertion' write(*,*)wopt,'Mole Fraction' end

c Subroutine Runge-Kutta subroutine calculate w(t,xf) real*8 ell,N,ka1,ka2,ka3,ka4,L1,L2,L3,L4,tzero,zo,xo,xf,dt,dx,dz,t common/task4/dz,eLL,N zo=0 xo=0 tzero=t while(zo.LE.ell)do call calculate kl(zo,xo,tzero,ka1,L1) call calculate kl(zo+dz/2,xo+ka1/2*dz,tzero+L1/2*dz,ka2,L2) call calculate kl(zo+dz/2,xo+ka2/2*dz,tzero+L2/2*dz,ka3,L3) call calculate kl(zo+dz,xo+ka3*dz,tzero+L3*dz,ka4,L4) dx=(ka1+2*ka2+2*ka3+ka4)*dz/6 dt=(L1+2*L2+2*L3+L4)*dz/6 zo=zo+dz tzero=tzero+dt xo=xo+dx end while

Xf=(Xo) end

c Subroutine DX/DZ and DT/DZ subroutine calculate KL(Z,X,T,Ka,L) real*8 phi,d,p,r,u,ca,cb,cc,ci,enthalpy,fo,k little,k big real*8 ka1,ka2,ka3,ka3a,ka3b,ka4,ka5,ka real*8 L1,L2,L3,L3a,L3b,L3c,L real*8 z,t,x

k little=10000*exp(-6500/t) k big=exp(2-3850/t) phi=22/7 d=35 p=7 r=82 u=0.0085 ca=20 cb=10 cc=15 ci=10 enthalpy=(-35000)+(cb+cc-ca)*(t-273) fo=10

ka1=phi*(d**2)*p/3.6/fo/r ka2=k little/t ka3a=(0.9*(1-x)/(1+0.9*x)) ka3b=(0.9*x/(1+0.9*x))**2 ka4=p/r/t

ka5=1/k big ka3=ka3a-ka3b*ka4*ka5

ka=ka1*ka2*ka3 ka=(ka)

L1=0.9*fo*(-enthalpy)*(ka) L2=U*phi*d*(t-421) L3a=0.9*(1-x)*ca L3b=0.9*x*(cb+cc) L3c=0.1*(ci) L3=fo*(L3a+L3b+L3c)

L=(L1-L2)/L3 end

c

run output:

c -----------------------------------------------------c ******** Rendy Kurniawan 07/250822/TK/32411 ********* c -----------------------------------------------------c

Task 4

c

Computer Programming class B

c -----------------------------------------------------c 400.000000000 475.000000000 4.793916969800E-02 0.999219995599 c 428.647449613 475.000000000 6.433778287661E-02 0.999219995599 c 446.352550387 475.000000000 8.454050208346E-02 0.999219995599 c 457.294901978 475.000000000 0.108747722306

0.999219995599

c 464.057648409 475.000000000 0.138338851369

0.999219995599

c 468.237254620 475.000000000 0.178476602686

0.999219995599

c 470.820393789 475.000000000 0.261328272401

0.999219995599

c 470.820393789 473.403532556 0.261328272401

0.999635024047

c 470.820393789 472.416861233 0.261328272401

0.999839581726

c 471.430190064 472.416861233 0.383811681579

0.999839581726

c 471.807064958 472.416861233 0.999859455489

0.999839581726

c 471.807064958 472.183939792 0.999859455489

0.999875851305

c 471.807064958 472.039986399 0.999859455489

0.999895572833

c 471.807064958 471.951018329 0.999859455489

0.999906174241

c Optimation Temperature is c

471.906534289

KELVIN

c Maximum Convertion c

0.999909715417

Mole Fraction

Related Documents

Fortran 4
June 2020 14
Fortran
October 2019 25
Fortran
October 2019 28
Fortran Lesson
November 2019 21
Fortran Resources
April 2020 13

More Documents from "JoW Rocks"