Elementary Principles 470

# Elementary Principles 470 - 100 XCM(I) = XC(I) 110 K = K +...

This preview shows page 1. Sign up to view the full content.

10- 22 10.14 C ** CHAPTER 10 -- PROBLEM 14 DIMENSION XA(3), XC(3) N = 2 EPS = 0.001 KMAX = 20 IPR = 1 XA(1) = 2.0 XA(2) = 2.0 CALL CONVG (XA, XC, N, KMAX, EPS, IPR) END C SUBROUTINE FUNCGEN(N, XA, XC) DIMENSION XA(3), XC(3) XC(1) = 0.5*(3. – XA(2) + (XA(1) + XA(2))**0.5 XC(2) = 4. – 5./(XA(1) + XA(2)) RETURN END C SUBROUTINE CONVG (XA, XC, N, KMAX, EPS, IPR) DIMENSION XA(3), XC(3), XAH(3), XCM(3) K = 1 CALL FUNCGEN (N, XA, XC) IF (IPR.EQ.1) CALL IPRNT (K, XA, XC, N) DO 100 I = 1, N XAM(I) = XA(I) XA(I) = XC(I)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 100 XCM(I) = XC(I) 110 K = K + 1 CALL FUNCGEN (N, XA, XC) IF (IPR.EQ.1) CALL IPRNT (K, XA, XC, N) D0 200 I = 1, N IF (ABS ((XA(I) - XC(I))/XC(I)).GE.EPS) GOTO 300 200 CONTINUE C Convergence RETURN 300 IF(K.EQ.KMAX) GOTO 500 DO 400 I = 1, N W = (XC(I) XCM(I))/(XA(I) XAM(I)) Q = W/(W 1.) IF (Q.GT.0.5) Q = 0.5 IF (Q.LT.5) Q = 5. XCM(I) = XC(I) XAM(I) = XA(I) 400 XA(I) = Q = XAM(I) + (1. Q)*XCM(I) GOTO 110 500 WRITE (6, 900) 900 FORMAT (' CONVG did not converge') STOP END...
View Full Document

## This note was uploaded on 02/27/2012 for the course CHEMICAL E 312 taught by Professor Cheung during the Fall '11 term at The University of Akron.

Ask a homework question - tutors are online