Representing physical data with rational functions - Industrial

Apr 1, 1989 - Representing physical data with rational functions. Raymond F. Heiser, William R. Parrish. Ind. Eng. Chem. Res. , 1989, 28 (4), pp 484â€...
0 downloads 6 Views 660KB Size
Ind. Eng. Chem. Res. 1989, 28, 484-489

484

using the given values of l. The values of l for 2,2,4-trimethylpentane with the chlorinated hydrocarbons are identical for the HCB equation and similar for the hard sphere equation. In general, it can be seen that the quality of fit to experimental values is similar for both the hard sphere and HCB equations of state. The values of the interaction parameter for the hard sphere equation of state are, for a given mixture, somewhat greater than the corresponding value for the k C B equation. Furthermore, the value of for a given halocarbon with a series of alkanes appears to decrease more rapidly with increasing size difference for the HCB equation than for the hard sphere equation. A similar trend was apparent for the benzene + alkane systems (Sadus et al., 1988). Several workers have proposed modifications to both the hard sphere term and the attractive term of such equations of state (Kohlen et al., 1986; Deiters, 1981, 1982; Christoforakas and Franck, 1986). These modified equations of state have usually been applied to excess enthalpies, Gibbs functions, and volumes of mixing but not to gasliquid critical data. Although excess functions are sensitive to the equation of state used, it appears from the work of Sadus et al. (1988) and Mainwaring et al. (1988) that the most significant improvement in the prediction of gasliquid critical properties will be in the development of better combining rules and possibly better fluid prescriptions (mixing rules) rather than in the fine tuning of the equation of state.

Acknowledgment Support from the University of Melbourne and the Deutsche Forschungsgemeinschaft is gratefully acknowledged.

60-5; hexane, 110-54-3; heptane, 142-82-5; dodecane, 112-40-3; 2,2,4-trimethylpentae, 540-84-1; octane, 111-65-9; nonane, 11184-2; tetradecane, 629-59-4; decane, 124-18-5; hexadecane, 544-76-3.

Literature Cited Ambrose, D. Vapour-Liquid Critical Properties; National Physical Laboratory: Teddington, UK, 1980. Christoforakas, M.; Franck, E. U. Ber. Bumenges. Ph.ys. Chem. 1986, 90, 780. Deiters, U. Chem. Eng. Sci. 1981, 36, 1139, 1147; 1982, 37, 855. Ewing, M. B.; Marsh, K. N. J . Chem. Thermodyn. 1977, 9, 355. Garcia-Sanchez, F.; Trejo, A. J . Chem. Thermodyn. 1985, 17, 981. Garcia-Sanchez, F.; Trejo, A. Fluid Phase Equilib. 1986a, 24, 269. Garcia-Sanchez, F.; Trejo, A. Fluid Phase Equilib. 198613, 28, 191. Gubbins, K. E.; Shing, K. S.; Street, W. B. J . Phys. Chem. 1983,87, 4573. Guggenheim, E. A. Mol. Phys. 1965,9, 199. Hicks, C. P.; Young, C. L. Chem. Rev. 1975, 75, 119. Hicks, C. P.; Young, C. L. J . Chem. Soc., Faraday Tram. 2 1977,73, 597. Kohlen, R.; Kohler, F.; Svejda, P. Physica B+C 1986, 139, 79. Leland, T. W.; Rowlinson, J. S.; Sather, G. A. Trans. Faraday SOC. 1968, 64, 1447. Mainwaring, D. E.; Sadus, R. J.; Young, C. L. Chem. Eng. Sci. 1988, 43, 459. Marsh, K. N. J . Chem. Thermodyn. 1971,3, 355. Marsh, K. N.; Young, C. L. Aust. J . Chem. 1977, 30, 2583. Marsh, K. N.; McGlashan, M. L.; Warr, C. Trans. Faraday SOC. 1970, 66, 2453. Powell, R. J.; Swinton, F. L.; Young, C. L. J. Chem. Thermodyn. 1970, 2, 105. Sadus, R. J.; Young, C. L.; Svejda, P. Fluid Phase Equilib. 1988,39, 89. Svejda, P.; Kohler, F. Ber. Bunsenges. Phys. Chem. 1983, 87, 672. Toczylkin, L. S.; Young, C. L. J . Chem. Thermodyn. 1980a, 12,355. Toczylkin, L. S.; Young, C. L. J . Chem. Thermodyn. 1980b, 12,465. Waterson, S. D. University of Melbourne, unpublished work, 1982. Received for review May 26, 1987 Revised manuscript received June 13, 1988 Accepted December 7, 1988

