***************************************************************** *** Chapter 8 *** Section: Phase and Chemical Equilibrium Problems - Equations of State *** Test Problem 4 *** *** SRK equation *** Tangent Plane distance minimization *** Methane -- Propane ***************************************************************** SETS i components /1*2/ ***************************************************************** * P = pressure (bar) * T = temperature (K) * feedmf(i) = mole fraction of component i in candidate phase * feedz = compressibility of candidate phase * feedfc(i) = fugacity coefficient of component i in candidate phase * b(i) = SRK pure-component parameter * a(i,j) = SRK mixture parameter PARAMETERS P, T, feedmf(i), feedz, feedfc(i), b(i), a(i,j); P = 100.0; T = 277.6; feedmf('1') = 0.68; feedmf('2') = 0.32; feedz = 0.439853; feedfc('1') = 0.0234027; feedfc('2') = -2.13584; b('1') = 0.12932; b('2') = 0.271567; a('1','1') = 0.352565; a('1','2') = 0.844083; a('2','1') = 0.844083; a('2','2') = 2.14335; ******************************************************************* * dist = tangent plane distance * x(i) = mole fractio of component i in incipient phase * z = compressibility of incipient phase * amix = mixture A parameter (function of composition) * bmix = mixture B parameter (function of composition) VARIABLES dist, x(i), z, amix, bmix; ******************************************************************* * obj = objective (tangent plane distance) * eos = equation of state constraint * defa = definition of Amix * defb = definition of Bmix * molesum = mole fractions sum to 1 EQUATIONS obj eos defa defb molesum; obj.. dist =e= SUM(i, x(i)*LOG(x(i))) +z-1.0 -LOG(z-bmix) -amix*LOG(1+bmix/z)/bmix -SUM(i, x(i)*(LOG(feedmf(i))+feedfc(i))); eos.. POWER(z,3) - POWER(z,2) + (amix - POWER(bmix,2) - bmix)*z - amix*bmix =e= 0; defa.. amix - SUM(i,SUM(j, a(i,j)*x(i)*x(j))) =e= 0; defb.. bmix - SUM(i, b(i)*x(i)) =e= 0; molesum.. SUM(i, x(i)) =e= 1.0; MODEL tpd /all/;