Ce 311K Lab13 - Program lab13 implicit none ! Declaration...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Program lab13 implicit none ! Declaration of variables double precision C1_Eul, C2_Eul, C1_RK2, C2_RK2, C1_RK4, C2_RK4 double precision C1_old, C2_old real Termin double precision time, h integer Num,i Open(unit=6, file='Euler.dat', status='unknown') Open(unit=7, file='Rk2.dat', status='unknown') Open(unit=8, file='Rk4.dat', status='unknown') Open(unit=9, file='C1.dat', status='unknown') Open(unit=10, file='C2.dat', status='unknown') ! Initialization h = 1 Termin = 100 Num = Termin/h time=h ! Writing headers Write(6,50) Write(7,50) Write(8,50) 50 Format(40('='),/,'time (days) C1 (g/m3) C2 (g/m3)',/,40('=')) ! Calculation of concentrations c1_Eul=0 c2_Eul=0 c1_Rk2=0 c2_Rk2=0 c1_Rk4=0 c2_Rk4=0 Do i=1,Num ! Using Euler method C1_old=C1_Eul C2_old=C2_Eul Call Euler(C1_old,C2_old,h,C1_Eul,C2_Eul) Write(6,100) time, C1_Eul, C2_Eul ! Using second order Runge-Kutta method C1_old=C1_RK2 C2_old=C2_RK2 Call RK2(C1_old,C2_old,h,C1_Rk2,C2_Rk2) Write(7,100) time, C1_RK2, C2_RK2 ! Using fourth order Runge-Kutta method
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Ce 311K Lab13 - Program lab13 implicit none ! Declaration...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online