正在加载图片...
3.源程序(30分) PROGRAM MAIN IMPLICIT REAL*8(A-H.O-Z DIMENSION YO(20),Y1(20),Y2(20) OPEN(6,FILE-TESTC.DAT,STATUS-'UNKNOWN) DATA Y0/0.01,0.0,0.0,17*0.0/ N-3 T0-0.0 T1=10.0 H0-0.5 EPS=1.0E-6 H=HO WRITE(6.11)N.TO,T1,H0.EPS WRITE(6.22)T0.H.(Y0(D.I-1.N M=IDINT((TI-TOVHO+0.5) D08010=1,M K=1 CALLRK4(TO.Y0.Y1.HO.N.K) D030KK=1,100 K-K+K H=HO/K CALLRK4(TO,Y0.Y2.H.N.K) ES=0.0 D010J=,N 10 ES-ES+ABS(Y2U)-Y10VY2U) IF(ES.LT.EPS)GOTO 50 D020J=1N YI(EY2() CONTINUE WRITE(6.3 3 STOP 50 T0=T0+H0 D060J=1,N 60 YOCY20) WRITE(6.22)T0.H.(Y2(T).I-1.N) 80 CONTINUE WRITE(6.44) 11 FORMATO/1XN=,2,2X,T0=,F6.1,2XT1=,F8.1,2X,& H0=.G8.3,1X,EPS=,G10.3/20X,Y①.=1,2,3.4N& 1X.66(1H-)/5X.'Umin'.3X.'H/min'.6X.'[A]/molL-I', 6X.[BlmolL-T'.6X.(CVmolL-T/1X.66(1H-) 22 F0RMAT(1X,2F8.2,2X,3G15.6) 33 FORMAT(/IX,'FAILED TO FIND STABLE SOLUTION IN MAX IT/) 44 FORMAT(IX.66(1H-))3.源程序(30 分) PROGRAM MAIN IMPLICIT REAL *8(A-H,O-Z) DIMENSION Y0(20),Y1(20),Y2(20) OPEN(6,FILE='TESTC.DAT',STATUS='UNKNOWN') DATA Y0/0.01,0.0,0.0,17*0.0/ N=3 T0=0.0 T1=10.0 H0=0.5 EPS=1.0E-6 H=H0 WRITE(6,11)N,T0,T1,H0,EPS WRITE(6,22)T0,H,(Y0(I),I=1,N) M=IDINT((T1-T0)/H0+0.5) DO 80 I0=1,M K=1 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' /1X,66(1H-)) 22 FORMAT(1X,2F8.2,2X,3G15.6) 33 FORMAT(/1X,'FAILED TO FIND STABLE SOLUTION IN MAX IT'/) 44 FORMAT(1X,66(1H-))
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有