CALLRK4(TO.Y0.Y1.HO.N.K) D030KK=1,100 CALL RK4(TO,YO.Y2.,H.N.K) ES=0.0 DO10EIN ES=ES+ABS((Y2(J)-Y1(J)V/Y2(J) IF(ES.LT.EPS)G 0T050 D020J=1,N 20 YI(Y2() CONTINUE WRITE(6.33) STOP 50 T0=T0+H0 D060J=1.N YO(J)=Y2(J) WRITE(6 22TO HCY20DI=LN) WRITE(6.44) FORMAT(/1XN=,2,2X'T0=,F6.1,2XT1=,F8.1,2X,& H0=,G83,1XEPS=,G10.320X,Y0,=1,2,3,4,N”& 1X.66(1H-)/5X.'t/min'.3X.'H/min'.6X.'[Al/molL-1' 6X.[B/molL-I.6X.[Cl/molL-I.6X.[Dl/molL-1/1X.66(1H-)) 2 FORMAT(IX.2F822X.4GI5.6) FORMAT(/1X,'FAILED TO FIND STABLE SOLUTION IN MAX IT/) FORMAT(1X.66(1H-)) END SUBROUTINE F(Y.DY) IMPLICIT REAL *8A-H0-Z REAL8 KI.K2.K3 DIMENSION Y(10LDY(10) DATA K1/0.0138/K2/2.76E-04/K3/7.2E-04/ DY(1=K1*Y(1)*YI+K2*Y(2K3*Y(1)*Y3) DY(2-K1Y()Y()-K2-Y(2) DY(3=K3*Y(1)*Y(3) DY(4)=K3*Y(1)*Y(3) RETURN END SUBROUTINERK4(X0,Y0.Y.H.N.M IMPLICIT REAL 8(A-H.O-Z) DIMENSION YO(N).Y(N) CALL RK4(T0,Y0,Y1,H0,N,K) DO 30 KK=1,100 K=K+K H=H0/K CALL RK4(T0,Y0,Y2,H,N,K) ES=0.0 DO 10 J=1,N 10 ES=ES+ABS((Y2(J)-Y1(J))/Y2(J)) IF(ES.LT.EPS)GOTO 50 DO 20 J=1,N 20 Y1(J)=Y2(J) 30 CONTINUE WRITE(6,33) STOP 50 T0=T0+H0 DO 60 J=1,N 60 Y0(J)=Y2(J) WRITE(6,22)T0,H,(Y2(I),I=1,N) 80 CONTINUE WRITE(6,44) 11 FORMAT(/1X,'N=',I2,2X,'T0=',F6.1,2X,'T1=',F8.1,2X, & 'H0=',G8.3,1X,'EPS=',G10.3//20X,'Y(I),I=1,2,3,4,...,N' & 1X,66(1H-)/5X,'t/min',3X,'H/min',6X,'[A]/molL-1', & 6X,'[B]/molL-1',6X,'[C]/molL-1',6X,'[D]/molL-1'/1X,66(1H-)) 22 FORMAT(1X,2F8.2,2X,4G15.6) 33 FORMAT(/1X,'FAILED TO FIND STABLE SOLUTION IN MAX IT'/) 44 FORMAT(1X,66(1H-)) END SUBROUTINE F(Y,DY) IMPLICIT REAL *8(A-H,O-Z) REAL *8 K1,K2,K3 DIMENSION Y(10),DY(10) DATA K1/0.0138/,K2/2.76E-04/,K3/7.2E-04/ DY(1)=-K1*Y(1)*Y(1)+K2*Y(2)-K3*Y(1)*Y(3) DY(2)=K1*Y(1)*Y(1)-K2*Y(2) DY(3)=-K3*Y(1)*Y(3) DY(4)=K3*Y(1)*Y(3) RETURN END SUBROUTINE RK4(X0,Y0,Y,H,N,M) IMPLICIT REAL *8(A-H,O-Z) DIMENSION Y0(N),Y(N)