Registry No. CCl,, 56-23-5; 1,2-dichloroethane, 107-06-2; cis-1,2-dichloroethane, 156-59-2; trans-1,2-dichloroethane, 156-

Representing Physical Data with Rational Functions Raymond F. Heiser and William R. Parrish* Phillips Petroleum Company, Bartlesuille, Oklahoma 74004

This paper compares rational functions and polynomials for representing data where the functional dependence is unknown. The results show that rational functions can provide comparable fits to those obtained with polynomials but with fewer coefficients when more than four are needed with the polynomial. Rational functions tend to provide more accurate extrapolation of both the fitted value and first derivative. T h e paper illustrates ramifications of overfitting data, especially when extrapolation is needed. An algorithm is given for obtaining Pad6 approximant coefficients, which are good initial estimates of those of the rational function. When the relationship between independent and dependent variables is unknown, the most logical and straightforward procedure is to fit the data to a simple polynomial. This fit provides a smoothed representation of the data and is commonly used for interpolation. Extrapolation, although undesirable, frequently is required as well. Whether interpolating or extrapolating, it is important to minimize the number of coefficients to avoid systematic error. A t the same time, sufficient coefficients must be used to represent the data within its estimated accuracy. Acton (1970) shows the effectiveness of using rational functions for approximating transcendental functions. King and Queen (1979) discuss limitations of polynomials

* Person t o whom correspondence

should be sent.

in fitting data. They suggest that rational functions be considered whenever a large number of coefficients are needed to represent the data. The authors point out that rational functions frequently reproduce the data with fewer coefficients than required with a polynomial. Also, the resulting functions may be more reliable for extrapolation. This paper critically compares results obtained from regression of rational functions with those from polynomials. We consider quality of the fit, smoothness of the first derivative, and accuracy of extrapolation of both the function and the derivative. We choose excess enthalpies where the value of the first derivative (i.e., the partial molar enthalpy) is important, especially at the end points. Using rational functions requires nonlinear regression. King and Queen (1979) presented the first step of an algorithm for obtaining initial guesses for the Coefficients. 0 1989 American Chemical Society

Ind. Eng. Chem. Res., Vol. 28, No. 4, 1989 485 We complete the algorithm for calculating the initial coefficient estimates.

