正在加载图片...
3.源程序(18分) PROGRAM MAIN DOUBLE PRECISION EPS,A,B.X,Y,S,KP1,KP2 DIMENSION X(7Y(7) N=7 EPS=1.0E-5 OPEN(6,FILE=TESTA.Txt,STATUS-UNKNOWN) DATA X/623.0,648.0,673.0,698.0,723.0,748.0,773.0/ DATA Y1-50.7898,-5L.1390,-51.4738.-51.7943,-52.1006,& .52.3929-526715/ A-623 B=773 KP1-2644 D010I=1,N XI=XO 10 Y=YXI*XⅫ CALLSIMP(N.A.B.X.Y.EPS.S) R=8.314D-03 P21=DEXP(S/R) KP2=KP1*P21 WRITE(6.20)A.B.S WRITE(6.30)B.KPz F0RMAT(1X,'S,F6.2,K->',F6.2,K=,G12.6 30 FORMAT(1X.'Kp2(.F7.2.'KG12.6.'Pa-1) END SUBROUTINESIMP(M,A,B.X,Y.EPS.S2) DOUBLEPRECISIONA.B.X.Y.EPS.S2.FA.FB.X0.Y0 DIMENSION X(M).Y(MY H=B-A N=I CALLLGRG2CX YMA FAY CALLLGRG2(X.Y.M.B.FB) T1=0.5*H*(FA+FB) 10 S=0 D020K=1N X0=A+K-0.5)*H CALLLGRG2(X.Y.M.X0.Y0) 20 S=S+Y0 T2-0.5*(T1+H*S) S2=T2+T2-T1)M3.0 3.源程序(18 分) PROGRAM MAIN DOUBLE PRECISION EPS,A,B,X,Y,S,KP1,KP2 DIMENSION X(7),Y(7) N=7 EPS=1.0E-5 OPEN(6,FILE='TESTA.Txt',STATUS='UNKNOWN') DATA X/623.0,648.0,673.0,698.0,723.0,748.0,773.0/ DATA Y/-50.7898,-51.1390,-51.4738,-51.7943,-52.1006, & -52.3929,-52.6715/ A=623 B=773 KP1=2644 DO 10 I=1,N XI=X(I) 10 Y(I)=Y(I)/(XI*XI) CALL SIMP(N,A,B,X,Y,EPS,S) R=8.314D-03 P21=DEXP(S/R) KP2=KP1*P21 WRITE(6,20) A,B,S WRITE(6,30) B,KP2 20 FORMAT(1X,'S(',F6.2,'K-->',F6.2,'K)=',G12.6) 30 FORMAT(1X,'Kp2(',F7.2,'K)=',G12.6,'Pa-1') END SUBROUTINE SIMP(M,A,B,X,Y,EPS,S2) DOUBLE PRECISION A,B,X,Y,EPS,S2,FA,FB,X0,Y0 DIMENSION X(M),Y(M) H=B-A N=1 CALL LGRG2(X,Y,M,A,FA) CALL LGRG2(X,Y,M,B,FB) T1=0.5*H*(FA+FB) 10 S=0 DO 20 K=1,N X0=A+(K-0.5)*H CALL LGRG2(X,Y,M,X0,Y0) 20 S=S+Y0 T2=0.5*(T1+H*S) S2=T2+(T2-T1)/3.0
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有