Published on *PNG 520: Phase Behavior of Natural Gas and Condensate Fluids* (https://www.e-education.psu.edu/png520)

We have essentially reduced the typical VLE problem to that of solving a system of non-linear algebraic equations. The *objective function* is the nucleus of the VLE calculation. Rather than solve the material balance equations in their elemental form, the use of an objective function will allow for a more stable iteration scheme. We have seen that three objective functions are available for this calculation:

$${F}_{y}({\alpha}_{g})={\displaystyle \sum _{i=1}^{n}\frac{{z}_{i}{K}_{i}}{1+{\alpha}_{g}({K}_{i}-1)}-1=0}$$

$${F}_{x}({\alpha}_{g})={\displaystyle \sum _{i=1}^{n}\frac{{z}_{i}}{1+{\alpha}_{g}({K}_{i}-1)}-1=0}$$

$$F({\alpha}_{g})={\displaystyle \sum _{i=1}^{n}\frac{{z}_{i}({K}_{i}-1)}{1+{\alpha}_{g}({K}_{i}-1)}=0}$$

Expression (17.7c) is the *Rachford-Rice Objective Function*; we have proven that its numerical solution is cleaner than that of equations (17.7a) and (17.7b). We also discussed that the key problem in solving for “${\alpha}_{g}$” is the need for values for the equilibrium ratios (K_{i}’s). With the aid of equations (17.5) and (17.6) these problems can be solved simultaneously by iteration techniques.

In the problem we have posed, we have (3n+1) unknowns:

$${K}_{i}\text{}i=1,\text{}2,\text{}...\text{}n$$

$${y}_{i}\text{}i=1,\text{}2,\text{}...\text{}n$$

$${x}_{i}\text{}i=1,\text{}2,\text{}...\text{}n$$

And, ${\alpha}_{g}$

And we also have (3n+1) equations:

$${K}_{i}=\frac{{\varphi}_{i}^{L}(P,T,{x}_{i})}{{\varphi}_{i}^{V}(P,T,{y}_{i})}i=1,2,...n$$

$${y}_{i}={K}_{i}{x}_{i}\text{}i=1,2,...n$$

$${x}_{i}=\frac{{z}_{i}}{1+{\alpha}_{g}({K}_{i}-1)}\text{}i=1,2,...n$$

$$\sum _{i=1}^{n}\frac{{z}_{i}({K}_{i}-1)}{1+{\alpha}_{g}({K}_{i}-1)}=0$$

where P, T, and z_{i} are the values that we know. See how this is only a restatement of the original set of equations that contain the equilibrium conditions, material balances, and molar fraction constraints:

$${f}_{i}^{V}={f}_{i}^{L}\text{}i=1,\text{2,...n}$$

$${y}_{i}={K}_{i,}{x}_{i}\text{}i=1,\text{2,...n}$$

$${y}_{i}{\alpha}_{g}+{x}_{i}(1-{\alpha}_{g})={z}_{i}\text{}i=1,\text{2,...n}$$

$$\sum _{i=1}^{{n}_{c}}{x}_{i}=1\text{or}{\displaystyle \sum _{i=1}^{{n}_{c}}{y}_{i}=1}$$

Since we have the same number of equations as unknowns, this system is determined and has a unique solution. To solve this system of simultaneous non-linear equations, there are two categories of solution techniques:

- Newton-type methods,
- Substitution-type methods.

*Newton-type methods* for more than one unknown require finding (n x n) elements of a Jacobian matrix at every iteration step. This could be computationally expensive. Additionally, the Newton Raphson method requires a very good initial guess (i.e., close to the actual solution) to guarantee convergence to the true values. This is not always possible, especially at the start of the procedure.

The most popular method, and the easiest to implement, is the *substitution type*. However, substitution type methods can be quite slow for some conditions of interest. In these sort of cases, we either switch to a Newton-Raphson solver (that has a much better rate of convergence) or implement an acceleration procedure to the substitution method itself.