Académique Documents
Professionnel Documents
Culture Documents
Group L - Avijit Ghosh, S N Aditya Murthy, Aditya Goenka
Equations used:
∑
0 ≤ α < 1 and xi − 1 < tolerance
Program (Pseudocode):
A python program was used to code the program. The pseudocode is as follows:
#Defining Constants
import math,random
A <- [6.6438,6.82915,6.80338,6.80776]
B <- [395.74,663.72,804.00,935.77]
C <- [266.68,256.68,247.00,238.80]
Z <- [0.1, 0.25, 0.5, 0.15]
Pt <- 2*760
FUNCTION Psat(j):
return math.pow(10,(A[j]-(B[j]/(C[j]+50))))
FUNCTION k(j):
return Psat(j)/Pt
FUNCTION x(j,a):
return Z[j]/(1+(a*(k(j)-1)))
FUNCTION y(j,a):
return k(j)*x(j,a)
FUNCTION f(a):
s <- 0
for j in range(4):
s += Z[j]*(1-k(j))/(1+(a*(k(j)-1)))
ENDFOR
return s
FUNCTION sum_x(a):
s=0
for j in range(4):
s += x(j,a)
ENDFOR
return s
for i in range(4):
OUTPUT "The value of x"+str(i+1)+" is: "+ str(x(i,a3))
ENDFOR
for i in range(4):
OUTPUT "The value of y"+str(i+1)+" is: "+ str(y(i,a3))
ENDFOR
Output:
For P = 25 atm:
For P = 15 atm and 2 atm the algorithm never converges, this is because for these two cases the
value of alpha is >1, which is not a feasible solution.