Skip to main content
Article
Licensed
Unlicensed Requires Authentication

Arithmetic of mixing

  • ORCID logo EMAIL logo
Published/Copyright: November 26, 2025

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.


Corresponding author: Théophile Gaudin, Dassault Systèmes BIOVIA, CB4 0FJ Cambridge, UK, e-mail:

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.

  1. Research ethics: Not applicable.

  2. Informed consent: Not applicable.

  3. Author contributions: The author has accepted responsibility for the entire content of this manuscript and approved its submission.

  4. Use of Large Language Models, AI and Machine Learning Tools: None declared.

  5. Conflict of interest: The author states no conflict of interest.

  6. Research funding: None declared.

  7. Data availability: Not applicable.

  8. 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:

(A1) ς T m α T m = a m a T = a m / n m × n m / n T a T / n T = x m A m A

If the two properties are different, we get:

(A2) ς T m = z m a T = I z m I a T = I ς m I a m a T = a m a T I ς m I = a m / n m × n m / n T a T / n T I ς m I = x m A m A ς m α T m ς m

If the two mixtures being compared are the same, we get:

(A3) ς m m Z m = z m a m = I z m I a m = I Z I a m I a m = I a m I a m Z I = I α m I Z I

Equations A1A3 can be applied to the particular, existing amount measurements, as summarized in Table A1.

Table A1:

Recursive mixing rules.

Denominator
n m V
Numerator n x T m b T m * = n m m T = w T m b m * c T m = n m V T = ϕ T m c m
m M m = m m n m = I x m I M I w T m = m m m T = x T m M m M ρ T m = m m V T = ϕ T m ρ m
V V m = V m n m = I x m I V I v T m * = V m m T = w T m v m * ϕ T m = V m V T = x T m V 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 α sub m (such as weight fraction or volume fraction), with ratio property A m (such as molar weight or molar volume). We have:

(A4) x sub m = n m n sub = n m n T n T n sub = x m x sub α sub m = a m a sub = x sub m A m p sub x sub p A p = x m x sub A m p sub x p x sub A p = x m A m p sub x p A p

Appendix B. Computable quantities

We start our mixture by blending components labelled I with known mole fractions, masses and volumes n I n , m I m , V I V , with other components in known mole, mass and volume fractions x I x , 0 , w I w , 0 , ϕ I ϕ , 0 . We then dilute solutes at overall molal concentrations, partial specific volumes, concentrations and mass concentrations b I b * , v I v * , c I c , ρ I ρ

From the absolute amounts n, m, V we can compute the average absolute molar weight and the average absolute molar volume as:

(B1) M abs = m abs n abs = I m I n + m I m + m I V I n I n + n I m + n I V = I n I n M I + m I m + V I V M I / V m , I I n I n + m I m / M I + V I V / V m , I

(B2) V abs = V abs n abs = I V I n + V I m + V I V I n I n + n I m + n I V = I n I n V m , I + m I m V m , I / M I + V I V I n I n + m I m / M I + V I V / V m , I

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:

(B3) x 0 x = I x I x , 0 , M 0 x = x 0 x M x = 1 n 0 I n I x I m I x I n I x = I n I x M I x n 0 = I n I x n 0 M I x = I x I x , 0 M I , V 0 x = x 0 x V x = 1 n 0 I n I x I V I x I n I x = I n I x V m , I x n 0 = I n I x n 0 V m , I x = I x I x , 0 V m , I

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:

(B4) b 0 w = x 0 w M 0 = n 0 w m 0 = I n I w , 0 m 0 = I m I w , 0 M I m 0 = I m I w , 0 m 0 1 M I = I w I w , 0 M I , w 0 w = x 0 w M w M 0 = n 0 w n 0 n 0 m 0 I m I w n 0 w = I m I w m 0 = I w I w , 0 , v 0 w * = x 0 w V w M 0 = n 0 w n 0 n 0 m 0 I V I w n 0 w = I m I w m 0 V m , I M I = I w I w , 0 V m , I M I

From volume fraction contributions, we can calculate the molar concentration, mass concentration, and overall volume fraction:

(B5) c 0 ϕ = x 0 ϕ V 0 = I n I ϕ , 0 V 0 = I V I ϕ , 0 V m , I V 0 = I V I ϕ , 0 V 0 1 V m , I = I ϕ I ϕ , 0 V m , I , ρ 0 ϕ = x 0 ϕ M ϕ V 0 = n ϕ n 0 n 0 V 0 I m I ϕ n ϕ = I V I ϕ M I V m , I V 0 = I V I ϕ V 0 M I V m , I = I ϕ I ϕ , 0 M I V m , I , ϕ 0 ϕ = x 0 ϕ V ϕ V 0 = n ϕ n 0 n 0 V 0 I V I ϕ n ϕ = I V I ϕ V 0 = I ϕ I ϕ , 0

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:

(B6) b b v * = x b v M = I n I b + n I v m T = I n I b + V I v V m , I m T = I n I b m T + V I v m T 1 V m , I = I b I b * + v I v * V m , I , v b v * = x b v V b v M = n b v n T n T m T I V I b + V I v n b v = I n I b m T V m , I + V I v m T = I b I b * V m , I + v I v * , w b v = x b v M b v M = n b v n T n T m T I m I b + m I v n b v = I M I n I b m T + V I v m T 1 V m , I = I M I b I b * + v I v * V m , I

From molar and mass concentrations we can calculate the overall molar and mass concentrations as well as the second concentration contribution to mole fraction:

(B7) c c ρ = x c ρ V = I n I c + n I ρ V T = I n I c + m I ρ M I V T = I n I c V T + m I ρ V T 1 M I = I c I c + ρ I ρ M I , ρ c ρ = x c ρ M c ρ V = n c ρ n T n T V T I m I c + m I ρ n c ρ = I n I c V T M I + m I ρ V T = I c I c M I + ρ I ρ , ϕ c ρ = x c ρ V c ρ V = n c ρ n T n T V T I V I c + V I ρ n c ρ = I n I c V T V m , I + m I ρ V T V m , I M I = I V m , I c I c + ρ I ρ M I

Appendix C. Components from mother to daughter mixture

We always know the mole fraction of I in the mother mixture M, x M I , the molar mass of the mother mixture M M and the molar volume of the mother mixture, V m,M . We set any of the possible amounts for the mother mixture in the daughter mixture d. As is shown in the below equations, given the molar mass and molar volume of I, the amount of I from M in d can always be deduced from the corresponding amount of M introduced in d. Subscripts and superscripts in notations should be understood as in the following examples: n d I , M stands for the number of moles of I coming from M in d, x M I stands for the mole fraction of I in M, n d M stands for the number of moles of M introduced in d.

(C1) n d I , M = x M I n d M

(C2) m d I , M = w M I m d M = x M I M I M M m d M

(C3) V d I , M = ϕ M I V d M = x M I V m , I V m , M V d M

(C4) x d I , M = x M I x d I , M x M I = x M I n d I , M n M I n d M n d = x M I x d M

(C5) w d I , M = m d I , M m d m d M m d M = w M I w d M = x M I w d M M I M M

(C6) ϕ d I , M = V d I , M V d V d M V d M = ϕ M I ϕ d M = x M I ϕ d M V m , I V m , M

(C7) c d I , M = c d I , M c d M c d M = n d I , M n d M V d V d c d M = x M I c d M

(C8) ρ d I , M = ρ d M ρ d I , M ρ d M = m d I , M m d M V d V d ρ d M = w M I ρ d M = x M I ρ d M M I M M

(C9) b d I , M * = b d I , M * b d M * b d M * = n d I , M n d M m d m d b d M * = x M I b d M *

(C10) v d I , M * = v d I , M * v d M v d M = V d I , M V d M m d m d v d M = ϕ M I v d M = x M I v d M V m , I V m , M

(C11) c d I , M = c d I , M c d M c d M = n d I , M n d M V d V d c M I = x M I c d M

(C12) ρ d I , M = ρ d I , M ρ d M ρ d M = m d I , M m d M V d V d ρ d M = w M I ρ d M = x M I ρ d M M I M d M

(C13) b d I , M * = b d I , M * b d M * b d M * = n d I , M n d M m d m d b d M * = x M I b d M *

(C14) v d I , M * = v d M * v d I , M * v d M * = V d I , M * V d M * m d m d v d M * = ϕ M I v d M * = x M I v d M * V m , I V m , M

Appendix D. Mole fractions for a molal solution

Let’s call b solvent solute the molality of a chosen solute in a solvent, x solvent I the mole fraction of component I in the solvent prior to the introduction of the solute, and M solvent the average molar weight of the solvent.

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:

(D1) x solute = n solute n solute + n solvent = n solute n solute + m solvent M solvent = n solute n solute + n solute b solvent solute M solvent = 1 1 + 1 b sol vent solute M solvent = b solvent solute M solvent b solvent solute M solvent + 1

And

(D2) x I = n I n T = n I n solvent n solvent n T = x solvent I 1 x solute = x solvent I 1 b solvent solute M solvent b solvent solute M solvent + 1

In the reverse case, molality of a selected solute can be retrieved from mole fractions and molar weights of the solution:

b solvent solute = n solute m solvent = n solute m solvent n solvent n solvent n T n T = x solute M solvent n solvent n T = x solute M solvent x solvent = x solute M solvent 1 x solute

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

Received: 2025-09-25
Accepted: 2025-11-05
Published Online: 2025-11-26

© 2025 IUPAC & De Gruyter

Downloaded on 23.4.2026 from https://www.degruyterbrill.com/document/doi/10.1515/pac-2025-0628/html
Scroll to top button