6
Computers and Chemical Engineering 23 (1999) 385390 Potential applications of artificial neural networks to thermodynamics: vaporliquid equilibrium predictions Raj Sharma*, Diwakar Singhal, Ranjana Ghosh, Ashish Dwivedi Department of Chemical Engineering, Malaviya Regional Engineering College, Jaipur 302 017, India Received 1 October 1997; revised 30 September 1998; accepted 30 September 1998 Abstract The associative property of artificial neural networks (ANNs) and their inherent ability to ‘‘learn’’ and ‘‘recognize’’ highly non-linear and complex relationships finds them ideally suited to a wide range of applications in chemical engineering. Dynamic Modeling and Control of Chemical Process Systems and Fault Diagnosis are the two significant applications of ANNs that have been explored so far with success. This paper deals with the potential applications of ANNs in thermodynamics — particularly, the predic- tion/estimation of vaporliquid equilibrium (VLE) data. The prediction of VLE data by conventional thermodynamic methods is tedious and requires determination of ‘‘constants’’ which is arbitrary in many ways. Also, the use of conventional thermodynamics for predicting VLE data for highly polar substances introduces a large number of inaccuracies. The possibility of applying ANNs for VLE data prediction/estimation has been explored using the back propagation algorithm. The methaneethane and ammoniawater systems have been studied and the VLE predictions have been found to be accurate to within $1%. Preliminary results confirm exciting possibilities of ANNs for applications to thermodynamics of mixtures. Advantages and limitations of this application are also discussed. An heuristic approach to reduce the trial and error process for selecting the ‘‘optimum’’ net architecture is discussed. ( 1999 Elsevier Science Ltd. All rights reserved. 1. Introduction ‘‘Neurocomputing’’ has become an established disci- pline and has gained extensive interest within chemical engineering as a tool for ‘‘effortless’’ computation. Most chemical engineering processes are non-linear and com- plex with conventional modeling and simulation tech- niques relying often on certain simplifying transport, kinetic and/or thermodynamic assumptions. Artificial neural networks (ANNs), on the other hand, overcome the limitations of the conventional approach by extract- ing the desired information directly from the data. Thus, ANN process models are more cost effective and elimin- ate the need for ‘‘detailed effort’’ (Venkatasubramaniam and McAvoy, 1992). ANNs have been successfully em- ployed in solving problems in areas such as fault diagnosis, dynamic modeling and control of chemical processes (Bhat and McAvoy, 1990; Hoskins and Him- melblau, 1988; Willis et al., 1991; Singhal et al., 1996). * Corresponding author. E-mail: rsch@arya.recjai.ernet.in Petersen et al., (1994) also used ANNs for estimating activity coefficients. In spite of the extensive range of ANN applications explored for use in chemical engineer- ing, long times required for training the net and ‘‘overfit- ting’’ of the data are some of their disadvantages. In this work, potential application of neurocomputing for estimating vaporliquid equilibrium (VLE) data has been explored. Conventional thermodynamic methods for VLE data estimation of mixtures are tedious and involve a certain amount of empiricism by way of deter- mining mixture ‘‘constants’’ using arbitrary mixing rules. ANNs, on the other hand, facilitate such predictions and eliminate the need for determining these constants by attempting to map the functional relationship all at once. ANNs also offer the potential to overcome the limita- tions of existing equations-of-state (EOS) in determining VLE data for highly polar systems. The ammoniawater and the methaneethane systems were investigated and the results are presented. The methodology used and the advantages and the limitations of this approach have also been discussed. The well-known multilayer perceptron model using the back propagation algorithm (BPA) with the many 0098-1354/99/$ see front matter ( 1999 Elsevier Science Ltd. All rights reserved. PII: S 0 0 9 8 - 1 3 5 4 ( 9 8 ) 0 0 2 8 1 - 6

Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

Embed Size (px)

Citation preview

Page 1: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

Computers and Chemical Engineering 23 (1999) 385—390

Potential applications of artificial neural networksto thermodynamics: vapor—liquid equilibrium predictions

Raj Sharma*, Diwakar Singhal, Ranjana Ghosh, Ashish Dwivedi

Department of Chemical Engineering, Malaviya Regional Engineering College, Jaipur 302 017, India

Received 1 October 1997; revised 30 September 1998; accepted 30 September 1998

Abstract

The associative property of artificial neural networks (ANNs) and their inherent ability to ‘‘learn’’ and ‘‘recognize’’ highly non-linearand complex relationships finds them ideally suited to a wide range of applications in chemical engineering. Dynamic Modeling andControl of Chemical Process Systems and Fault Diagnosis are the two significant applications of ANNs that have been explored sofar with success. This paper deals with the potential applications of ANNs in thermodynamics — particularly, the predic-tion/estimation of vapor—liquid equilibrium (VLE) data. The prediction of VLE data by conventional thermodynamic methods istedious and requires determination of ‘‘constants’’ which is arbitrary in many ways. Also, the use of conventional thermodynamics forpredicting VLE data for highly polar substances introduces a large number of inaccuracies. The possibility of applying ANNs for VLEdata prediction/estimation has been explored using the back propagation algorithm. The methane—ethane and ammonia—watersystems have been studied and the VLE predictions have been found to be accurate to within $1%. Preliminary results confirmexciting possibilities of ANNs for applications to thermodynamics of mixtures. Advantages and limitations of this application are alsodiscussed. An heuristic approach to reduce the trial and error process for selecting the ‘‘optimum’’ net architecture is discussed.( 1999 Elsevier Science Ltd. All rights reserved.

1. Introduction

‘‘Neurocomputing’’ has become an established disci-pline and has gained extensive interest within chemicalengineering as a tool for ‘‘effortless’’ computation. Mostchemical engineering processes are non-linear and com-plex with conventional modeling and simulation tech-niques relying often on certain simplifying transport,kinetic and/or thermodynamic assumptions. Artificialneural networks (ANNs), on the other hand, overcomethe limitations of the conventional approach by extract-ing the desired information directly from the data. Thus,ANN process models are more cost effective and elimin-ate the need for ‘‘detailed effort’’ (Venkatasubramaniamand McAvoy, 1992). ANNs have been successfully em-ployed in solving problems in areas such as faultdiagnosis, dynamic modeling and control of chemicalprocesses (Bhat and McAvoy, 1990; Hoskins and Him-melblau, 1988; Willis et al., 1991; Singhal et al., 1996).

*Corresponding author. E-mail: [email protected]

Petersen et al., (1994) also used ANNs for estimatingactivity coefficients. In spite of the extensive range ofANN applications explored for use in chemical engineer-ing, long times required for training the net and ‘‘overfit-ting’’ of the data are some of their disadvantages.

In this work, potential application of neurocomputingfor estimating vapor—liquid equilibrium (VLE) data hasbeen explored. Conventional thermodynamic methodsfor VLE data estimation of mixtures are tedious andinvolve a certain amount of empiricism by way of deter-mining mixture ‘‘constants’’ using arbitrary mixing rules.ANNs, on the other hand, facilitate such predictions andeliminate the need for determining these constants byattempting to map the functional relationship all at once.ANNs also offer the potential to overcome the limita-tions of existing equations-of-state (EOS) in determiningVLE data for highly polar systems. The ammonia—waterand the methane—ethane systems were investigated andthe results are presented. The methodology used and theadvantages and the limitations of this approach havealso been discussed.

The well-known multilayer perceptron model usingthe back propagation algorithm (BPA) with the many

0098-1354/99/$ — see front matter ( 1999 Elsevier Science Ltd. All rights reserved.PII: S 0 0 9 8 - 1 3 5 4 ( 9 8 ) 0 0 2 8 1 - 6

Page 2: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

modifications proposed to reduce the number of trainingiterations (Srivastava, 1991) was used in this work.

2. ANN versus EOS approach to VLE data prediction

VLE data is generally estimated using thermodynamic‘‘models’’ based on the well-known fundamental phaseequilibrium criterion of equality of chemical potentialsin both the phases. Most of these thermodynamic modelsare sets of equations — empirical and semi-empirical— with each having several constants determined usingcertain mixing rules (for mixtures) which are arbitrary inmany ways. The uncertainties thus introduced limit therange of systems and conditions for which the conven-tional thermodynamic methods can ‘‘safely’’ be used. TheEOS approach applies well to hydrocarbon systems butis quite handicapped for systems containing polar com-pounds. Further, the EOSs are neither able to describethe critical region satisfactorily for mixtures nor estimatethe liquid properties accurately. Activity coefficients aregenerally used for determining liquid properties and sev-eral estimation techniques exist in the literature (seeSmith and van Ness, 1995; Fredenslund et al., 1977).However, each has its limitations in its applicability todifferent systems; for instance, even though the UNIFACmethod (Fredenslund et al., 1977) is applicable even tosystems containing water, it has its limitations with re-gard to hydrocarbon mixtures. In brief then, thermo-dynamics of mixtures are more complicated than for purecompounds and the difficulty in mixture analysis in-creases with the extent of non-ideality.

ANNs, on the other hand, being purely ‘‘numeric’’ innature do not require thermodynamic modeling; andhence, are convenient for VLE data prediction. A limiteddatabase can be used to train a net properly for it to learnthe possible pattern of the pressure (P) — temperature(¹) — liquid mole fraction (x) — vapor mole fraction (y)surface for a system in a small range of P and ¹.

3. Neural equation of state (NEOS) for a binary system

Two intensive properties are required to completelydescribe a binary two phase system at equilibrium (GibbsPhase Rule). Pressure and temperature are two suchconvenient intensive properties which are also easilymeasured and controlled. Therefore, the net developed(NEOS) uses P and ¹ as the inputs and gives x and y asthe outputs.

Two different systems — the ammonia—water and themethane—ethane systems — were selected to explore theuse of ANNs as an alternative to VLE data prediction.The ammonia—water system cannot be described accu-

rately by a popular EOS owing to the presence of water— a polar compound; while the methane—ethane systemis simple to deal with and can be adequately described byan appropriate EOS. Thus, the choice of these two ‘‘ex-treme’’ systems, in terms of thermodynamic complexities,should adequately illustrate the capabilities of an ANNto represent a wider range of systems than an EOS. Thepredictions of the ANN for the above two systems com-pare well with literature values, thereby demonstratingthat the NEOS indeed has the potential to be at par with,if not better than, the existing EOSs.

4. NEOS methodology

4.1. The ammonia—water system

The ANN was trained for the ammonia—water systemusing values taken from the literature (Macriss et al.,1964). Three different approaches, based on the amountof training data used, were employed to train the net forthis system. The training data used for each approachconsisted of:f data for only a small range of pressure (at 20—50 psia),f data points at extreme pressures only (at 25, 50, 275

and 300 psia),f all the available data points.

All the above data was within the temperature range of0—417.43°F. The optimum net architecture — the 2-13-2net — for which the ‘‘best’’ results were obtained wasarrived at by an heuristic approach discussed below.

4.2. The methane—ethane system

The VLE data available for the methane—ethane sys-tem was limited and the net was trained for the entiredatabase all at once (a total of 75 points in the pressureand temperature range of 28—719 psia and 234.7—359.9°F,respectively). The optimum net architecture was againdetermined to be 2-13-2 by the heuristic approach de-scribed below.

5. The heuristics

Even though a number of techniques have beenpresented for network topology selection (Kung andHwang), it still remains an iterative trial and error pro-cedure. The following heuristic approach was used toreduce the trial and error selection process. One hiddenlayer with an appropriate number of hidden units iscapable of mapping any input presentation (Sartori andPanos, 1991); hence, the study is restricted to one layeronly (training with two layers was also attempted with-out any gain in accuracy).

386 R. Sharma et al. / Computers and Chemical Engineering 23 (1999) 385—390

Page 3: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

For the purpose of determining the optimum numberof hidden units, the learning rate (g) and the momentumterm (a) were assigned arbitrary but constant values andthe gain term was fixed at a value of unity. With all theparameters thus fixed, various net topologies exhibitedthe same trends relative to each other vis-a% -vis the overallabsolute error as a function of the number of iterations inthe training mode (Dwivedi, 1992). Thus, it was foundpossible to determine the optimum net architecture with-in 50—100 iterations without traversing the entire graphof the absolute error as a function of the number ofiterations for each topology. The number of iterationswas used as the criterion for determining the overallabsolute error rather than the time-steps. The time-stepsare generally used as the criterion whenever on-line pre-dictions are to be made such as for chemical processcontrol where computation time is of importance.

The selection of a, g and the gain term is essentiallya trial and error procedure. Contrary to the usual ap-proach, these parameters were not fixed at constantvalues for the entire training period. These were initiallyassigned arbitrary values (a"g"0.8, gain"1 for thiscase) and were updated while the training was in pro-gress. The abrupt change in these parameters ‘‘jolted’’ theoverall absolute error out of the local minima which istypically encountered in the gradient descent mechanism(Rummelhart and Mclleland, 1986).

Once the net parameters and the net architecture werefixed, the minimum number of training data sets requiredfor adequate mapping was determined by a trial anderror procedure. The net was then ready to learn the datapresented using the BPA.

6. Results and discussion

The use of NEOS to predict phase compositions (x andy) at given P and ¹ conditions was found to be satisfac-tory. As stated earlier, the ammonia—water and the meth-ane—ethane systems were studied for this application. Thedata used in this study consisted of pressure (psia) andtemperature (°F) as inputs to the net. Liquid and vaporweight fractions (x and y, respectively) were predicted bythe net. Several data sets were used for training and thenet architecture of 2-13-2 was found suitable for all thecases presented. This indicates the possibility of parallel-ism/similarity in the degree of complexity of the VLE intwo component—two phase systems. The performance ofthe net was evaluated on the basis of an overall absoluteerror specified by the difference in the desired and actualoutputs as defined below:

Overall absolute error

"+ (actual output!desired output)/p,

where, p equals the number of data sets.

6.1. The ammonia—water system

6.1.1. Training with a small range of dataOne of the approaches to train the net was to use only

a small range of training data; that is data at pressures of15, 25, 30 and 50 psia, respectively and the correspondingtemperatures (a total of 96 data points). The net was thenused to predict VLE data at 40 psia (which was notincluded in the training data) and the results are present-ed in Fig. 1. A comparison of the predicted and the‘‘actual’’ curves shows that the net was able to predict theVLE data with an overall absolute error of only 0.006 fora pressure that was not a part of the training set.

6.1.2. Training with a large range of dataTraining of the net with large data sets (approximately

600) in the pressure range of 15—300 psia was accomp-lished with an error in the liquid phase composition ofaround 0.009 and that in the vapor phase compositionof around 0.0056. Typical results are presented inFigs. 2 and 3. As would be expected in training the netwith large sets of data, the comparisons between litera-ture values and the predicted values of VLE data wereextremely satisfactory.

Within the three-dimensional P—¹-composition space,the states of pairs of phases coexisting at equilibriumdefine continuous rounded surfaces (Peng and Robinson,1976). The under surface represents saturated liquidstates (P—¹—x surface) and the upper surface representsthe saturated vapor states (P—¹—y surface). Training ofthe net was also attempted at the two extremes of data,that is, at 25, 50, 275 and 300 psia, respectively. The netsuccessfully maps the P—¹—y surface (Figs. 4 and 5) butthe interpolations were not very good in some cases forthe P—¹—x surface (Figs. 4 and 5). A common character-istic of all the predictions was a constant shift in thecurves. This can, perhaps be explained by the fact that

Fig. 1. VLE predictions for NH3/H

2O system at 40 psia (not a train-

ing set).

R. Sharma et al. / Computers and Chemical Engineering 23 (1999) 385—390 387

Page 4: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

Fig. 2. VLE predictions for NH3/H

2O system at 50 psia (training with

all available data points).

Fig. 3. VLE predictions for NH3/H

2O system at 275 psia (training with

all available data points—training set).

Fig. 4. VLE predictions for NH3/H

2O system at 40 psia (training

data—points at extreme pressures).

Fig. 5. VLE predictions for NH3/H

2O system at 140 psia (not a train-

ing set—training with data points at extreme pressures).

while mapping the surface, the net does ‘‘learn’’ the trendbut is unable to place the lines (constant pressure curves)accurately on the surface; hence, the shift (also, the sur-face is highly non-linear and the data points are farapart). This shift is not observed when the net is trainedwith data points closely placed in batches as in Fig. 2. Itwas also observed that the normalising technique has aneffect on the error and that small inputs do not seem tocarry ‘‘weight’’ as compared to the larger values (in thiswork, the normalised valued of pressure and temperaturevary from 0.042 to 0.860 and 0 to 0.9, respectively).

To understand the high error in the liquid weightfraction predictions, the net was trained with P, ¹, asinputs and x as output. Typical results are shown in Figs.6 and 7 and are satisfactory. This indicates that the netwas not able to generate the upper and lower surfacesimultaneously but the results are good when only onesurface — the P—¹—x — is generated. Again the net trainswell at higher pressures (Fig. 7) but not at low pressures(Fig. 6). The figure also indicates that the net is not ableto predict the upper half (weight fraction greater than 0.5)of the curve properly. This is owing to the lack of data inthis region as compared to the lower half. Less than 30%of the data was in this region (x greater than 0.5) whereasthe non-linearity in this region is higher. Attempts are onto reduce the number of iterations and the minimumnumber of training data sets as well as ‘‘errors’’.

6.1.3. Comparison with the VLE data predicted by theactivity coefficient approach

In order to establish NEOS as a plausible alternativeto the thermodynamic methods for VLE data predictionof a highly polar system (NH

3—H

2O), the results ob-

tained by NEOS were compared with those obtainedusing the best available activity coefficient approach (seeGupta and Vashishtha, 1997). Wilson parameters were

388 R. Sharma et al. / Computers and Chemical Engineering 23 (1999) 385—390

Page 5: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

Fig. 6. VLE predictions for NH3/H

2O system at 50 psia—training of

x only (training set).

Fig. 7. VLE predictions for NH3/H

2O system at 250 psia—training of

x only (training set).

found to be best suited for this purpose (Reid et al., 1977).Wilson’s parameters were estimated by reducing the VLEdata for the system at 100°F. The vapor phase fugacitycoefficients were calculated using the Peng—RobinsonEOS (1976). The results of such predictions are plottedalong with the predictions of NEOS and actual valuesat 15 psia in Fig. 8. The vapor phase predictions of boththe approaches appear to be good but liquid phasepredictions of NEOS are far better than the ‘‘Wilson’’predictions.

6.2. The methane—ethane system

The VLE curves for this system using NEOS show thatthe mapping of the P—¹—y surface is better than thatof the P—¹—x surface. Typical results are presented in

Fig. 8. VLE predictions for NH3/H

2O system at 15 psia.

Fig. 9. VLE data for CH4/C

2H

6system at 284.7 R.

Fig. 10. VLE data for CH4/C

2H

6system at 343.6 R.

Figs. 9 and 10. The figures also present the predictedvalues using the Peng—Robinson EOS. It is clearly visiblethat the NEOS predictions are as good as the EOSpredictions for such a system even with a limited

R. Sharma et al. / Computers and Chemical Engineering 23 (1999) 385—390 389

Page 6: Potential applications of artificial neural networks to thermodynamics: vapor–liquid equilibrium predictions

database. Although the results are not exhaustive for ageneral ‘‘NEOS’’ applicable to all systems, they seem tobe conclusive, in principle, to the capability of an ANN informing a general NEOS.

7. Conclusions

The neural network approach used in this work forVLE data prediction gave favorable results for the am-monia—water and the methane—ethane systems to withinand error of $1%. The net gave better results whengenerating only one surface — the P—¹—x surface or theP—¹—y surface — as compared to the simultaneous pre-diction of both. An even spread of the data seemed to beessential for better predictions. Thus, in principle, neuralnetworks hold promise as a strategy for solving thetedious VLE data generation problem and the develop-ment of a ‘‘general NEOS’’ widely applicable to differentsystems. The ANNs should particularly be useful formapping highly polar systems which fall outside therange of applicability of the conventional thermodyn-amic methods. Applications of ANNs for predictingother thermodynamic properties may also be explored.An heuristic approach has also been developed whichreduces the number of iterations required in the netarchitecture selection process.

Acknowledgements

The authors wish to thank Nimisha Gupta and Man-ish Vashishtha for their assistance with the EOS esti-mates of the VLE data for the systems considered in thiswork. Assistance of Swati Jain with the preparation ofthe manuscript is also gratefully acknowledged.

References

Bhat, N., & McAvaoy, T. J. (1990). Use of neural nets for dynamicmodelling and control of chemical process systems. Comput. Chem.Engng, 14(4/5), 573—583.

Dwivedi, A. (1992). Neural networks — applications in prediction ofVLE data. B.Tech. Senior Project Report, Department ofChemical Engineering, MREC, Jaipur, India.

Fredenslund, Aa, Gmehling, J., & Rasmussen, P. (1977). Vapor—liquidequilibria using UNIFAC. NewYork: Elsevier.

Gupta, N., & Vashishtha, M. (1997). Neural networks: Applications andperformance evaluation in prediction of VLE data. B.Tech. SeniorProject Report, Department of Chemical Engineering, MREC,Jaipur, India.

Hoskins, J.C., & Himmelblau, D. M. (1988). Artificial neural networkmodels for knowledge representation in Chemical Engineering.Comput. Chem. Engng, 12(9/10), 881—890.

Kung, S. Y., & Hwang, J. N. Research supported by NSF and Informa-tive Science and Technology Office of the Strategic Defence Initiat-ive Organisation, Contract No. N00014-55-k-9469 and N0014-85-k-0599.

Macriss, R. A. et al. (1964). Research Buletin No. 34, Institute of gasTechnology, Chicago.

Peng, D. Y., & Robinson, D. B. (1976). A new two constant equation ofstate.Ind. Engng. Chem. Fundam., 15, 59.

Petersen, R., Fredenslund, A., & Rasmussen, P. (1994). Artificial neuralnetworks as a predictive tool for vapor—liquid equilibrium. Com-put. Chem. Engng, 18 (Suppl. S63—S67).

Reid, R. C., Prausnitz, J. M., & Sherwood, T. K. (1977). The properties ofgases and liquids (3rd ed.). New York, McGraw-Hill.

Rummelhart, D. E., & McClleland, J. L. (1986). Parallel distributedprocessing (Vol. 1), Cambridge, MA: MIT Press.

Sartori, M. A., & Panos, J. A. (1991). IEEE Trans. Neural Networks, 2, 4.Singhal, D., Ghosh, R., & Sharma, R. (1996). Proc. Int. Conf. Advances

in Chemical Engineering, IIT-Madras, 11—13 December 1996(pp. 319—325). New Delhi: Allied Publishers.

Smith, J. M., & Van Ness, H. C. (1995). Thermodynamics for chemicalengineers (5th ed.). New York: McGraw Hill.

Srivastava, S. C. (1991). Refresher course on expert systems and neuralnetworks. IEEE-IIT, Kanpur, India.

Venkatasubramaniam, V., & McAvoy, T. J. (1992). Editorial. Comput.Chem. Engng., 16, 4.

Willis, M. J., Massimio, C. D., Montague, G. A., Tham, M. T., & Mor-ris, A. J. (1991). Artificial neural networks in process engineering.IEE Proc. -D, 138, 256.

390 R. Sharma et al. / Computers and Chemical Engineering 23 (1999) 385—390