Description of Method Rational functions are the ratio of two polynomials F ( x ) = (a0 a1x + ,.. + a,xm)/(l + b,x + ... + bnx") (1) which is of the order [m,n]. By convention, the ratio is normalized to make the lead term in the denominator unity. Thus, a simple polynomial is of the order [m,O]; a rational function of the order [m,n] requires m + n + 1 coefficients to be fit. Although rational functions may be of any order, those having m = n or n + 1tend to minimize the coefficients needed to represent a given function (Acton, 1970). (To our knowledge, the only common application of rational functions in chemical engineering is the Antoine equation; it is used to fit vapor pressure data and is of the order [l,l]). To determine the best value of the coefficients requires (1)selection of t = m + n + 1data points, (2) calculation of initial estimates of ai and bi from these points, and (3) nonlinear regression of the complete data set to provide least-squares estimates of the coefficients. We found that the selection of data points was not critical in obtaining a good fit as long as they covered the entire range of data being fit. However, selecting points near inflections and extrema gave better estimates. Calculating aiand bi involves using the fact that rational functions, continued fractions, and power series can all represent the same function. Acton (1970) gives some algorithms relating the three forms. King and Queen (1979) use an algorithm developed for Pad6 approximants to represent the selected data points by a continued fraction of the form

+

F(x) = e l

+

x-x,

e2

+

x-x2

e3

+

+

x - x,

et-I

+-

(2)

et

They suggest hand calculations be used to transform eq 2 into eq 1. Although the calculations are simple, hand calculations are a nuisance when looking for the proper order to use; Acton (1970) does not consider this particular form of continued fractions. Therefore, we derived a recursive algorithm, given in the Appendix, which permits direct calculation of ai and bi from eq 2. For nonlinear regression, we used the Marquardt algorithm in SAS User's Guide: Statistics (SAS Institute, Inc., 1985). Initial guesses obtained from the algorithm typically are within &50%of the final values. For the cases considered, convergenece typically required 10 or fewer iterations when using initial guesses obtained from eq 2. Comparison of Polynomial Methods. To fit excess property data, it is common to use the Redlich-Kister (RK) expansion (Prausnitz, 1969) RK[m,O] = x ( l - x)(ao + a1(2x - 1) + a2(2x - 1 ) 2 + ... + aJ2x - 1)") (3) which is a simple polynomial constrained to zero at x = 0 and 1. It has the advantage that the a. term represents the equimolar excess property. (If the polynomial is written in the form of eq 1, a. is the value of the first derivative a t x = 0.)

-4001 0.0

.

.

.

.

0.2

.

I

.

0.4

0.6

0.8

1.0

Mole F r a c t i o n E t h a n o l Figure 1. Comparison between heats of mixing for ethanol-water a t 333 K and 0.4 MPa (Ott, 1986) and a RF[4,3] function calculated from eight data points.

In this paper we compare results of fitting data to eq 3 with those obtained by using a rational function of the form RF[m,n] = ~ (- xl ) F ( x ) (4) Figure 1shows heats of mixing data for the ethanol-water system at 333 K and 0.4 MPa. The line through the points is a RF[4,3]function using eight points to calculate the coefficients from eq 2-no regression was used. The average error was about 30% higher than obtained from regression of a RF[4,3] function. However, it is 15% less than the regressed RK[7,0], which also uses eight coefficients. This system had the most complex shape of the data sets considered. Table I lists the results of fitting excess enthalpy data from four different data sets which range from almost ideal to highly nonideal. Several orders of Redlich-Kister and rational functions were tried to ensure that the best fit was selected for comparison. As expected, using a rational function to fit a simple, nearly symmetric excess enthalpy curve for systems such as hexane-cyclohexane provides no advantage. Because the simplest rational function, F [ 1,1], requires three coefficients, rational functions offer little advantage if a polynomial satisfactorily fits the data with four or less coefficients. The hexanol-nonane system was chosen arbitrarily because the Christensen et al. (1979) tabulation reported fitting the data to a sixth-order Redlich-Kister function. We found that a seventh-order Redlich-Kister function showed a better fit. For this system, the rational function gives comparable results to the Redlich-Kister function with two fewer coefficients. Two ethanol-water data sets were considered. In both cases, the authors reported coefficients for a modified Redlich-Kister corresponding to a F [n,l] rational function. For both systems, the rational function gives a comparable fit with two fewer coefficients. Ott et al. (1986) report that they obtained a good fit using the form

H E = e-kXRK[2,0]+ (1- e-kx)RK[4,0]

(5) We tried this form and found that convergence on a value of k was very slow; this form was not considered further because our emphasis is on polynomials. Figure 2 gives a plot of the residuals (i.e., experimental value-calculated value) of the ethanol data at 298 K for the regressions using RK[8,1] and RF[4,3]. The rational function clearly provides a better, more random fit of the data, especially at low concentrations of ethanol. However, this was the only system considered that gave a nonrandom

Ind. Eng. Chem. Res., Vol. 28, No. 4,1989

486

Table I. Comparison of Redlich-Kister a n d Rational Function Fits for Excess Enthalpy Data type of fit system no. of parameters Redlich-Kister std error of fit" rational function hexane-cyclohexane Ewing and Marsh (1970) 288.15 K 0.01 < x < 0.996 N = 48c 1-hexanol-nonane Christensen et al. (1979) 298.15 K, 170 kPa 0.07 < x < 0.95 N = 24 ethanol-water Costigan et al. (1980) 298.15 K 0.004 < x < 0.97 N = 100 ethanol-water Ott et al. (1986) 333.15 K, 0.4 MPa 0.02 < x < 0.98

3 4 5 6

RK[2,01 RK [ 3,0]d,e RK[4,01 RK[5,01

5 6 7 8

RKI4,OI RK[5,01 RK[6,OId RK[7,0]'

7 8 9 10 10 7 8 9 9 10

Av= 23

0.42 0.15 0.13 0.13

RK16,OI RK[7,01 RK[7,11 RK[8,01 RK [8,lId@ RK[6,01 RK[7,01 RK[7,11 RK[8,01 RK [ 8,l I d z e

std error of fit"

RF[1,11 RF[2,11 RF[2,2Ie RF[3,21

0.23 0.18 0.15 0.13

13 7.1 4.0 2.1

RF[2,21 RF[3,2l0 RF[3,31 RF[4,31

3.6 1.9 2.0 2.0

7.0 3.7 1.7 1.5 1.2 2.4 1.7 1.0

RF[3,31 RF[4,3]' RF[4,41

2.1 0.77 0.72

RF[5,41 RF[3,31 RF[4,3Ie RF[4,41

0.73 1.6 0.89 0.90

RF[5,41

0.90

1.1

0.96

a Standard error of fit refers to ((sum of squared residuals)/(N - t))''', N = of data points, t = number of parameters estimated; units are J/mol. ' x represents range of mole fraction of first component of the system. 'Number denotes of data points in data set. dIndicates the fit cited in the literature. eIndicates our selection as the best fit.

I

L

RKI8, 11

5

R I M , 11

t

-5f 0.0

RF[4,31 0.25

0.50

0.75

1.0

Mole F r a c t i o n E t h a n o l Figure 2. Deviation plot for the ethanol-water system a t 298 K (Costigan et al., 1980) as a function of concentration.

residual pattern. (Residual plots are valuable for checking for an overfit of the data. To satisfy the equations used to obtain the coefficients, the number of times the residual function crosses zero must be equal to, or greater than, the number of significant coefficients used; for random fits, the number of crossings will be larger.) One reason for fitting data is for extrapolation, albeit it is dangerous. Table I1 compares the various fits of the Redlich-Kister and rational functions with data at values of x less than 0.1 and greater than 0.9 omitted. (We chose this interval because many data sets have few points outside this range. Both heat and composition determinations become less accurate near the end points.) The table includes the pseudoresiduals calculated for the omitted data points. As before, the rational function offers no advantage over the simpler Redlich-Kister for the hexane-cyclohexane system. However, for the others, the rational function fits provide a much more accurate extrapolation for compositions near one where the first derivative is relatively smaller; results are mixed near zero composition. (In all cases, the heats of mixing were skewed toward 0 mole fraction.) The table clearly points out the potential error in extrapolating data from a function that overfits the data. Figure 3 presents the residual plot for the ethanol-water system at 298 K based on coefficients obtained from fitting

0.0

0.25

0.50

0.75

1.o

Mole F r a c t i o n E t h a n o l Figure 3. Deviation plot for the ethanol-water system a t 298 K (Costigan, et al., 1980) as a function of concentration when using only data between 0.1 and 0.9 in the regression.

the 0.1-0.9 mole fraction range. Although large deviations occur in the extrapolated region near zero, the rational function still is better; near pure ethanol, the rational function is clearly superior. Even more dangerous, but sometimes necessary, is to use the fitted function to obtain an extrapolated derivative. For excess properties, the partial molar property at infinite dilution is of both theoretical and practical importance. Table I11 lists the first derivative at the two end points for the fits of all of the data sets considered here. For comparison, values of H E dividided by x and 1- x at x near 0 and near 1,respectively, extrapolated to the end points are included. Whenever possible, the estimated values were obtained by linear regression-otherwise, the numbers were our best estimate. Derivatives extrapolated by using either polynomial form with all of the data gave comparable results. However, when results from the extrapolated fits are compared, the rational functions gave much better results. Figures 4 and 5 present comparisons of derivatives taken from the best Redlich-Kister and rational function fits of the ethanol data at 298 K; the data points denote H E I x and HE/(1- x ) in Figures 4 and 5, respectively. The calculated values should agree with the data only when both are

Ind. Eng. Chem. Res., Vol. 28, No. 4, 1989 487 Table 11. Comparison of Redlich-Kister Equations a n d Rational Functions for Extrapolation Redlich-Kister rational function error of extrapolation error of extrapolation system std error of fita abs RMSb re1 RMS' std error of fit' abs RMSb re1 RMS' (a) x < 0.1 mole fraction hexane-cyclohexane 0.40 0.41 0.0073 0.21 0.50 0.017 0.17 0.27 0.010 0.16 0.18 0.0079 (38,4Id 0.05 0.0039 0.005 0.15 0.18 0.14 0.011 0.14 0.05 0.0034 0.14 0.05 2.4 21 0.046 I-hexanol-nonane 38 0.096 9.1 21 0.051 5.2 0.020 1.9 8.8 (21,2) 3.1 0.028 1.6 13.0 8.7 0.021 0.022 1.9 9.6 2.3 0.005 1.9 ethanol-water 30 0.18 1.1 200 1.9 2.0 0.06 24 0.14 1.5 298.15 K 0.89 5.6 0.13 1.04 19 0.86 0.87 15 (64,33) 12 0.07 1.03 0.10 20 0.48 0.88 0.88 13 0.82 12 0.066 ethanol-water 1.0 27 0.14 0.86 333.15 K 0.89 12 0.07 11 0.066 0.91 0.11 0.36 21 16 0.065 (174) 0.90 9.7 0.057 0.94 0.31 24 0.13 10 0.086 hexane-cyclohexane (38,6Id

(b) x > 0.9 mole fraction 0.56 0.030 0.12 0.010 0.12 0.009 0.11 0.009 18 0.17 12 0.15 11 0.11 11 0.14 3.1 0.040 9.4 0.10 5.4 0.061 10 0.16 2.6 0.035 0.60 0.060 0.62 0.062 0.61 0.061 0.85 0.074 1.8 0.15

0.40 0.16 0.14 0.14 9.1 5.2 3.1 1.9 1.9 1.5 1.04 1.03 0.88 0.82 0.86 0.91 0.90 0.94

1-hexanol-nonane (21,1)

ethanol-water 298.15 K (643 ethanol-water 333.15 K (172)

0.21 0.17 0.15 0.14 2.4 1.9 1.6 1.9 1.1 0.89 0.87

0.11 0.19 0.16 0.11 3.8 1.5 2.0 1.2 3.7 0.46 1.1

0.010 0.012 0.012 0.028 0.045 0.018 0.023 0.014 0.042 0.005 0.012

0.88 1.o 0.89 0.37

1.4 2.1 1.2 0.62

0.016 0.21 0.10 0.06

0.31

0.45

0.04

a Standard error of fit refers to ((sum of squared residuals)/(N - t ) ) ' l 2 ,N = number of data points, t = number of parameters estimated; units are J/mol. Abs RMS is the root mean square of the sum of the squared pseudoresiduals. 'Re1 RMS is the root mean square of the sum of the squared pseudoresiduals divided by the experimental value. For (NJVZ), Nl is the number of data points used in the fit: N 2 is the number of data points for x C 0.1 or x > 0.9 mole fraction. e Indicates our selection as the best fit.

*

-2000 1 . .

.

.

,

.

.

.

,

,

.

.

.

.

,

i

-4000 .

2000

H

i

\-6OOO b

H

\,/RKIa,llextrapolated

1

2i1500 bi

1000

%

?\ RKIB, 11 1 0.0

0.025

0.05

0.075

0.10

500

11

I

0 ' 0.90

0.925

0.95

0.975

1.0

Mole F r a c t i o n E t h a n o l Figure 4. First derivative at low concentrations of ethanol as obtained from fitting heats of mixing for the ethanol-water system at 298 K (Costigan et al., 1980). The data points represent the ratio of H Edivided by the mole fraction of ethanol.

Mole F r a c t i o n E t h a n o l Figure 5. First derivative at high concentrations of ethanol as obtained from fitting heats of mixing for the ethanol-water system at 298 K (Costigan et al., 1980). The data points represent the ratio of H Edivided by the mole fraction of water.

extrapolated to the endpoints. Near zero composition, the two fits using all of the data are in reasonable agreement with the estimated experimental value. However, for the extrapolated fits, the rational function is significantly better. With the exception of the hexane-cyclohexane system, the derivatives for the Redlich-Kister fits based

on extrapolation all showed this same behavior near zero concentration. For the values near x = 1,the rational function fits using all the data as well as a limited amount of data give better agreement than both the extrapolated and unextrapolated Redlich-Kister fits. Again, this was the case for all of the

488

Ind. Eng. Chem. Res., Vol. 28, No. 4, 1989

Table 111. Comparison of d H E/dx Values at the E n d Points Obtained from the Different Regressions dH E/ dx, J / mol dHE/dx, J/mol svstem Redlich-Kister full fit extraDolated fit rational function full fit -extrapolated fit (a) Evaluation of dHE/dx at x = 0 hexane-cyclohexane 1300 1300 935 1340 (-1300 f 6)a 1 32Obsc 1320' 1320 1320 1310 1310 1300' 1290' 1310 1310 1310 1310 8 500 8 020 1-hexanol-nonane 35 700 -234 000 9 620 9 150 (15000 f 5000)" 21 700 14 300' 10 600' 10 300 39 100' 15 700 11500' 116OOc 23 300 15 600 ethanol-water -1 1300 -13 500 -9 710 41 000 298.15 K -10 500 -12 700 -10 200' -9 350' (-10205 f 10)' -9 700 -3 370' -12 200 -10200 -9 900 -11 300 -9 830"' -5 300 -10 200 -11 900 -6 260 -6 940' -5 280 -8 760 ethanol-water -6 040 -6 940 -5 680" -6 970 333.15 K -5 510 -6 610 -5 740 -8 160' -5 820 -6 770 -5 620'8' -6 860 -5 710 -8 540 hexane-cyclohexane (720 f 4)a 1-hexanol-nonane (--1640 f 20)" ethanol-water 298.15 K (2100 f 200p ethanol-water 333.15 K (410 f 65)"

a

Estimated from experimental data (see text).

(b) Evaluation of dHE/dx a t x = 1 -743 -745 -124btC -724' -719 -718 -720 -719 -2 370 -2 400 -1 110 -985 -2 040b -2 380 -1 260' -646' 1280 1890 2 930 2 870 2 490' 2 340 1580 961 1860*3' 1810 387 525' 618 527 534 525 394 426 467'8" 633

-723 -728 -726' -720 -1 460 -1 590' -1 610 -1 670 2 110 2 O7Oc 2 110

-724 -729 -727' -719 -1 470 -1 570 -1 710' -1 580 2 310 2 lOOC 2 150

2 110 569 462' 480

2 180

462

489

184 412

520'

Indicates the fit cited in the literature. Indicates our selection as the best fit.

data sets with the exception of the hexane-cyclohexane system.

Conclusions Our evaluation of rational functions shows them to be worth considering whenever a polynomial fit requires at least four parameters to accurately represent the data. For the systems we considered, which required more than four coefficients in the Redlich-Kister expansion, rational functions provided the same quality of fit with two fewer parameters. In addition, they can be more reliable for extrapolation of both the data and the first derivative. This is especially true if the first derivative is relatively small. Regardless of the functional form used, our study points out the importance of not overfitting data. To determine the truly best fit, it is important to consider residual plots in addition to the standard deviation of the fit. Behavior of the derivative also should be considered-especially if extrapolation is needed. Rational functions have two major drawbacks, the need for nonlinear regression and the more complex mathematics if analytical integration is needed. The algorithm in the Appendix provides good initial estimates of the parameters-normally the biggest problem in using nonlinear regression. If analytical integration is desired, one has to compare the merits of using a rational function with the difficulty of the mathematics if the function is of the order [3,3] or higher.

Nomenclature ai,bi = coefficients in polynomials

D = denominator coefficient in eq A-2 e , = coefficient of continued fracton, eq 2 F = rational function given in eq 1 H E = heat of mixing, j/mol k = coefficient in eq 5 m = order of polynomial in numerator n = order of polynomial in denominator N = numerator coefficient in eq A-2 RF = form of rational function given by eq 4 RK = Redlich-Kister polynomial, eq 3 s = sum of subscripts in Appendix t = number of coefficients in rational function, m X i= independent variable of data point i x = independent variable or mole fraction Yi= dependent variable of data point i

+n+1

Superscript k = value denoting power of n for given coefficient Subscripts i, j = indexes

Greek Symbol v = coefficients of continued fraction in u algorithm

Appendix The algorithm for determining the initial estimates of the coefficients of the rational function (i.e., the Pad6, approximant) consists of (a) using t ( = m+ n + 1) data

Ind. Eng. Chem. Res., Vol. 28, No. 4, 1989 489 points (Xi,Yi)to obtain the coefficients of the continued fraction in eq 2 and (b) converting the coefficients of the continued fraction into coefficients for the rational function. King and Queen (1979) use the v algorithm for the first step; it is briefly discussed here for completeness. We then discuss how to complete the second step. The v algorithm consists of generating terms in a triangular array which has t rows and columns. The first column, vi,l, contains all Yi. Entries in the remaining columns are computed by using the recursive relationship vi,j = ( X i - Xj-1) /(vi, j-1 - vi-1, j-1) (-4-1) where j = 2, 3, ..., t and i = j, j+l, ..., t. The diagonal elements, vij, are the coefficients, ei, of eq 2. The X i s need not be sequential. To obtain coefficients of the rational function, we start at the bottom of the continued fraction and compute F [1,11 as F[1,11 = (Nol,l + N1i,lx)/(Dol,l+ D1l,lx) (A-2) where

Nol,l= e,-2e,-le, - e,-2X,-1 - e,X,-2 N 11,1 = et-2 + e,

D 11,1 = 1 ei = vi,i The superscript denotes the power of x , and the subscripts represent the order of the rational function being generated in the step. The next division creates another rational function of the order [2,1], with the numerator values Nol,land N1l,l becoming D 02,1 and D 12,1, respectively. The numerator terms become

“2,l

=

et-3N01,1

= e-t”1

- xt-3D01,1

+ DOL1 - &-3D

l1,1

N22,1 = D l1,l In general, to compute any step beyond the order [1,1], the following recursive relations hold for the higher order rational functions of order [i,j] if s is odd D kii = N ki..l,, Dki,j = N k l,J-l .

if s is even

N o i , j= e,-JVoO - Xt-Jloo Intermediate terms are N k i , j= e,-JVko

+ Dk-lo - X t - J l k ( ) ,

12 = 1, 2, ..., i-1

The highest order term is

Nii, = e,-JVi( )

+ D i-l(

Ni., 1 1. = Di-1 0

)

if s is even if s is odd

If s is odd, then ( ) denotes (i-1,j); otherwise it represents (i,j-1). After iteration up to i = m and j = n, the expression is put into the form of eq 1by dividing all terms by Do,,n. To compute the rational function coefficients from the selected data points requires about 30 lines of FORTRAN code. A subroutine source code is available upon request. Literature Cited

= e,-le, - X,-l

N02,1

+

where s = i j. Here, k = 0, 1, 2, ..., j , and j = 1, 2, ..., n; values of i = 1, 2, ..., m. For the rational functions, we are considering j = i or i - 1. The lowest order term of the numerator is

Acton, F. S. Numerical Methods That Work;Harper and Row: New York, 1970. Christensen, J.; Izatt, R.; Stitt, B.; Hanks, R.; Williamson, K. The Excess Enthalpies of Seven n-Nonane + Alcohol Mixtures at 298.15K. J . Chem. Thermodyn. 1979,11, 1029-1034. Costigan, M.; Hodges, L.; Marsh, K.; Stokes, R.; Tuxford, C. The Isothermal Displacement Calorimeter: Design Modifications for Measuring Exothermic Enthalpies of Mixing. Aust. J. Chem. 1980, 33,2103-2119. Ewing, M. B.; Marsh, K. N. The Enthalpy of Mixing n-Hexane + Cyclohexane at 288.15 and 318.15K. J.Chem. Thermodyn. 1970, 2,295-296. King, M. B.;Queen, N. M. Use of Rational Functions for Representing Data. J . Chem. Eng. Data 1979, 24, 178-181. Ott, J.; Cornett, G.; Stouffer, C.; Woodfield, B.; Guanquan, C.; Christensen, J. Excess Enthalpies of (Ethanol + Water) at 323.15, 333.15, 348.15, and 373.15K and from 0.4 to 15 MPa. J . Chem. Thermodyn. 1986, 18, 867-875. Prausnitz, J. M. Molecular Thermodynamics of Fluid-Phase Equilibria; Prentice-Hall: Englewood Cliffs, NJ, 1969. SAS Institute Inc. SAS User’s Guide: Statistics, 5th ed.; SAS Institute Inc.: Cary, NC, 1985.

Received f o r reuiew September 19, 1988 Accepted December 20,1988