$Title Calculations to reproduce the results of the Gibbs reactor in Aspen $onText The theory is taken from chapter 15 of Smith, van Hess and Abbott book (1996) 5th Edition. Need to estimate ideal gas standard Gibbs free energy change of formation at given temperature in Aspen! DGFORM is GIG thermodynamic property in the pure component analysis. File in Aspen is RGIBBSReactor.apw. GIGMXFL property in Aspen is our objective function (if added, will appear in vapor phase stream results). $offText SETS I Components /NH3,NO,NO2,H2O,O2/ J Elements /H,N,O/; SCALAR T Temperature (K) //; SCALAR P System Pressure (atm) //; SCALAR P0 Reference Pressure in DGFORM (atm) /1/; SCALAR R Ideal gas constant (JK-1mol-1) /8.314/; PARAMETERS DGFORM(I) Ideal gas standard Gibbs energy change of formation at 423.15 K (Jmol-1) // FIN(I) Inlet flow of component I to reactor (kmolh-1) // Y(I) Molar composition in vapor phase of component I inside reactor; TABLE ATOMS(J,I) Number of atoms of element J in component I NH3 NO NO2 H2O O2 H N O ; VARIABLES GIGMXFL Gibbs energy flow of the mixture (kJh-1) POSITIVE VARIABLES FOUT(I) Outlet flow of component I from reactor (kmolh-1) FT Total outlet flow from reactor (kmolh-1) EQUATIONS GIBBS Definition of Gibbs energy flow of the mixture ATOMC(J) The number of atoms of element J is the same at the inlet and outlet TMOLES Total molar outlet flow from reactor ; GIBBS.. ATOMC(J).. TMOLES.. OPTION limrow=10; OPTION limcol=0; OPTION decimals=6; OPTION Solprint=Off; OPTION optcr=1E-6; OPTION NLP=BARON; *Define lower bounds for model variables below to avoid numerical errors MODEL GibbsFree using /all/; SOLVE GibbsFree using NLP minimizing GIGMXFL; Y(I)=FOUT.l(I)/FT.l; Display Y,FOUT.l,FT.l;