Linearized least squares affinity solution w/ MEXQAL
An approximate coupled solution for composition and affinity of a solution phase can be determined in a single step by linearizing the exchange equilibrium condition with respect to fractional changes in composition. Translating the curvature matrix to log-space results in an expression whose compositional-dependence is linear in log-compostion terms
where
where the
Combined, the two expressions above provide a system of N+1 linear equations constraining the value of N+1 unknowns (
Restraining fractional composition adjustments
It is important to recognize that the inherent assumption that fractional composition adjustments are small will hold true near the end of the convergence process, but may be violated quite strongly at the beginning, depending on the quality of the initial guess. In practice, we find that this poses no problem for most simple solutions (like feldspar or silicate liquid), but does indeed cause serious errors for more complex solutions involving many dependent species, especially when a reasonable initial compositional guess is unknown and we are forced to rely upon the endmember-based initialization method described in Ghiorso (2013). To address this, we test the optimal suggested composition update in each iteration to verify that none of the suggested magnitudes exceed a sensible cutoff (like ~0.01). If any of the solution values exceed this threshold, indicating an unacceptably large composition adjustment that violates the assumptions of the least squares approach, then the suggestion from the direct update method is utilized for that iteration.
Re-mapping chemical potentials & Gibbs curvature to dependent species
For complex solutions with multi-site mixing, it is crucial to transform the composition to dependent species space, which raises additional mathematical challenges associated with deriving properties of the dependent species from those of the endmember components. This transformation rests directly on the species stoichiometry matrix:
Likewise, we must also find a transformation for the Gibbs curvature matrix, which describes the linear dependence of chemical potentials on changes in molar composition, but it does so in endmember component space. When solving problems in the larger degenerate compositional space of dependent species, we must mathematically inflate this matrix to describe how the chemical potentials of these species change as their quantity is altered.
where
Real-world performance benchmarks
Using the methods described above, we implement a modified form of the MEXQAL method optimized to outperform the standard direct update approach previously reported. For simple solutions like Feldspar or silicate liquid, we find sigificant speed and iteration gains of order ~50% drop in computation time and a reduction of the necessary iterations by a factor of ~3. Unfortunately, the story is less straightforward for the complex solutions like spinel and clinopyroxene. We are pleased that the algorithm shows clear convergence and accurate results, but the current speed gains are far more modest. Further investigation reveals that this is due in large part to the fact that the suggested optimal composition adjustments exceed a reasonable threshold of 0.1 for the vast majority of the iterations. This implies, perhaps unsurprisingly, that the least-squares approach is really only useful in the final stages of the convergence loop, reducing the last dozen iterations or so to only 2 or 3.
At the very least, this implies that most of the computational overhead for the least-squares approach can be avoided using the suggested composition adjustment from the direct method. Only if the direct adjustment is smaller than the threshold value, should we proceed with the least squares optimization. This would avoid calculation of the gibbs curvature matrix as well as the least-squares refinement for the bulk of the initial iterations. Speculatively, it is also possible that most solution phases are more accurately approximated in linear composition space (at least for the most abundant species). Perhaps using a linear compositional adjustment vector combined with bounded least squares minimization (to prevent negative species quantities) could dramatically improve the quality of the approximation. This will be further explored in a future discussion.