the use of neural networks onvle data prediction -...

8
Journal of Scientific & Industrial Research Vol. 63, April 2004, pp. 336-343 The use of neural networks on VLE data prediction t Mehmet Bilgin*, I Metin Hasdemir and Oguzhan Oztas** Istanbul University, Engineering Faculty, Department of Chemical Engineering, 34320 Avcilar, Istanbul, Turkey The neural network model is employed topredict the vapor-liquid equilibrium (VLE) data for six different binary systems having different chemical structures and solution types (azeotrope-nonazeotrope) in various conditions (isothermal or isobaric). A model based on a feed-forward back-propagation neural network is proposed. Only half of the experimentally determined VLEdata are assigned to the designed framework as training patterns in orderto estimate the VLE data of the whole system in given conditions. TheVLE data are also calculated by the UNIFAC model, a calculation method widely used in this field. The mean deviations from the experimental data aredetermined forboth the models. Itisobserved that the data found by neural network model gives an excellent agreement with theexperimental data, while theUNIFAC model shows deviations, particularly atlow pressures. In fact the neuralnetwork model can betreated as apotent means for VLE dataprediction in a fast and reliable way, compared to the conventional thermodynamical models. Keywords: Vapor-liquid equilibrium, Neural network, Activity coefficients, UNIFAC model IPC : Int. C1. 7 : G 06 N 3/02 Introduction In chemical industry the vapor-liquid equilibrium (VLE) dataare mo£tly important for the design 0[_ distillation columns,where the liquid mixtures are separated into their components. The correlation of these data is found thermodynamically byvarious interpretations of the Gibbs-Duhem equation, because it is troublesome and time consuming to get them experimentally. The Wilson,NRTL, and UNIQUAC are the local composition models, and UNIFAC and ASOGare the main group contribution methods based on UNIQUAC andWilson, respectively, impliciting the local composition concept. Someof the models such as, UNIFAC-Lyngbi, UNIFAC-Dortmund 2 , and UNIQUAC-A 3 were modified for special cases. Another type of estimation methods are the Margules and 'van Laar equations, which are empiricalmodels of solution behaviour, derived fromexcess Gibbs energy function. These models represent the excess Gibbs energy function in different types of mathe- matical expressions and are used, both in vapor-liquid and liquid-liquid equilibrium calculations. The t This work was supported by the Research Fund of the Istanbul Uni versity, Project number: 172911508200 I "Author for correspondence ""Department of Computer Engineering common feature is that the models use the liquid phase activitycoefficient to achieve the equilibrium data. Therefore, these methods are called activity coefficientmodels, in general, and include two or moreenergy parameters with respecttoa particular system. A set of specific parameters measured with respect to any systemisvalid exclusively for such a particular system (it cannot predict differences betweenisomers for example). On the other hand, because of the complexity of mathematical functions in some models, determination of the energy parameters is mathematically difficult. Furthermore, for a defined system the energy parameters determined by a known model given by different sources in the literature, isfound to be sometimes different. In fact, any doubt about theVLE estimates causes the design to be made at higher reflux ratio than may be necessary, leading to increased energy usage in distillation method. Although these models have limited flexibility inthefitting of data, they are adequate for most engineering purposes.But these uncertainties cause errors in activity coefficient data, especially in equilibrium data. The neural network model, proposed in thispaper, is an alternatively intensive usedmethod for most of prediction problems in engineering calculations and/or for different purposes. Many studies have

Upload: voliem

Post on 02-May-2018

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

Journal of Scientific & Industrial ResearchVol. 63, April 2004, pp. 336-343

The use of neural networks on VLE data prediction t

Mehmet Bilgin*, I Metin Hasdemir and Oguzhan Oztas**Istanbul University, Engineering Faculty, Department of Chemical Engineering, 34320 Avcilar, Istanbul, Turkey

The neural network model is employed to predict the vapor-liquid equilibrium (VLE) data for six different binarysystems having different chemical structures and solution types (azeotrope-nonazeotrope) in various conditions (isothermalor isobaric). A model based on a feed-forward back-propagation neural network is proposed. Only half of the experimentallydetermined VLE data are assigned to the designed framework as training patterns in order to estimate the VLE data of thewhole system in given conditions. The VLE data are also calculated by the UNIFAC model, a calculation method widelyused in this field. The mean deviations from the experimental data are determined for both the models. It is observed that thedata found by neural network model gives an excellent agreement with the experimental data, while the UNIFAC modelshows deviations, particularly at low pressures. In fact the neural network model can be treated as a potent means for VLEdata prediction in a fast and reliable way, compared to the conventional thermodynamical models.

Keywords: Vapor-liquid equilibrium, Neural network, Activity coefficients, UNIFAC model

IPC : Int. C1.7: G 06 N 3/02

IntroductionIn chemical industry the vapor-liquid equilibrium

(VLE) data are mo£tly important for the design 0[_distillation columns, where the liquid mixtures areseparated into their components. The correlation ofthese data is found thermodynamically by variousinterpretations of the Gibbs-Duhem equation, becauseit is troublesome and time consuming to get themexperimentally. The Wilson, NRTL, and UNIQUACare the local composition models, and UNIFAC andASOG are the main group contribution methods basedon UNIQUAC and Wilson, respectively, implicitingthe local composition concept. Some of the modelssuch as, UNIFAC-Lyngbi, UNIFAC-Dortmund2

,

and UNIQUAC-A3 were modified for special cases.Another type of estimation methods are the Margulesand 'van Laar equations, which are empirical modelsof solution behaviour, derived from excess Gibbsenergy function. These models represent the excessGibbs energy function in different types of mathe-matical expressions and are used, both in vapor-liquidand liquid-liquid equilibrium calculations. The

t This work was supported by the Research Fund of the IstanbulUni versity, Project number: 172911508200 I

"Author for correspondence""Department of Computer Engineering

common feature is that the models use the liquidphase activity coefficient to achieve the equilibriumdata. Therefore, these methods are called activitycoefficient models, in general, and include two ormore energy parameters with respect to a particularsystem. A set of specific parameters measured withrespect to any system is valid exclusively for such aparticular system (it cannot predict differencesbetween isomers for example). On the other hand,because of the complexity of mathematical functionsin some models, determination of the energyparameters is mathematically difficult. Furthermore,for a defined system the energy parametersdetermined by a known model given by differentsources in the literature, is found to be sometimesdifferent. In fact, any doubt about the VLE estimatescauses the design to be made at higher reflux ratiothan may be necessary, leading to increased energyusage in distillation method. Although these modelshave limited flexibility in the fitting of data, they areadequate for most engineering purposes. But theseuncertainties cause errors in activity coefficient data,especially in equilibrium data.

The neural network model, proposed in this paper,is an alternatively intensive used method for most ofprediction problems in engineering calculationsand/or for different purposes. Many studies have

Page 2: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

claimed neural networks potent applicability foranalysis of some complex systems. Neural networkshave succeeded in coping with a few biological andchemical problems such as, control of bioreactorswith unstable parameters4, prediction of secondarydimensional structure of proteins5, analysis ofoverlapped spectrum or chromatography6, propertyprediction of compounds?, phase equilibriumprediction in aqueous two-phase extraction8, anddesign of a combined mixing rule for the prediction ofvapor-liquid equilibria9•

The neural network is unable to offer parameterssuch as, the second virial coefficients inthermodynamic meanings or any energy parameter ina detailed mechanism. For the purpose of gainingpromising predictability, an approach based onoptimum neural network architecture should bedetermined.

Thermodynamic BasisFor any vapor-liquid system in equilibrium the

equality of fugacities of pure components leads to,

where Yi is the mole fraction of component i in vaporphase, Xi is the mole fraction in liquid phase, <1>; is thefugacity coefficient of i in the vapor phase, P is thetotal pressure, Yi is the activity coefficient of i in the

fluid phase and J;0 is the standard-state fugacity ofthe pure i component. The standard-state fugacity isconsidered the fugacity of pure liquid i (j;) at systemtemperature and pressure and is given by:

J; =pSthS [V/(P-P/)]. . 'V. exp ----- ,I " RT

where for pure liquid, p/ is the saturation (vapor)

pressure, <1>; is the fugacity coefficient at saturation,

and V;L is the molar liquid volume, at temperature T.

The exponential is known as the Poynting factor.Substituting in Eq. (1) for fi by Eq. (2) and solving forYi gives:

y.cp.pYi = I ~s '

Xi' i

f [V.L(P_PS)]where CP. =-' .exp _ I I

I <1>; RT

At low pressures, vapor phases usually approxi-mate ideal gases, for which <1>; = <1>; = 1 and thePoynting factor, represented by the exponential,differs from unity by only a few parts per thousandand their influence in Eq. (4) nullifies. Thus theassumption that <I>i = 1 introduces some error forlow-pressure VLE data, the Eq. (3) gets reduce to:

Y _ Yi'Pi--

pSXj' j

Neural Network ModelA neural network mimics the structure of human

synapse connections to imitate the work of the brain.Typical structure of a neural network consist ofmultiple layers, each of them has a group ofcomputing neurones, as shown in Figure 1. Each ofthe neurone in one layer is completely connected withothers in the adjacent layers but not with ones in thesame layer. The first layer merely stores andtransports the values of the input features to the nextlayer, the last layer calculates the output values, andbetween them are the hidden layers.One typical neurone in such a neural net is shown

in Figure 2. The inputs X are the products of theincoming neurone values L and synaptic weights w,Eq. (6). The output Y is then determined by applyingthe resulting input value to the activation function.There are many activation functions available to beadopted for a net. In this work the log sigmoidfunction, given in Eq. (7), was preferred. As a result

Fig. I-Typical structure of a neural net consisting of multiplelayers

Page 3: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

of this preference the input values can be any valuesin the range of - 00 and + 00 , but the output values arelimited between 0 and 1. Thus, normalisation to thevapor-liquid equilibrium data was performed in orderto obey the output ranges. Eq. (6) and (7) are given asbelow:

y = f(~LjWi) ,1

f(X) = 1 -x'+e

here N is the number of incoming values fromdifferent neurones, L is the vector of incomingneurones, and w is the synaptic weights betweenincoming values and selected neurone.

Experimental ProcedureThe feature of the neural network has been adapted

to deal with the prediction of the VLE data of sixvarious systems (Table 1). Four of the systems weretaken from literature. All of the systems presentvarious chemical structures and different solution

o Weights

~

oLo . Inputs; ': X

types (azeotrope-nonazeotrope) under variousconditions (isothermal or isobaric). The isobaric VLEdata of isopropanol - methyl isobutyl ketone (MIBK)systems at 53.33 and 80.0 kPa were determinedexperimentally.Isopropanol and methyl isobutyl ketone were used

in Merck quality. An all-glass dynamic recirculatingvapor-liquid equilibrium apparatus, developed byFischer Scientific Co., equipped with temperature andpressure controllers were used in the experimentalequilibrium data determinations. The still allows goodmixing and flowing of both vapor and liquid phasesthrough an extended contact line, which guaranties anintense phase exchange and their separation, once theequilibrium is reached. The equilibrium temperaturewas measured using a mercury glass thermometer(Fischer certificated) within an accuracy of ± 0.05 K.The temperature control of the heating was achievedby a digital thermometer provided with a Pt-100sensor. The total pressure of the system wascontrolled by an electronic manometer. The VLE testswere run at 40, 66.66 and 101.32 ± 0.02 kPapressures, respectively. The equilibrium conditionswere checked by the reproducibility of the results ofgas chromatography (GC) analysis of liquid samplestaken from two phases.Approximately, 100 mL low boiling component

(isopropanol) was put in the boiler of the apparatus.The pressure was set via the controller and the heaterswere then actuated. On reaching the boiling point theequilibrium temperature of the pure low boilingcomponent was determined. The 2-2.5 mL highboiling component (methyl isobutyl ketone) was thenadded to the boiler and waited for the equilibriumconditions. The attainment of a constant temperaturefor about 1 h was the sign of equilibrium reached. Inequilibrium, samples were taken out from liquid andcondensed vapor phases for analyzing with Gc. Thus,in a known pressure (P) the liquid and vapor phase

System

Isopropanol +MIBK*Isopropanol +MIBKn-hexane + 1,2-dichloroethanen-heptane + 1,2- dichloroethane1,2-dichloroethane + n-octaneAcetone + chloroform

Solution type

NormalNormalMin. azeotropeMin. azeotropeNormalMax. azeotrope

Isobaric, 53.33 kPaIsobaric, 80.0 kPaIsothermal, 323. 15KIsothermal, 323.15 KIsothermal, 323. 15KIsobaric, 101.32 kPa

ExperimentalExperimentalref. 13ref. 13

ref. 13ref. 14

Page 4: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

compositions (XI> X2, YI> Y2) of a mixture at theequilibrium temperature (D were determinedexperimentally. By adding a few mL high boilingcomponent each time and repeating and whilecontinuing this procedure the equilibrium data of thehigh boiling component enriched mixtures weredetermined as well. Finally the boiling point of thepure high boiling component was determined afterrecharging the apparatus.Samples withdrawn from the liquid and condensed

vapor phases were analyzed with a Hewlett-PackardGC Analyzer, model HP-6890, equipped with FI-detector, and coupled with HP Chem-Stationsoftware. An innowax (PEG) capillary column, 30m x320 /lm x 0.5 /lm in size, was used to separate thecompounds at tailorized oven programs available foreach binary system studied. Nitrogen was used ascarrier gas at a flow rate of 0.8 mLimin. All injectionswere performed on the split rate of 5/1. The GC wascalibrated with gravimetrically prepared standardsolutions to convert the peak area to the mole fractioncomposition. Mole fractions were accurate to betterthan ± 0.002.

Application of Neural NetworkThe adaption of the neural network model to the

VLE data prediction was performed by using theMATLAB program (version 6.0), a widely usedcalculation and programming agent in engineeringapplications. The VLE problem was handled as ageneralization problem and the neural networkcalculations employed a feed-forward algorithm tocalculate the output, along with back-propagation torecursively correlate the weights. The learningprocess by adjusting the weights of the model was themost important part to establish a predictable neuralnetwork. As objective function in the learning processthe total squared error in each vector was taken as0.0005 by using Eq. (8).

II

Total squared error = L, (~exPtl _ ~Cal)2 ,

1=1

here y/xptl is the experimental value, y/'al thecalculated value, and n the experiment number.Only half of the experimentally determined VLE

data points of six various binary mixtures wereassigned into the designed framework as trainingpatterns, in order to estimate the whole systems. The

results were verified by examining the distribution ofoutput errors and the dynamic response of thelearning process.In the application the low boiling component

concentrations in the liquid phase (Xl) are given asinput set values, and as a result the low boilingcomponent concentrations in the vapor phase (y l) andthe liquid phase activity coefficients (YI, Y2) are takenas output set values. The program is shown inAppendix A.

Results and DiscussionThe experimental activity coefficients, YI and Y2,

were calculated using the experimental T-XrYl valuesof related binary systems in the Eq. (5). The purecomponent vapor pressures (p/) in this equationwere calculated through the Antoine equation usingthe constants Ai, Bi, and Ci (ref. 10).

The experimentally observed values of activitycoefficients (n) and vapor phase concentrations (Y/)were compared with estimated values from UNIFAC-original model I I and designed neural network model.In the UNIFAC model the group-volume and surface-area parameters of the mentioned chemicals weretaken as well. Table 2 and 3 present a quantitativeassessment of the predictions achieved for eachmethod with respect to mean deviation. Meandeviation was taken as shown in Eq. (9) (ref. 12).

Mean deviation =

~Yi = tl~.k(exptl)-~.k(calcd)l/nk=1

According to Table 2 the isobaric isopropanol -methyl isobutyl ketone systems at 53.33 and 80.0 kPaand the isothermal 1,2- dichloroethane + n-octanesystem at 323.15 K are attracting attention with amean deviation above 0.1 with respect to UNIFACcalculated activity coefficients. These deviations areshown in more detail by plotting experimentallyobserved n values against the estimates in Figures 3-5, respectively. The neural network model has shownexcellent results for all systems with its flexibleconfiguration.

For evaluating the appropriateness of the models tothe azeotrope systems, it is useful to show the X-Yplots (vapor-liquid equilibrium curve) of theazeotrope systems n-hexane+ 1, 2-dichloroethane at

Page 5: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

System UNIFAC Neural network

YI Y2 YI Y2Isopropanol + MIBK, 53.33 kPa 0.1006 0.1400 0.0553 0.0119

Isopropanol + MIBK, 80.0 kPa 0.1412 0.1782 0.0234 0.0360

n-hexane + 1,2-dichloroethane 0.0630 0.0543 0.0238 0.0142

n-heptane + 1,2- dichloroethane 0.0475 0.0382 0.0261 0.0304

1,2- dichloroethane + n-octane 0.0233 0.1051 0.0310 0.0452

Acetone + chloroform 0.0198 0.0104 0.0163 0.0094

2,4 Table 3 - Mean deviations between experimental and calculated0 experimental "'(, vapor phase concentrations

2,2 . experimental 1" System UNIFAC Neural network2 .... ·UNIFAC ./ YI )'1

"./'''''". - Neural Network1,8 l/ Isopropanol +MIBK, 53.33 kPa 0.0135 0.0111

./'Isopropanol +MIBK, 80.0 kPa 0.0258 0.0114r ,/

1.6 .~I

..,/ n-hexane + 1,2-dichloroethane 0.0163 0.0095,/

1,4 .'....

n-heptane + 1,2- dichloroethane 0.0077 0.0135

1,2 1,2-dichloroethane + n-octane 0.0094 0.0082

Acetone + chloroform 0.0028 0.0114

0,8

o 0.1 0,2 0,3 0,4 0,5 0,6 0,7 0.8 0.9

X1

Fig. 3--Comparison of calculated and experimental activitycoefficients of isopropanol + methyl isobutyl ketone system at53.33 kPa

2,40

2.20

2,00

'.'"1,80 ...•..

....•.~..-., 1,60 ....'-' ..

'.

1,40

1.20

0,80o 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9

x,

Fig. 4-Comparison of calculated and experimental actIvitycoefficients of isopropanol + methyl isobutyl ketone system at80.0 kPa

5,00

4,50

4,00

3,50

Y 3,00

2,50

2,00

1,50

1,00

0,500

• experimental Y2.

o experimental Yl

0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9

X,

Fig. 5--Comparison of calculated and experimental actiVItycoefficients of 1,2- dichloroethane + n-octane system at 323.15 K

323.15 K (Figure 6), n-heptane + 1,2- dichloroethaneat 323.15 K (Figure 7), and acetone + chloroform at101.32 kPa (Figure 8). At these systems theazeotropic point, where the equilibrium curveintersect the diagonal is, in fact. important,representing the separation concentration of thesystems with normal distillation method. It was seenthat both the models show satisfactory results forazeotrope systems.

Page 6: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

0,9

0,8

0,7

0,6

y,0,5

0,4

0,3

0,2

0,1

0

0

• experimental

- Neural Network

·····UNIFAC

Fig. 6-Comparison of calculated and experimental vapor phasecompositions of the System n-hexane + 1,2-dichloroethane at323.15 K.

0,9

0.8

0,7

0,6y,

0,5

0,4

0,3

0,2

0,1

00

Fig. 7--comparison of calculated and experimental vapor phasecompositions of the system n-heptane + 1,2-dichloroethane at323.15 K

In UNIF AC method, despite the care taken forpressure indirectly through the temperature, it seemsinsufficient at low pressures. On the contrary, neuralnetwork model shows a good agreement at allconditions, presenting minimum deviations andgiving satisfying results.

0,9

0,8

0,7

0,6

y,0,5

0,4

0,3

0,2

0,1

0

0

• experimental

- Neural Network

Fig. &--Comparison of calculated and experimental vapor phasecompositions of the system acetone + chloroform at 101.32 kPa

ConclusionIn this study the VLE data for six different binary

systems (azeotrope-non azeotrope, isothermal orisobaric) were predicted, applying neural networkmodel. It was seen that neural network can be treatedas a potent means for VLE data prediction in a fastand reliable way, compared to the conventionalthermodynamical models. The VLE data of binarysystems in a wide range of pressure, and the VLE dataof ternary and quaternary mixtures presentingdifferent chemical structures will be the future courseof our study.

Larsen B L, Rasmussen P & Fredenslund A, A modifiedUNIFAC group-contribution model for the prediction ofphase equilibria and heats of mixing, Ind Eng Chem Res, 26(1987) 2274.Gmehling J, Li J & Schiller M, A modified UNIFAC model.2. Present parameter matrix and results for differentthermodynamic properties, Ind Eng Chem Res, 32 (1993)178.Fu Y, Sandler S I & Orbey H, A modified UNIQUACmodel that includes hydrogen bonding, Ind Eng Chem Res,34 (1995) 4351.Syu M J & Tsao G, Neural network modeling batch cellgrowth pattern, Biotechnol Bioeng, 42 (1993) 376.Holbrook S R, Dubchak I & Kim S H, Probe: a computerprogram employing an integrated neural network approachto protein structure prediction, Biotechniques, 14 (1993) 984.Gasteiger J & Zupan J, Neural networks in chemistry,Angew Chem Int Ed Engl, 32 (1993) 503.

Page 7: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

7 Cheraoui D & ViIlemin D, Use of a neural-network todetermine the boiling-point of alkanes, J Chem Soc,Faraday Trans, 90 (1994) 97.

8 Kan P & Lee C, A neural network model for prediction ofphase equilibria in aqueous two-phase extraction, Ind EngChem Res, 35 (1996) 2015.

9 Alvarez E, Riverol C, Correa J M & Navaza J M, Design ofa combined mixing rule for the prediction of vapor-liquidequilibria using neural networks, Ind Eng Chem Res, 38(1999) 1706.

10 Reid R C, Prausnitz J M & Poling B E, The properties ofgases and liquids (McGraw-Hill, New York) 1987,629.

11 Fredenslund A, Gmehling J, Michelsen M, Rasmussen P &Prausnitz J M, Computerized design of multi component

distillation columns using the UNIFAC group contributionmethod for calculation of activity coefficients, Ind EngChem Pro Des Dev 16 (1977) 450.

12 Fredenslund A, Jones R L & Prausnitz J M, A1ChE Joul7lal,21 (1975) 1086.

13 Chaudhari S K & Katti S S, Vapour-liquid equilibria ofbinary mixtures of n-hexane, n-heptane and n-octane with1,2-dichloroethane at 323.15 K, Fluid Phase Equilib, 57(1990) 297.

14 Kogan W B & Fridman W M, Handbuch del' dnmpf-fliissigkeits-gleichgewichte (VEB Deutscher Verlag derWissenschaften, Berlin) 1961, 125.

Nomenclature Tfi fugacity of pure liquid at system \f

temperature and pressure wfO standard-state fugacity of the pure Xi

component i Yi-L vector of incoming neurones L1Y;n experiment number <1J;N number of incoming values In a neural

netp pressure (kPa) <1>;If saturation (vapor) pressure of pure liquid i

R universal gas constant y;

temperature (K)molar liquid volume of pure component isynaptic weightsmole fraction of component i in liquid phasemole fraction of component i in vapor phasemean deviation

fugacity coefficient of pure component i atsaturation

fugacity coefficient of component in thevapor phaseactivity coefficient of i in the fluid phase

clearNNTWARNOFF

% This program is tested with MATLAB version 6.0release 12.% Definitions:% Training set file: The file consisting the data fortraining the neural network ( x, y, T, gammal,gamma2 vectors).% Input set file: The file consisting the data to be usedas input set for neural network (vector x).% Output set file: The file where the output set of theneural network will be saved.

% loading data ...R=inputCTraining Set File Name: ','s');S=input('Input Set File Name: ','s');G=inputCOutput Set File Name: ','s');

PPP=load(R);[lpx Ipy]=size(PPP);PPPl1=load(S);[lpxll Ipyll]=size(PPPll);

% building input vector [P] ....x l=PPP(l :lpx,l);P=xl';xll=PPPll(1:lpxll,l);Pll=xll';

% building target vector [T] ...yl=PPP(1:lpx,3);temperature=PPP(1: Ipx,5)/l 000;gama1=PPP(1 :lpx,6)/l0;gama2=PPP(1 :lpx,7)/l 0;T=[y l';temperature';gama1';gama2'];

% defining hidden neurons ....hl=8;

% building weight coefficients randomly ....wl=rand(l,hl)';w2=rand(hl,4)';b l=rand(hl, 1);b2=rand( 4,1);

Page 8: The use of neural networks onVLE data prediction - NISCAIRnopr.niscair.res.in/bitstream/123456789/11157/1/JSIR 63(4) 336-343.pdf · The use of neural networks onVLE data predictiont

% training ...df=500;me=10000;eg=0.0005;lr=0.02;tp=[df me eg Ir];

[wI ,bl, w2,b2,ep,tr]=trainbpx(wl,b 1,'Iogsig', w2,b2,'logsig',P,T,tp );

% processing output data ...TTy=simuff(P, wl,b 1,'Iogsig', w2,b2,'logsig');TTyll=simuff(Pll,wl,bl,'logsig',w2,b2,'logsig');

% displaying normalized output data ...output=TTy 11';output(:,2)=output(:,2)* 1000;output(:,3)=output(:,3)* 10;output(:,4 )=output(:,4)* 10;output2(l:lpxll,I)=xll;output2( :,2)=output(:, 1);

output2( :,3)=output(: ,2);output2(:,4 )=output(: ,3);output2(: ,5)=output(:,4);disp

C _--')dispC xl yl T

gamma2')disp( output2)

% fid=fopen(output2.txt,'w');fid=fopen(G,'w');fprintf(fid,' x y T Gammal

Gamma2\n');fprintf(fid,'

fprintf(fid,' \n');fprintf(fid,'%8.5f %8.5f %8.5f %8.5f %8.5f\n',output2');fclose(fid);% save output2