Computers Chem. Vol. 16, No. 3, pp. 267-268, 1992 Printed in Great Britain. All rights reserved
Copyright
SOFTWARE A PROGRAM CONCENTRATION
0097-8485/92 $5.00 + 0.00 0 1992 Pergamon Press Ltd
NOTE
FOR INTERCONVERTING UNITS IN BINARY MIXTURES
ALESSANDRO BAGNO Centro CNR Meccanismi Reazioni Organiche, via Marzolo 1, 35131 Padova, Italy (Received
15 July I991; received for publication I8 December 1991)
AbstraEt-A Pascal program (CUC, Concentration Units Converter) is described. Given the concentration of the solute in a binary mixture in any of the following units (mole fraction, molar ratio, percent by weight, molality or molarity) it calculates the concentration expressed in the remaining scales.
INTRODUCTION The concentration of a solute in a given solvent can be expressed in several ways. The choice of a particular unit of measure is dictated by practical or theoretical reasons; thus, in thermodynamics studies mole fraction (x) and molality (m) are generally preferred to the otherwise very common molarity scale (C), because the first two scales do not depend on the temperature. In any case, when the physicochemical properties of a binary system (e.g. density, viscosity, conductivity etc.) are determined throughout a range of compositions, these are generally reported in graphical or interpolated tabular form as a function of one concentration scale. If data from different sources are to be combined, the potential user of such data is faced with the problem of interconverting the various scales. While this is not a difficult task in itself, it is very tedious and prone to errors if the data set is large. For example, we recently needed to incorporate various properties of the sulphuric acid-water, sulphuric acid-trifluoroacetic acid systems and of the alkali metal methoxides in methanol systems (H,, acidity function, molar concentrations, vapour pressure of solvent) into a procedure which could yield interpolated values as a function of a common unit of measure (Bagno et al., 1987, 1990, 1991). In order to overcode ihis problem, we developed the program described below.
p does not involve the density, and can be carried out
simply with the appropriate equations. Otherwise, densities must be supplied in the form of polynomial coefficients of a function of d vs either x or C, which must be determined independently through fitting of the appropriate data. If the desired quantity is C, firstly m, A or p are converted to x, and then C is calculated by means of the polynomial function d = d(x). Conversely, if the input is in molarity units, firstly C is converted to x by means of the function d = d(C), and x is eventually converted to the other quantities with the inverse equations. The required formulae are reported below [equations (l)-(5); the function name in the program follows in parentheses]. All quantities refer to the solute; molecular weights are denoted as M, (solvent) and M2 (solute) in g/mol, weights in g and densities in g/cm3; thus x = n&z, + n,), A = nz/n,, m = lO’n&v, and p = lO%vJ(w, + wJ. For brevity, the ratio MJM, will be denoted as M,. (I) From percent by weight:
0%0X), (la) (PtoA), (1’4
m = 103p/[ M,(lOO -p)]
(PIOL).
(lc)
@top),
(24
A =x/(1-x)
(XtoA),
G!b)
m = 103x/[M, (I - x)]
(XtoL),
(2c)
(XtoC).
(2d)
p = 102M2/(AM, + M2)
(AtoP),
(34
x =A/(1
WOW,
(W
(AtoL).
(3~)
(2) From mole fraction: p = 102M&/[l+
x(A4, - 111
C = 103xd(x)/[xM,
PRINCIPLES AND ALGORITHM The units commonly used to specify the composition of binary mixtures are: mole fraction (x, adimensional); molality (m, mol/kg): molar ratio (A, adimensional); percent by weight (p. adimensional); and molarity (C, mol/l). Conversion among x, m, A and
--P)l A = WlOO-_pW’M,) x =JJlb + M,(lOO
+ M,(l - x)]
(3) From molar ratio:
+A)
m = lO’A/M, 267
Software Note
268
(4) From molalily: p = 102mM2/(103 + mM,)
&top),
(da)
x = mM,/(lO” + mM,)
(LtoW,
(4b)
A = mM,/lO”
(LtoA).
(4~)
(5) From molarity: x = CM,/[ lO”d(C) - C(M, - Ml)] (CtoX).
(5)
The CUC (Concentration Units Converter) program has been written in Turbo Pascal under MS-DOS and consists of the single executable file, CUC.EXE; it is self-explanatory and is available in source or executable (diskette) form from the author upon request. The program starts by displaying a menu on the screen, then the user is prompted to supply: {a) the molecular weights of solvent and solute as global variables; (b) an integer indicating the type of data on input, as indicated on the menu; (c) the type(s) of requested data, expressed as a string of integers (e.g. 2345) which split into the individual codes. If molarity is involved in either input or output, the appropriate polynomial coefficients for density are
prompted for. In our experience, density vs composition curves are generally smooth enough that a fifthdegree polynomial suffices, so we set this upper limit for the number of coefficients (grade constant). At this stage, the output file can be selected as the line printer or a text file (CUC.OUT) to facilitate incorporating the output into other files. In its present form, it accepts only up to 50 data points (defined in the MaxData constant). Input values are checked for consistency with their units (e.g. 0 < x c 1 etc.). After data input, the actions described above are performed and the results arc output as a table whose first column is the input data and the remaining ones are the calculated values. Because of the simple arithmetics involved, running time is only limited by disk/printer access. REFERENCES Bagno A., Lucchini V. & Scorrano G. (1987) Bull. Sac. Chim. Fr. 563. Bagno A., Scorrano G. & Terrier F. (1990) J. Chem. Sm. Perkin Trans. 2, 1017. Bagno A., Lucchini V. & Scorrano G. (1991) J. Phys. Chem. 95, 345.