 Example 05.04 Construct a Diagram with gE, hE and -TsE

problem:

Construct a diagram with the thermodynamic excess properties gE, hE and -TsE for the system ethanol (1) water (2) from the vapor-liquid equilibrium data of Mertl (values for gE and hE given in the following vectors):    number of data points:  temperature: general

constants

and

definitions: Solution

As gE and hE values are not given at the same mole fractions, experimental data are first regressed using a suitable mathematical function. Typical expressions for this type of data are Legendre polynomials, Redlich-Kister expansions or sum of symmetric functions. For this example we choose the latter equation with 6 parameters (order 3) for the excess enthalpy regression:  We define the objective function OF as the sum of squared deviations between experimental data and calculated values for all data points: A vector with starting values uniformly distributed in the range between -1000 and 1000 can conveniently be generated using the random function runif: The minimize function will now find the minimum of the objective function by varying the parameter values in the vector aSSF:  The regression result can be visualized in a graphical representation:   In order to better judge the results of a regression, especially with respect to the correct description of the partial molar excess enthalpy at infinite dilution, the value of -hE/(x*(1-x)*8) is often plotted in the same diagram. The term is divided by 8 to bring it into a similar order of magnitude. The importance of this additional line can easily be demonstrated by increasing the number of parameters (increase norder). At higher order, the SSF model tends to produce unrealistically high slopes close to mole fractions of zero or one.

To regress gE or gE/RT precisely, mostly the Redlich-Kister expansion or a Legendre-polynomial is used. The advantage of the Legendre polynomial lies in the simple calculation of the derivatives required for the calculation of the activity coefficients. As the Redlich-Kister expansion, the Legendre polynomial is used to expand the parameter A of the Porter expression gE=A*x1*x2 as function of composition:

gE = x (1-x) ( a1 Q1 + a2 Q2 + a3 Q3 + ..... )

with a1, a2, a3, ..... adjustable parameters

and Q1 = 1

Q2 = 2x-1

Qk = ((2k-3)(2x-1)Qk-1 - (k-2)Qk-2)/(k-1)  We again define the objective function OF as the sum of squared deviations between experimental data and calculated values for all data points: A vector with starting values uniformly distributed in the range between -0.1 and 0.1 can again conveniently be generated using the random function runif: The minimization function will now find the minimum of the objective function by varying the parameter values in the vector aLeg:   The regression result can be visualized in a graphical representation:  In order to better judge the results of a regression, especially with respect to the correct description of the partial molar excess Gibbs energy at infinite dilution (and thus the activity coefficients at infinite dilution), the value of -gE/(x*(1-x)*8) can be plotted in the same diagram. This is usually not required in case of models like Wilson, NRTL and UNIQUAC, which do not tend to produce higher order artefacts in the diluted ranges. The representation can be further improved by plotting also -ln(g1)/8 and -ln(g2)/8. The values for -TsE can now be calculated from RT*gE - hE and all three functions as well as the experimental data can be shown in one diagram: 