Python and MATLAB implementations of a fast numerical method for the solution of multiple chemical equilibria

MARCO TODISCO
DOI: https://doi.org/10.26434/chemrxiv-2024-7tf0j
2024-03-08
Abstract:Determining the distribution of multiple chemical species at equilibrium for a given system is a common problem that must be routinely addressed by scholars. While simple systems consisting of a few species and reactions can be solved manually, most of these problems require the definition and solution of higher-order equations and are intractable without reliable numerical methods, that can be slow and inefficient. In this work, we introduce straightforward Python and MATLAB implementations of the geometric-programming algorithm developed by Thomas Wayne Wall (1984) and we provide clear and easy-to-use scripts and examples for researchers approaching the problem. The code is readily available online in a package called equpy. The performance and stability of the algorithm are tested versus out-of-the-box MATLAB numerical solver (vpasolve) and the solver employed in chempy - one of the most complete opensource chemistry packages available to this date - showing an execution time reduced by as much as two orders of magnitudes.
Chemistry
What problem does this paper attempt to address?