You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when z[i] = 0 and z[j] = 0, so the term pow2(beta(i, j)) * z[i] + z[j] is also zero and you divide by zero. Fixing it looks trivial (just don’t add the term in the summation when z[i]=0 and z[j]=0) because the numerator is also zero, but I have dealt with similar problems and it is not quite as simple as it looks. The trivial solution is:
typename MoleFractions::value_type sum2 = 0.0;
for (auto i = 0U; i < N - 1; ++i) {
for (auto j = i + 1; j < N; ++j) {
auto den = (pow2(beta(i, j)) * z[i] + z[j]);
if (getbaseval(den) != 0){
sum2 = sum2 + 2.0 * z[i] * z[j] * (z[i] + z[j]) / den * Yij(i, j);
}
}
}
The trivial solution is also fine for first derivatives with respect to composition, but does NOT work for second derivatives. This represents a fundamental problem with the GERG reducing function.
teqp returns NaNs in multicomponent (more than 2 components) multiparameter models, if the molefraction of one of the components is set to 1.
I have also tested a four component mixture, and additionally, everytime the first two components are set to zero, a NaN is returned.
The text was updated successfully, but these errors were encountered: