12.2(a2) NON-IDEAL VAPOR-LIQUID AND LIQUID-LIQUID EQUILIBRIUM |POLVER05_1 |2
# Problem 12.2 - Dew Point
f(x1) = x1 - y1 / k1 # Mole fraction of comp. 1 in the liquid phase
f(x2) = x2 - y2 / k2 # Mole fraction of comp. 2 in the liquid phase
f(T) = x1 + x2 - 1 # Dew point temp. Deg C.
# The explicit equations
p1 = 10 ^ (7.62231 - 1417.9 / (191.15 + T)) # Vapor pressure of 1st component (mmHg)
p2 = 10 ^ (8.10765 - 1750.29 / (235 + T)) # Vapor pressure of 2nd component (mmHg)
A = 1.7 # Van Laar equations constant A
B = 0.7 # Van Laar equations constant B
gamma1 = 10 ^ (A * x2 * x2 / ((A * x1 / B + x2) ^ 2)) # Activity coefficient of comp. 1 in the liquid phase
gamma2 = 10 ^ (B * x1 * x1 / ((x1 + B * x2 / A) ^ 2)) # Activity coefficient of comp. 2 in the liquid phase
k1 = gamma1 * p1 / 760 # Vapor liquid equlibrium ratio of comp. 1
k2 = gamma2 * p2 / 760 # Vapor liquid equlibrium ratio of comp. 2
y1 = 0.2 # Mole fraction of comp. 1 in the vapor phase
y2 = 0.8 # Mole fraction of comp. 2 in the vapor phase
# Initial Guess for nonlinear equations variables
x1(0) = 0.2
x2(0) = 0.8
T(0) = 100