Theoretical background for thermodynamic consistency tests
This is just quick reference for the theoretical background of testing procedures. See Overview document for practical aspects of the tests. For more detailed theoretical explanation, please refer to literature, such as a comprehensive 2017 review by J. Wisniak et al. Alternatively, see all literary sources for VLizard.
Basis
The Gibbs-Duhem equation (G-D) is used for most of the tests. This is the most general form:
We can use definition of excess Gibbs energy in dimensionless form (divided by RT), and enumerate for binary system:
This equation is generally valid for data with variant pressure and temperature. Either the pressure or the temperature dependent terms may be neglected for isothermal or isobaric data, respectively.
Fredenslund test
The idea here is that VLE data (p, T, x, y) together with vapor pressure models is an overdetermined system in its nature. In Fredenslund test, the data is fitted with a model, but not directly – the data is first reduced using g^\mathrm{E}. The model is then following:
Where L_k is the Legendre polynomial of order k (see wikipedia).
You may choose n, the number of polynomials (model params):
- n=4 most usually
- n=3 if you have very few data points
- n=5 if you expect highly non-ideal system and have many data points.
This model has no thermodynamic meaning, but suitable mathematical properties for the analysis (orthogonality).
Using the g^\mathrm{E} calculated from model, the activity coefficients are recalculated as:
p and y_1 are then calculated using Raoult-Dalton's Law.
Then, the residuals between calculated and experimental values of p and y_1 are evaluated.
Finally, following metrics are calculated (average relative, resp. absolute error):
The same is done for y_2 as for y_1.
All must be within acceptable limits, which is 1 %.
Residuals distribution
The distribution of p, y_1, y_2 residuals presents a secondary criterion to evaluate the data set.
The distribution should best be random; if there are trends or clusters (can be visually inspected), it signifies a systematic error.
The Durbin–Watson statistic and the von Neumann statistic are available to quantify the autocorrelation (non-randomness). Both should be 2 for perfectly random residuals, while values 0 and 4 mean total autocorrelation. Most likely you will see values between 0 and 2 (trends and clusters). Values between 2 and 4 signify point-wise oscillation, a phenomenon not expected in VLE data.
Note that if the main test criterion passes, but the residuals are strongly autocorrelated, this does not mean inconsistency, merely that the systematic error is demonstrable, but it is negligible in size.
The Durbin–Watson and the von Neumann statistics are calculated as follows, where r_j is residual of point j:
van Ness test
By deriving g^\mathrm{E} and substituting G-D we get:
The idea of van Ness test is to subtract that equation for calculated - experimental, like this:
The left-side is zero – but only if the model was fitted for \gamma or g^\mathrm{E}. That means when the residual function, which was optimized to zero, is calculated using residuals of those. You may use a model fitted in VLizard, which uses \gamma for optimization.
⚠ You may use model params obtained elsewhere, but do not use such model for van Ness test, if it was optimized for T, x or y!
It will make the test mathematically invalid.
The left-side should be zero, so a residual from zero can be calculated:
Finally, the root mean square of the residuals is calculated:
Instead of a single threshold to formally accept or reject the data, the van Ness test assigns a conventional index from 1 to 10, where 1 is perfect, 5 is doubtful and 10 is unacceptable, for a more nuanced evaluation.
Gamma offset test
The gamma offset test does examine thermodynamic consistency, though not using G-D, but only the definition of activity.
The activity coefficients must always be 1 for pure components, so it is just a simple check to see if \gamma_i(x_i = 1) = 1.
If that's not the case, then the VLE data does not align with the vapor pressure models for pure components.
A modified NRTL equation is used, which includes the error, or "offset" parameter \Delta \gamma_i:
Where \gamma_{i,N} is the NRTL model activity coefficient for pure component i.
Additionally, vapor phase equation of state is modelled using a 1st order virial equation. Mixture is modelled as a single pseudocomponent, with fugacity coefficient \phi calculated via three parameters:
Both residuals are respectively weighted by x_1, x_2, so that both \Delta \gamma_1 and \Delta \gamma_2 are biased towards the pure regions, and accurately reflect them.
Conventional criterion is then used to formally accept or reject the data: \Delta \gamma_i < 1.5 %.
Note that this procedure is an original research by the VLizard author, see the published article for more details.
Redlich-Kister test
This test uses G-D in integral form, while disregarding V_m^\mathrm{E} and H_m^\mathrm{E} (the pressure and temperature dependence).
Usually, V_m^\mathrm{E} is very small, so for isothermal data, the test is very reliable.
But H_m^\mathrm{E} is usually not negligible, so for isobaric data, the test is a gross approximation.
The curve \ln \gamma_1 / \gamma_2 forms two areas A and B, one above and one below the x-axis.
This is why Redlich-Kister & Herington tests are also generally called "area tests".
Conventional criterion is used to formally accept or reject the data.
For isothermal data, the criterion is D < 2 and the test is considered conclusive.
For isobaric data, the criterion is D < 10 and the test is considered inconclusive – it should be used only to reject the data when result is negative, but it has no meaning when positive, as per J. Wisniak.
Herington test
A variation of Redlich-Kister test for isobaric data, which aims to replace the temperature dependence with an empirical parameter:
The conventional criterion is then |D-J| < 10.
Empirical parameter J is not theoretically founded, and according to J. Wisniak, many systems do not conform to it. The test is therefore deprecated. It is also not supported for isothermal data (does not make sense, use the Redlich-Kister test instead).
Slope test
At first glance, this is the most mathematically straightforward test. Just like the Redlich-Kister test, the pressure and temperature dependence is disregarded. G-D is used in derived form:
For each point the residual from zero is calculated. Outlying points with particularly high residuals are then considered suspicious, but no formal criterion has been established.
However, the apparent simplicity is deceptive – problem lies in numerical calculation of the derivatives, which is generally unreliable, and makes the test seldom usable. VLizard uses a derivation formula using all points from the non-equidistant grid, which helps smooth out the sensitivity to random error, but it is often still too noisy to give meaningful information on thermodynamic consistency.