Abstract
Often, when a molecular simulation of a complex mixture is to be performed, one runs into the issue of converting complex, experimentally prepared formulations into mole fractions of individual molecular entities. Conversely, in fields such as organic chemistry, there is often a need to convert mole fractions into other compositional units. In common practice, those conversions are performed manually, requiring the writing of the appropriate material balances every time. This work addresses both issues simultaneously by introducing a general matrix formalism that enables conversion between any combination of IUPAC-recognized composition units through the resolution of a simple linear system. The framework can also be used in the reverse direction to convert mole fractions back into any other desired unit of composition. Recursion (i.e., mixtures of mixtures) and the decomposition of complexes into individual molecules or ions are handled consistently. A Python library to perform these calculations is available at https://github.com/TheophileGaudin/chemcalc-lib and can be added to a Python environment with pip install chemcalc_lib.
Acknowledgments
The author thanks F. Meyers (IUPAC) and Leah McEwen (Cornell University) for helpful discussions about the early concept, and J. Schwöbel (Dassault Systèmes) for critical reading of the manuscript.
-
Research ethics: Not applicable.
-
Informed consent: Not applicable.
-
Author contributions: The author has accepted responsibility for the entire content of this manuscript and approved its submission.
-
Use of Large Language Models, AI and Machine Learning Tools: None declared.
-
Conflict of interest: The author states no conflict of interest.
-
Research funding: None declared.
-
Data availability: Not applicable.
-
Software availability: Access to software developed in context of this work is free of charge under MIT license.
Appendix A. General identities
In general, whenever the property is a ratio of two additive properties, if those two properties are the same, we get:
If the two properties are different, we get:
If the two mixtures being compared are the same, we get:
Equations A1–A3 can be applied to the particular, existing amount measurements, as summarized in Table A1.
Recursive mixing rules.
| Denominator | ||||
|---|---|---|---|---|
| n | m | V | ||
| Numerator | n |
|
|
|
| m |
|
|
|
|
| V |
|
|
|
|
Let us take a subset of our components, “sub”. Let us assume that we know the mole fraction of each component in the complete mixture. We want to compute a relative amount
Appendix B. Computable quantities
We start our mixture by blending components labelled I with known mole fractions, masses and volumes
From the absolute amounts n, m, V we can compute the average absolute molar weight and the average absolute molar volume as:
From the relative quantities, several mean quantities can be calculated. From mole fraction contributions, we can calculate the total amount added in mole fraction, and its contribution to the molar mass and molar volume of the mixture:
From mass fraction contributions, we can calculate the mass fraction molality, overall mass fraction, and the specific volume occupied by the component in mass fraction:
From volume fraction contributions, we can calculate the molar concentration, mass concentration, and overall volume fraction:
When it comes to concentrations, we can calculate further quantities. From molality and specific volume, we can calculate overall molality, overall specific volume, and first concentration contribution to mole fraction:
From molar and mass concentrations we can calculate the overall molar and mass concentrations as well as the second concentration contribution to mole fraction:
Appendix C. Components from mother to daughter mixture
We always know the mole fraction of I in the mother mixture M,
Appendix D. Mole fractions for a molal solution
Let’s call
Using basic definitions and eq. (A3) for the total number of moles of solvent prior to addition of solute n solvent, the mole fraction of the solute in the final mixture x solute, as well as the mole fraction of the other components xI is:
And
In the reverse case, molality of a selected solute can be retrieved from mole fractions and molar weights of the solution:
References
1. Klamt, A. From Quantum Chemistry to Fluid Phase Thermodynamics and Drug Design; Elsevier Science: Amsterdam, The Netherlands, 2005.Search in Google Scholar
2. International Union of Pure and Applied Chemistry. Physical and Biophysical Chemistry Division. “IUPAC Green Book, Section 2.10”. 2007.Search in Google Scholar
3. Anderson, E.; Bai, Z.; Bischof, C.; Blackford, S.; Demmel, J.; Dongarra, J.; Du Croz, J.; Greenbaum, A.; Hammarling, S.; McKenney, A.; Sorensen, D. LAPACK Users’ Guide; Society for Industrial and Applied Mathematics: Philadelphia, 1999.10.1137/1.9780898719604Search in Google Scholar
4. Harris, C. R.; Millman, K. J.; van der Walt, S. J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N. J.; Kern, R.; Picus, M.; Hoyer, S.; van Kerkwijk, M. H.; Brett, M.; Haldane, A.; del Río, J. F.; Wiebe, M.; Peterson, P.; Gérard-Marchant, P.; Sheppard, K.; Reddy, T.; Weckesser, W.; Abbasi, H.; Gohlke, C.; Oliphant, T. E. Array Programming with NumPy. Nature 2020, 357–362; https://doi.org/10.1038/s41586-020-2649-2.Search in Google Scholar PubMed PubMed Central
5. International Union of Pure and Applied Chemistry. Molecular Entity. In IUPAC Compendium of Chemical Terminology, 5th ed.; International Union of Pure and Applied Chemistry, 2025. https://doi.org/10.1351/goldbook.M03986.Search in Google Scholar
6. Gaudin, T. ChemCalc, 2025. https://sourceforge.net/projects/chemicalcalculator/.Search in Google Scholar
7. Gaudin, T. chemcalc-lib 0.1.3, 2025. https://pypi.org/project/chemcalc-lib/.Search in Google Scholar
8. Gaudin, T. chemcalc-lib. 2025; https://doi.org/10.5281/zenodo.17525552.Search in Google Scholar
9. Logan, E. R.; Tonita, E. M.; Gering, K. L.; Li, J.; Ma, X.; Beaulieu, L. Y.; Dahn, J. R. A Study of the Physical Properties of Li-Ion Battery Electrolytes Containing Esters. J. Electrochem. Soc. 2018, 165, A21; https://doi.org/10.1149/2.0271802jes.Search in Google Scholar
10. Abbott, J. W.; Hanke, F. Kinetically Corrected Monte Carlo–Molecular Dynamics Simulations of Solid Electrolyte Interphase Growth. J. Chem. Theory Comput. 2022, 18 (2), 925–934; https://doi.org/10.1021/acs.jctc.1c00921.Search in Google Scholar PubMed
11. Lemahieu, G.; Ontiveros, J. F.; Gaudin, T.; Molinier, V.; Aubry, J. M. The Salinity-Phase-Inversion Method (SPI-slope): a Straightforward Experimental Approach to Assess the hydrophilic-lipophilic-ratio and the salt-sensitivity of Surfactants. J. Colloid Interface Sci. 2022, 608 (1), 549–563; https://doi.org/10.1016/j.jcis.2021.09.155.Search in Google Scholar PubMed
12. Moumne, R.; Lavielle, S.; Karoyan, P. Efficient Synthesis of β2-Amino Acid by Homologation of α-Amino Acids Involving the Reformatsky Reaction and Mannich-Type Imminium Electrophile. J. Org. Chem. 2006, 71 (8), 3332–3334; https://doi.org/10.1021/jo060316a.Search in Google Scholar PubMed
13. Martins, J. R. R. A.; Sturdza, P.; Alonso, J. J. The Complex-step Derivative Approximation. ACM Trans. Math Software 2003, 29, 245–262; https://doi.org/10.1145/838250.838251.Search in Google Scholar
© 2025 IUPAC & De Gruyter