34 double gE_R_RT(
double tau,
const std::vector<double>& x, std::size_t itau) {
36 for (std::size_t i = 0; i < x.size(); ++i) {
37 summer += x[i] * unifaq.
ln_gamma_R(tau, i, itau);
41 double d_gE_R_RT_dxi(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i,
bool xN_independent) {
48 double gE_R(
double tau,
const std::vector<double>& x, std::size_t itau) {
77 double d_gE_R_dxi(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i,
bool xN_independent) {
111 double am_term(
double tau,
const std::vector<double>& x, std::size_t itau) {
114 double sum_xi_aii_bii(
double tau,
const std::vector<double>& x, std::size_t itau) {
116 for (
int i = 0; i <
N; ++i) {
121 double d_sum_xi_aii_bii_dxi(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i,
bool xN_independent) {
122 if (xN_independent) {
128 double d_am_term_dxi(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i,
bool xN_independent) {
132 double d2_am_term_dxidxj(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i, std::size_t j,
bool xN_independent) {
139 double d3_am_term_dxidxjdxk(
double tau,
const std::vector<double>& x, std::size_t itau, std::size_t i, std::size_t j, std::size_t
k,
140 bool xN_independent) {
148 double bm_term(
const std::vector<double>& x) {
150 for (
int i = 0; i <
N; ++i) {
151 for (
int j = 0; j <
N; ++j) {
152 summerbm += x[i] * x[j] *
bij_term(i, j);
158 return pow((pow(
b0_ii(i), 0.75) + pow(
b0_ii(j), 0.75)) / 2.0, 4.0 / 3.0);
160 double d_bm_term_dxi(
const std::vector<double>& x, std::size_t i,
bool xN_independent) {
162 if (xN_independent) {
163 for (
int j =
N - 1; j >= 0; --j) {
168 for (
int k =
N - 2;
k >= 0; --
k) {
174 double d2_bm_term_dxidxj(
const std::vector<double>& x, std::size_t i, std::size_t j,
bool xN_independent) {
175 if (xN_independent) {
181 double d3_bm_term_dxidxjdxk(
const std::vector<double>& x, std::size_t i, std::size_t j, std::size_t
k,
bool xN_independent) {
190 void set_Q_k(
const size_t sgi,
const double value) {
204 double v = 1 / rhomolar;
206 double tau =
get_Tr() / T;
210 std::vector<double> ln_phi;
211 double bracket = log((v + c + (1 + sqrt(2.0)) * b) / (v + c + (1 - sqrt(2.0)) * b));
212 for (std::size_t i = 0; i < z.size(); ++i) {
214 for (std::size_t j = 0; j < z.size(); ++j) {
219 double _ln_phi = (2 / b * summer1 - 1) * (p * (v + c) / (R * T) - 1) - p * c_i / (R * T) - log(p * (v + c - b) / (R * T))
220 - 1.0 / (2.0 * sqrt(2.0) * R * T) * (a_i_over_b_i + R * T * unifaq.
ln_gamma_R(tau, i, 0) / -0.53087) * bracket;
221 ln_phi.push_back(_ln_phi);