14 #ifndef MIXTURE_DERIVATIVES_H
15 #define MIXTURE_DERIVATIVES_H
23 class HelmholtzEOSMixtureBackend;
180 }
else if (WRT ==
iDelta) {
204 for (std::size_t m = 0; m < mmax; ++m) {
207 }
else if (WRT ==
iDelta) {
216 for (std::size_t m = 0; m < mmax; ++m) {
222 return summer -
d_nAij_dX(HEOS, i, j, xN_flag, WRT);
228 for (std::size_t i = 0; i < N; ++i) {
229 for (std::size_t j = i; j < N; ++j) {
230 L(i, j) =
nAij(HEOS, i, j, xN_flag);
234 for (std::size_t i = 0; i < N; ++i) {
235 for (std::size_t j = 0; j < i; ++j) {
245 for (std::size_t i = 0; i < N; ++i) {
246 for (std::size_t j = i; j < N; ++j) {
251 for (std::size_t i = 0; i < N; ++i) {
252 for (std::size_t j = 0; j < i; ++j) {
262 for (std::size_t i = 0; i < N; ++i) {
263 for (std::size_t j = i; j < N; ++j) {
272 for (std::size_t i = 0; i < N; ++i) {
273 for (std::size_t j = 0; j < i; ++j) {
282 Eigen::MatrixXd M = L, adjL = adjugate(L);
285 for (std::size_t i = 0; i < N; ++i) {
286 Eigen::MatrixXd n2dLdni(N, N);
287 for (std::size_t j = 0; j < N; ++j) {
288 for (std::size_t k = j; k < N; ++k) {
289 n2dLdni(j, k) =
n2Aijk(HEOS, j, k, i, xN_flag);
291 n2dLdni(k, j) = n2dLdni(j, k);
294 M(N - 1, i) = (adjL * n2dLdni).trace();
299 Eigen::MatrixXd& dL_dX) {
302 Eigen::MatrixXd dMstar = dL_dX, adjL = adjugate(L), d_adjL_dX = adjugate_derivative(L, dL_dX);
305 for (std::size_t i = 0; i < N; ++i) {
306 Eigen::MatrixXd n2dLdni(N, N), d_n2dLdni_dX(N, N);
307 for (std::size_t j = 0; j < N; ++j) {
308 for (std::size_t k = j; k < N; ++k) {
309 n2dLdni(j, k) =
n2Aijk(HEOS, j, k, i, xN_flag);
310 d_n2dLdni_dX(j, k) =
d_n2Aijk_dX(HEOS, j, k, i, xN_flag, WRT);
312 n2dLdni(k, j) = n2dLdni(j, k);
313 d_n2dLdni_dX(k, j) = d_n2dLdni_dX(j, k);
316 dMstar(N - 1, i) = (n2dLdni * d_adjL_dX + adjL * d_n2dLdni_dX).trace();
794 bool cache_values =
false;