CVEQUID is designed to determine equilibrium constants and (optionally) stoichiometry of equilibrium systems from potentiometric measurements. Theory ------ CVEQUID carries out full confluent anaysis of the results of measurements, which enables to consider all experimental errors in an explicit manner (this including the errors in electrode characteristics, preparing stock solutions, reagent impurities, etc.). It is designed to process the results of potentiometric titrations only. It is assumed that chemical equilibria in ideal solutions are established (i.e., variable ionic strength is ignored). The theory of the method is described in the following papers. Paper [1] describes the general mathematical formalism of chemical equilibria and a general method of computing equilibrium concentrations implemented here. Papers [2], [3], and [5] describe the least-squares method for the determination of equilibrium parameters implemented in the program. Paper [2] concerns determination of equilibrium constants only by nonlinear multiple regression analysis. Paper [3] generalizes the algorighm to confluent analysis and extends the application of the method to determining the stoichiometry of unknown species. Paper [5] further generalizes the confluent analysis method implemented here to considering all soureces of experimental error. 1. J. Kostrowicki, A. Liwo. DECFAM - A new computer-oriented algorithm for the determination of equilibrium constants from potentiometric and/or spectrophotometric measurements - I. Comput. Chem. 1984, 8, 91. 2. J. Kostrowicki, A. Liwo. DECFAM - A new computer-oriented algorithm for the determination of equilibrium constants from potentiometric and/or spectrophotometric measurements - II. Comput. Chem. 1984, 8, 101. 3. J. Kostrowicki, A. Liwo. A general method for the determination of the stoichiometry of unknown species in multicomponent systems from physicochemical measurements. Comput. Chem. 1987, 11, 195. 4. J. Kostrowicki, A. Liwo, K. Sokolowski. A comparative study on some methods for computing of equilibrium concentrations. Comput. Chem. 1988, 12, 293. 5. J. Kostrowicki, A. Liwo. Determination of equilibrium parameters by minimization of an extended sum of squares. Talanta 1990, 37, 645. Please cite the above papers in works where STOICHIO is used. Installation and running the program under DOS/Windows ------------------------------------------------------ For DOS/Windows, unzip the file CVEQUIDN.ZIP. This will create directory CVEQUIDN with subdirectories SOURCE (source files), BIN (binaries), DOC (documentation), and EXAMPLES (examples). In the BIN directory you find the EXE file (CVEQUID.EXE) and CVEQUID.LTL + NDPRUN.EXE (to run with NDP package). These should, in principle, work. If not, create the exe file from the source files in the SOURCE directory. Microsoft and NDP FORTRAN have been tested to perform here correctly. For NDP, you can use the batch MAKE_EXE.BAT for compilation and file CVEQUID.LNK for linking; this will create CVEQUID.LTL. For Microsoft or other Windows versions of FORTRAN just load the source modules to the project and then click on "Create EXE file" or equivalent position of the menu. Description of input files -------------------------- The data are read in FORTRAN format; the format follows a data item. Explanation is given below. The line (A(I),I=1,N) means that we read N elements of one-dimensional array A in sequential order. The line (A(I,J),J=1,N),I=1,M) means that we are reading consecutive elements of a two-dimensional array A (a total MxN elements) by columns (FORTRAN convention). In - an integer consisting of n digits (zero is substituted for an empty field) Fn.m - a fixed-point real number with m digits after the decimal point and total length of n digits. An - a text of n characters. Ln - a logical constant of length n; T anywhere means true and F anywhere means false. nX - n spaces. nS (where S is I, F, A, or L) - repeat the format specifier n times (e.g., 8F10.5 means space for eight 10-digit fixed-point reals with 5 decimal places). Apart from these, there also is free-format input; the items are just separated by spaces. Input: 1. Title (20A4) 2. N,M,MM,MMM,NREDE,NSTODE,NSPEK,NEXP,EACHIT,IDERIV - free format N - number of chemical species, M - number of all non-redundant chemical reactions, MM - number of reactions whose constants are to be determined, MMM - number of reactions whose constants are known but charged with known experimental errors, which are supplied as standard deviations or complete variance-covariance matrix, NREDE - number of reactions whose stoichiometric coefficients are to be determined (0 if only equilibrium constants are determined), NSTODE - number of stoichiometric coefficients determined for one reaction (default: N-M and cannot be greater than that), NSPEK - always 0, NEXP - number of potentiometric titrations, EACHIT - printout level: -1 - only input data and results, 0 - plus "raw" parameters in each iteration, 1 - plus formatted parameters in each iteration, 2 - plus residuals of titrant volumes and EMF in each iteration, 3 - plus equilibrium concentrations in each iteration. IDERIV - flag of printing the derivatives of EMF in titrant volume for the final parameters: 1 - print derivatives, 0 - don't print. 3. Names of chemical species in the order they will appear in the stoichiometric matrix, each one in a separate line (A32). 4. If NREDE>0, read initial approximations of the stoichiometric coefficients that are to be determined. These are read as part P of the Hermitian form of the stoichiometric matrix (see Ref. 3). Each line contains the part of the part P corresponding to a reaction with unknown coefficients followed by the decimal logarithm of its equilibrium constant; these are read in the free format. Note that there are exactly N-M P-factor elements per reaction. Important! The output stoichiometric coefficients are always non-rational numbers and do not, therefore, make physical sense. Thus, after determining the stoichiometric coefficients determination of equilibrium constants only must be run for stoichiometries closest to the found non-rational stoichiometry and the best-fitting model chosen. See examples discussed in Ref. 4 for details. 5. Stoichiometric coefficients (stoichiometric matrix) and the logs of the equilibrium constants of the remaining reactions. Each reaction is in a separate line and contains exactly N stoichiometric coefficient. A coefficient is positive for a product, negative for a substrate and 0 for a species that does not partake in a given reaction. The coefficients must be integers. Each reaction is followed by the log of its equilibrium constant (initial approximation for reactions with unknown constants). 6. If MMM>0, information of the errors of known equilibrium constants, otherwise this group of data is not read in: 6a. LOG (L1) T - read standard deviations of equilibrium constants. F - read full variance-covariance matrix of equilibrium constants. 6b. If LOG=T, standard deviations (free format) If LOG=F, lower triangle+diagonal of the variance-covariance matrix (free format). 7. Information of preparing titrand and titrant solutions. These data are read in as a digitalized graph. Follow the theory and examples in Ref. 5 for detailed description. There are three types of solutions: stock (basic) solutions or reagents, intermediate solutions, and final (titrand and titrant) solutions. Intermediate solutions are usually ignored and the titrand and titrands are "prepared" by "mixing" the desired amounts of "stock solutions" directly and filling up to the desired (usually fictitious) volume. Accurate researches can, however, input exactly the whole actual history of preparing titrands and titrants. 7a. NCOMP (free format) - number of stock solutions (reagents). 7b. For each stock solution: 7b1. NNZ(I),(WY(I,J),J=1,NNZ(I)) (free format) NNZ(I) - the number of species in stock solution I WY(I,J) - number of Jth species in stock solution I (acc. to the numbering in record group 2). 7b2. (QCOMP(I,J),COMDEV(J),J=1,NNZ(I)) (format swobodny) QCOMP(I,J) - number of moles of species J in stock solution I COMDEV(J) - standard deviation of the above quantity. 7c. Specification of the number and volumes of intermediate and final solutions. The number of records must be the same as the number of vertices of the solution history graph (Ref. 5). The solutions are numbered consecutively. This group of records in terminated by an empty line. I,J,Y,Z (format 2I2,6X,2F10.5) I: > 0 if this is the next full record, 0 (or empty field) to finish the group of records. J: 0 - the volume is not charged with error. > 0 volume charged with error; must be followed by standard deviation. Y: volume. Z: if J>0, the standard deviation of volume. 7d. Specification of the amounts/volumes of the stock/intermediate solutions to prepare the solutions corresponding to the higher vertices of the history graph. Terminate this group of records with an empty line. I,J,K,Y,Z (3I2,4X,2F10.5) I: 0 (or empty field) to finish the group of records. > 0 - number of stock/intermediate solution to prepare the solution higher in the graph. J: 0 - number of solution which is prepared from solution I. K: 0 - volume of I not charged with error; >0 charged with error. Y: volume of solution I to prepare solution J. Z: if K>0, standard deviation of that volume. 8. (ENRNST(I),I=1,N); free format. Coefficients in Nernst's equation of electrode characteristics: N EMF = E0 + ALFA*SUM ENRNST(i)*log10(C(i)) i=1 9. SIGEMF, SIGMAV (free format) SIGEMF - pre-estimated standard deviation of EMF (from apparatus and measurements characteristics) SIGMAV - pre-estimated standard deviation of the titrant volume (from the accuracy of titration). 10. Specification of general data for subsequent potentiometric titrations (2 lines per titration): 10a. NPINT(I),NCM(I),NCT(I) (free format) NPINT(I) - number of points in the Ith titration NCM(I), NCT(I) - number of the titrand and the titrant, respectively, for the Ith titration. 10b. EST(I),ALFA(I),VM(I),STDEST(I),STDALF(I),STDVM(I) (free format) EST(I),ALFA(I): E0 and ALFA in the equation of record group 8. VM(I) - volume of titrand in the Ith titration. STDEST(I),STDALF(I),STDVM(I) - standard deviations of the above quantities. 11. Results of potentiometric titrations (sequentially from 1 to NPINT, without breaks or empty lines); each point in a separate line. V,EMF,DEV (3F10.5). V - volume of titrant EMF - EMF measured for this point DEV - initial difference between the measured and best-fitting titrant volume for this point; usually ignored. 12. Specification of the parameters of the nonlinear least-squares method and the iterative method for calculating equilibrium concentrations. Default values are in parentheses. 12a. MAXIT,MAXMAR,MAXU (20I4) MAXIT (40): maximum number of iterations (better use at least 500) MAXMAR (10): maximum number of internal Marquardt iterations (default is OK). MAXU (100): maximum number of Newton iterations in the calculation of equilibrium concentrations (default is OK). 12b. RKRYT,RMIND,REL,PARS,RLAMBD,VMARQ,COEXP,FACTST (4F20.10) RKRYT (0.001): accuracy of the convergence of determined parameters. RMIND (1.0E-12): minimum average of increments of parameters which is OK to continue minimization. REL (0.00001): convergence of equilibrium concentrations/convergence of parameters ratio. DUMDT = REL*RKRYT**2 PARS (1.0): maximum allowed change of parameters in a single iteration. RLAMBD (0.01): initial value of the Marquard factor lambda (see Ref. 2). VMARQ (10.0): multiplier of the Marquardt factor lambda (see Ref. 2). COEXP (11.5): initialization of the logs of equilibrium concentrations. FACTST (1.0): scaling factor of the derivatives of stoichiometric coefficients (use a value <1.0 if the stoichiometric coefficients go wild in a single iteration).