*GAMS file for mixture design problems of Jonuzaj et al., *Computers & Chemical Engineering, 2017. *Case study 2 - Liquid-liquid extraction *Title: 'Design 3 solvents from atom groups to separate acetic acid from water *N=3 *Solved with SBB *============================================================================== Sets i 'molecules in system' /acetic_acid,water,s1,s2,s3/ p 'phases' /extr,raf/ ii(i)'designed solvents' /s1,s2,s3/ k 'groups' / CH3 CH2 CH C CH2dCH CHdCH CH2dC CHdC CdC ACH AC ACCH3 ACCH2 ACCH OH ACOH CH3CO CH2CO CHO CH3COO CH2COO COOH CHCL3 ACF H2O / ; Alias (k,g,mk,nk,gp); Set pr properties /R Q / ; *######################################################################### *Table for group specifications *######################################################################### Table GS(k, pr) Group Specifications (R = volume Q = surface area) R Q CH3 0.6325 1.0608 CH2 0.6325 0.7081 CH 0.6325 0.3554 C 0.6325 0.0000 CH2dCH 1.2832 1.6016 CHdCH 1.2832 1.2489 CH2dC 1.2832 1.2489 CHdC 1.2832 0.8962 CdC 1.2832 0.4582 ACH 0.3763 0.4321 AC 0.3763 0.2113 ACCH3 0.9100 0.9490 ACCH2 0.9100 0.7962 ACCH 0.9100 0.3769 OH 1.0630 0.8663 ACOH 1.0800 0.9750 CH3CO 1.7048 1.6700 CH2CO 1.7048 1.5542 CHO 0.7173 0.7710 CH3COO 1.2700 1.6286 CH2COO 1.2700 1.4228 COOH 0.8000 0.9215 CHCL3 2.4500 2.8912 ACF 0.8814 0.7269 H2O 1.7334 2.4561 ; *######################################################################### *Table for interaction parameters *######################################################################### table a(mk,k)'group interaction parameter' (CH3,CH2,CH,C) (CH2dCH, CHdCH, CH2dC, CHdC, CdC) (ACH, AC) (ACCH3, ACCH2, ACCH) OH ACOH (CH3CO, CH2CO) CHO (CH3COO,CH2COO) COOH CHCL3 ACF H2O (CH3,CH2,CH,C) 0 189.66 114.20 7.3390 2777.0 1381.0 433.60 875.85 98.656 1182.2 164.25 468.50 1391.3 (CH2dCH, CHdCH, CH2dC, CHdC, CdC) -95.418 0 174.10 117.30 2649.0 1207.0 179.80 476.25 980.74 -2026.1 389.28 141.10 778.30 (ACH, AC) 16.070 -157.20 0 139.20 3972.0 1356.0 146.20 -365.50 -274.54 69.561 380.02 808.00 792.00 (ACCH3, ACCH2, ACCH) 47.200 -113.10 -45.330 0 3989.0 1375.0 1001.0 683.60 -242.50 1352.5 297.73 -172.20 1050.2 OH 1606.0 1566.0 3049.0 2673.0 0 83.910 -250.00 -281.40 973.80 -1295.0 -32.643 848.60 -801.90 ACOH 1987.0 191.60 2340.0 1825.0 465.40 0 -145.20 0 -212.90 401.88 0 0 148.40 (CH3CO, CH2CO) 199.00 91.811 -57.530 -146.60 653.30 -666.80 0 197.60 -16.486 -109.51 -497.98 0 770.60 CHO 256.21 202.49 1011.0 1963.0 1590.0 0 -93.080 0 -208.40 435.64 0 0 512.60 (CH3COO,CH2COO) 632.22 -582.82 622.73 1624.0 310.40 -224.40 33.415 389.70 0 62.031 -579.11 0 322.30 COOH 2017.7 -347.50 613.32 29.747 1525.8 281.08 178.22 -188.00 59.594 0 508.72 0 624.97 CHCL3 -44.069 -174.41 -201.52 -248.30 1253.0 0 945.14 0 966.35 -386.93 0 0 -523.80 ACF -160.30 -139.50 -1367.0 -13.150 2985.8 0 0 0 0 0 0 0 0 H2O -17.253 -1301.0 332.30 24.144 1460.0 -2686.0 190.50 -1545.0 -675.50 -1795.2 509.30 0 0 ; *single-group solvent candidates (solvents that cannot be designed *based on the implemented first-order group contribution) set extra(g) extra groups with valency zero / CHCL3 H2O /; *aromatic structural groups set Ag(g) aromatic groups / ACH AC ACCH3 ACCH2 ACCH ACOH ACF /; *number of aromatic carbons parameters arom(g) / ACH 1.0 AC 1.0 ACCH3 1.0 ACCH2 1.0 ACCH 1.0 ACOH 1.0 ACF 1.0 /; *structural groups that are considered main groups set Mg(g) main groups / CH3 CH2 CH C CH2dCH CHdCH CH2dC CHdC CdC /; *structural groups exhibiting double carbon-carbon bonds set Db(g) doublebond groups / CH2dCH CHdCH CH2dC CHdC CdC /; *structural groups that are named as functional groups set Fg(g) functional groups / OH CH3CO CH2CO CHO CH3COO CH2COO COOH /; *chain-ending-groups - groups at the end of a chain in aromatic molecules set Ceg(g) chainending functional&doublebond groups allowed in aromatics / CH3CO CH2dCH CH3COO CHO COOH /; *non-chain-ending-groups - structural groups linking chain-ending groups *with the aromatic structural groups set Nceg(g) nonchainending functional&doublebond groups allowedin aromatics / CHdCH CH2CO CH2COO /; *valency of each structural group parameters v(k) valency / CH3 1 CH2 2 CH 3 C 4 CH2dCH 1 CHdCH 2 CH2dC 2 CHdC 3 CdC 4 ACH 2 AC 3 ACCH3 2 ACCH2 3 ACCH 4 OH 1 ACOH 2 CH3CO 1 CH2CO 2 CHO 1 CH3COO 1 CH2COO 2 COOH 1 CHCL3 0 ACF 2 H2O 0 /; *group contribution to each structural group for melting point temperature in K *(Marrero, J. et al. 2001) parameters tmelt(k) "dimensionless" / CH3 0.6953 CH2 0.2515 CH -0.3730 C 0.0256 CH2dCH 1.1728 CHdCH 0.9460 CH2dC 0.7662 CHdC 0.1732 CdC 0.3928 ACH 0.5860 AC 1.8955 ACCH3 1.0068 ACCH2 0.1065 ACCH -0.5197 OH 2.7888 ACOH 5.1473 CH3CO 2.9588 CH2CO 2.5232 CHO 3.0186 CH3COO 2.1657 CH2COO 1.6329 COOH 7.4042 CHCL3 4.14726171 ACF 0.9782 H2O 6.37569031759 /; *group contribution to each structural group for boiling point temperature in K *(Marrero, J. et al. 2001) parameters tboil(k) "dimensionless" / CH3 0.8491 CH2 0.7141 CH 0.2925 C -0.0671 CH2dCH 1.5596 CHdCH 1.5597 CH2dC 1.3621 CHdC 1.2971 CdC 1.2739 ACH 0.8365 AC 1.7324 ACCH3 1.5653 ACCH2 1.4925 ACCH 0.8665 OH 2.5670 ACOH 3.3205 CH3CO 3.1178 CH2CO 2.6761 CHO 2.5388 CH3COO 3.1228 CH2COO 2.9850 COOH 5.1108 CHCL3 4.491880668 ACF 0.7945 H2O 5.3481708472 /; Set gr 'for number of groups in y' /1*3/ ; *maximum number of structural groups in one molecular structure scalar Nmax /10/; *minimum number of structural groups in one molecular structure scalar Nmin /1/; *maximum number of groups of type i that can be found in one *molecular structure scalar Nmaxg /10/; parameters T 'system temperature'/298/ F 'feed flowrate(kmol/hr)'/708/ xf(i) 'feed composition ' /acetic_acid 0.025 water 0.975/ table va(i,k) 'identity of acetic acid and water' CH3 H2O COOH acetic_acid 1 1 water 1 ; table bp(mk,k)'group interaction parameter' (CH3,CH2,CH,C) (CH2dCH, CHdCH, CH2dC, CHdC, CdC) (ACH, AC) (ACCH3, ACCH2, ACCH) OH ACOH (CH3CO, CH2CO) CHO (CH3COO,CH2COO) COOH CHCL3 ACF H2O (CH3,CH2,CH,C) 0 -0.2723 0.9330E-1 -0.4538 -4.6740 -0.9977 0.1473 0 1.9294 -3.2647 -0.2683 -1.0420 -3.6156 (CH2dCH, CHdCH, CH2dC, CHdC, CdC) 0.6171E-1 0 -0.5886 -0.8552 -6.5080 -1.9550 0.6991 0 -2.4224 8.1549 0 -0.3025 0.1482 (ACH, AC) -0.2998 0.6166 0 -0.6500 -13.160 -2.1180 -1.2370 1.8740 0.9149 1.8881 -0.2333 -5.3310 -1.7260 (ACCH3, ACCH2, ACCH) 0.3575 1.1720 0.4223 0 -14.090 -1.7020 -1.8710 -1.0200 2.7200 0 -0.2420 0.2257 -1.9939 OH -4.7460 -5.8090 -12.770 -5.7650 0 -1.2620 2.8570 2.3790 -5.6330 4.3634 -0.0104 0 3.8240 ACOH -4.6150 0.4936 -5.0430 -3.7430 -1.8410 0 -0.7380 0 0 0 0 0 -2.7570 (CH3CO, CH2CO) -0.8709 -0.7171 1.2120 0.2419 -1.4120 1.9180 0 0 -0.2792 0.9689 0.7972 0 -0.5873 CHO 0 0 -2.1670 2.6560 -24.570 0 0 0 0 0 0 0 -2.1450 (CH3COO,CH2COO) -3.3912 1.6732 -1.7605 -9.4090 1.5380 0 0.2191 0 0 1.0567 0.9455 0 -1.3050 COOH -9.0933 1.2160 -1.5950 0 -4.9155 0 -0.9168 0 -0.7120 0 -1.4005 0 -4.6878 CHCL3 0.2778E-1 0 -0.6877E-1 0.2547 -6.2270 0 -3.8168 0 -2.1861 2.3961 0 0 3.1580 ACF -0.1080E-1 0.9076 7.8830 0.1763E-2 0 0 0 0 0 0 0 0 0 H2O 0.8389 4.0720 1.1580 1.6504 -8.6730 19.440 -3.6690 6.5120 3.6090 12.708 -0.2900 0 0 table cp(mk,k)'group interaction parameter' (CH3,CH2,CH,C) (CH2dCH, CHdCH, CH2dC, CHdC, CdC) (ACH, AC) (ACCH3, ACCH2, ACCH) OH ACOH (CH3CO, CH2CO) CHO (CH3COO,CH2COO) COOH CHCL3 ACF H2O (CH3,CH2,CH,C) 0 0 0 0 0.1551E-2 0 0 0 -0.3133E-2 0.9198E-2 0 0 0.1144E-2 (CH2dCH, CHdCH, CH2dC, CHdC, CdC) 0 0 0 0 0.4822E-2 0 0 0 0 0 0 0 0 (ACH, AC) 0 0 0 0 0.1208E-1 0 0.4237E-2 0 0 0 0 0.6077E-2 0 (ACCH3, ACCH2, ACCH) 0 0 0 0 0.1530E-1 0 0.2390E-3 0.8690E-3 -0.3449E-2 0 0 0 0 OH 0.9181E-3 0.5197E-2 0.1435E-1 -0.3320E-3 0 0 -0.6022E-2 -0.6668E-2 0.7690E-2 0 0 0 -0.7514E-2 ACOH 0 0 0 0 0 0 0 0 0 0 0 0 0.2329E-2 (CH3CO, CH2CO) 0 0 -0.3715E-2 0.1133E-3 0.9540E-3 0 0 0 0 0 0.2982E-3 0 -0.3252E-2 CHO 0 0 0 -0.1355E-1 0.6212E-1 0 0 0 0 0 0 0 0 (CH3COO,CH2COO) 0.3928E-2 0 0 0.1338E-1 -0.4885E-2 0 0 0 0 0 0 0 0 COOH 0.1024E-1 0 0 0 0 0 0 0 0 0 0 0 0.5237E-2 CHCL3 0 0 0 0 0 0 0.4535E-2 0 0 0 0 0 0 ACF 0 0 -0.7754E-2 0 0 0 0 0 0 0 0 0 0 H2O 0.9021E-3 0 0 0 0.1641E-1 -0.2702E-1 0.8838E-2 0 0 -0.1546E-1 0 0 0 ; *parameter equation parameter ps(mk,k); ps(mk,k)= exp(-(a(mk,k)/T + bp(mk,k) + cp(mk,k)*T)); parameter qac; qac = sum(k,va('acetic_acid',k)*GS(k,'Q')); parameter rac; rac = sum(k,va('acetic_acid',k)*GS(k,'R')); parameter qw; qw = sum(k,va('water',k)*GS(k,'Q')); parameter rw; rw = sum(k,va('water',k)*GS(k,'R')); positive variables x(i,p) 'mole fraction of component i in phase p' xm(i) 'mixture composition' xs(ii) 'extractant composition' rc(i) 'van der Waals volume of component i' qc(i) 'van der Waals surface area of component i' Extract Raffinate S_rate 's1 mixture flowrate kmol/hr' Mx 'total moles in mixer' variables z 'objective function' lng(i,p) 'natural log of activity coefficient of comp. i in phase p' lngc(i,p) 'naturallog of combinatorial act. coef. of comp. i in phase p' lngr(i,p) 'natural log of residual activity coef. of comp.i in phase p' e(k,i) 'group k area fraction in component i' th(k,p) 'group k area fraction in mixture for each phase' b(i,k),w(k,p) 'intermediates' wb(i,k,p) 'intermediates' H(i,p),L(i,p) 'intermediates' Hl(i,p) 'intermediates' sumr(p),sumq(p)'summation over rc and qc respectively in each phase' H_mod(i,p) 'modified unifac variable' rc_mod(i) sumr_mod(p) act(i,p) binary variable y(ii,k,gr) binary for n y5(ii) binary for acyclic y6(ii) binary for bicyclic y7(ii) binary for monocyclic y12(ii) binary for nACCH y13(ii) binary for nAC y14(ii) binary for nACCH2 yM(ii) binary active when aC group and monocyclic binary variable y7 are active positive variable n(i,k) 'number of group k in component i' m(ii) 'type of molecule' ; equations logic1 logic2 logic3 eq1a eq1b eq2 eq3a,eq3b 'mole balances' eq3c(ii),eq3d eq4(i) eq5 eq6 eq7(p) eq_qc(ii) 'van der waals area(qc) of molecue i' eq_rc(ii) 'van der waals volume(rc) of molecule i' eqsumr(p),eqsumq(p) 'summation over rc and qc in each phase' eq_h_mod(i,p) 'modified unifac variable expression' eq_rc_mod(i) 'expression for volume of component' eq_sumr_mod(p) 'expression for modified sum over rc' eqH(i,p),eql(i,p) 'intermediates' eqHl(i,p) 'intermediates' eq8(i,p) 'combinatorial part of activity coef. in each phase' eq9(k,i) 'group k area fraction in component i' eq9b(i,k) 'intermediates' eq10(k,p) 'group k area fraction in mixture' eq10w(k,p) 'intermediate' eq10wb(i,k,p) 'intermediate' eq11(i,p) 'residual part of activity coef. in each phase' eq12(i,p) 'activity coefficient determination in each phase' eq13a(i,p) 'phase equilibrium constriant' eq13b obj 'minimise amount of acetic acid in raffinate phase' recovery_ac recovery_s1 recovery_s2 recovery_s3 eq_maxg(ii) eq_ming(ii) eq_melt(ii) eq_boil(ii) e3(g,ii) transformation of ns to integer values etest(ii) only one single group s1 is allowed etest3(ii) if one single group is active no normal group is allowed e5(ii) only one typ of molecule is allowed (acyclic bicyclic or monocyclic) e6(ii) define the continuous variable m for the selection of molecule typ e7(ii) octet rule e8(gp,ii) modified bonding rule *------------------------------------------------------------------------- e9d(ii) limit for the number of maingroups e50c(ii) limit for CH3 if a side group of an aromatic system exist e50a(ii) limit for the number of chain-ending groups e50b(ii) limit for the number of non-chain-ending groups e10(ii) number of aromatic groups in a mono- or bicyclic molecule e4f(ii) limit for functional groups p. 141 e4d(ii) limit of carbon-carbon double bond e38(ii) Aromatic groups and side chains e39(ii) Aromatic groups and side chains e40(ii) Aromatic groups and side chains e41(ii) Aromatic groups and side chains e42(ii) Aromatic groups and side chains e43(ii) Aromatic groups and side chains e44(ii) Aromatic groups and side chains e45(ii) Aromatic groups and side chains e46(ii) Aromatic groups and side chains e47(ii) Aromatic groups and side chains e48(ii) Aromatic groups and side chains e50d(ii) reduce the complexity of the s1 *------------------------------------------------------------------------- *Upper limit of each group; table B.5 in appendix B e50e(ii) e70d(ii) e9a(ii) e50(ii) e81a(ii) e81b(ii) e80(ii) e70f(ii) e70e(ii) e81c(ii) e11(ii) e81d(ii) e60a(ii) e60b(ii) e50f(ii) e60(ii) e60e(ii) e81g(ii) e81h(ii) e81i(ii) e81j(ii) e81k(ii) e81l(ii) e81u(ii) e81ac(ii) e92new(ii) eh2o(ii) ; logic1.. sum(k,abs(n('s1',k)-n('s3',k)))=g=1; logic2.. sum(k,abs(n('s1',k)-n('s2',k)))=g=1; logic3.. sum(k,abs(n('s3',k)-n('s2',k)))=g=1; *----------------------- *mole balances *======================= *The mole fractions in the inlet are water=0.975,acetic_acid=0.025 and s1=1. *In the mixer M we have acetic_acid, water and s1. Mole fraction of acetic_acid in the mixer cannot be greater than 0.025 *If xm('acetic_acid')=l=0.02, then S_rate.lo=177kmol/h. eq1a..xm('acetic_acid')=l=0.02; eq1b..x('acetic_acid','raf')=l=0.003; eq2..sum(ii,xs(ii))=e=1; eq3a..xm('acetic_acid')*Mx =e= xf('acetic_acid')*F; eq3b..xm('water')*Mx =e= xf('water')*F; eq3c(ii)..xm(ii)*Mx =e= (S_rate*xs(ii)); eq3d..S_rate+F =e= Mx; eq4(i)..xm(i)*Mx=e= x(i,'extr')*Extract + x(i,'raf')*Raffinate; eq5.. Mx =e= Raffinate+Extract; eq6..sum(i,xm(i))=e=1; eq7(p)..sum(i,x(i,p))=e=1; *=================================================================== *phase equilibrium contraints and activity coefficient computation *=================================================================== eq_qc(ii)..qc(ii)=e= sum(k,GS(k,'Q')*n(ii,k)); eq_rc(ii)..rc(ii)=e= sum(k,GS(k,'R')*n(ii,k)); eq_rc_mod(i)..rc_mod(i)=e= (rc(i))**0.75; eq_sumr_mod(p)..sumr_mod(p) =e= sum(i,x(i,p)*rc_mod(i)); eqsumr(p)..sumr(p)=e=sum(i,x(i,p)*rc(i)); eqsumq(p)..sumq(p)=e=sum(i,x(i,p)*qc(i)); eq_H_mod(i,p)..H_mod(i,p)*sumr_mod(p)=e= rc_mod(i); eqH(i,p)..H(i,p)*sumr(p)=e= rc(i); eqL(i,p)..L(i,p)*sumq(p)=e= qc(i); eqHl(i,p)..Hl(i,p)*L(i,p)=e=H(i,p); eq8(i,p).. lngc(i,p)=e=1-H_mod(i,p)+log(H_mod(i,p))-5*qc(i)*(1-Hl(i,p)+log(Hl(i,p))); eq9(k,i)..e(k,i)*qc(i)=e= n(i,k)*GS(k,'Q'); eq9b(i,k)..b(i,k)=e=sum(mk,e(mk,i)*ps(mk,k)); eq10(k,p)..th(k,p)*sumq(p)=e=sum(i,x(i,p)*qc(i)*e(k,i)); eq10w(k,p)..w(k,p)=e=sum(mk,th(mk,p)*ps(mk,k)); eq10wb(i,k,p)..wb(i,k,p)*w(k,p)=e=b(i,k); eq11(i,p).. lngr(i,p)=e=qc(i)*(1-sum(k,th(k,p)*wb(i,k,p)-e(k,i)*log(wb(i,k,p)))); eq12(i,p)..lng(i,p) =e= lngc(i,p) + lngr(i,p); eq13a(i,p).. act(i,p) =e= exp(lng(i,p)); eq13b(i).. act(i,'raf')*x(i,'raf')-act(i,'extr')* x(i,'extr')=e=0; obj..z =e= S_rate/F + x('water','extr')- x('acetic_acid','extr'); recovery_ac..(x('acetic_acid','extr')*Extract*100)/(F*xf('acetic_acid'))=g=90; recovery_s1..(x('s1','extr')*Extract*100)/(S_rate*xs('s1'))=g=90; recovery_s2..(x('s2','extr')*Extract*100)/(S_rate*xs('s2'))=g=90; recovery_s3..(x('s3','extr')*Extract*100)/(S_rate*xs('s3'))=g=90; eq_maxg(ii).. sum(k,n(ii,k))=l=Nmax; eq_ming(ii).. sum(k,n(ii,k))=g=Nmin; eq_melt(ii).. sum(g,n(ii,g)*tmelt(g))=l= 8.6; eq_boil(ii).. sum(g,n(ii,g)*tboil(g))=g= 3.71; e3(g,ii).. y(ii,g,'1') + 2*y(ii,g,'2') + 4*y(ii,g,'3')=e= n(ii,g); *only one single-group s1 candidate can be active at once etest(ii).. sum(extra,n(ii,extra))=l=1; *if the optimal s1 is a single-group s1, only one single-group s1 candidate is designed (this constraint results in only one *s1 candidate being designed, as it is possible to design two or more stable s1 candidates in one evaluation) etest3(ii).. (sum(g,n(ii,g))-1) - sum(extra,n(ii,extra)) + 1 =l= (1 - sum(extra,n(ii,extra)))*Nmax; *allow 3 types of molecules (y5(ii), y6(ii), y7(ii))(monocyclic, aliphatic, bicyclic) e5(ii).. y5(ii)+y6(ii)+y7(ii) =e= 1; *express different types of s1 candidates (monocyclic, aliphatic, bicyclic) as a continuous variable m(ii) (-1,0,1) e6(ii).. m(ii)-(y5(ii)-y6(ii)) =e= 0; *Octet rule (Odele & Macchieto, 1993) e7(ii).. sum(g,n(ii,g)*(2-v(g))) =e= 2*m(ii); *modified bonding rule (Odele & Macchieto, 1993; Buxton et al. 1999); e8(gp,ii).. sum(g,n(ii,g))-n(ii,gp)*(v(gp)-1) =g= 2*(m(ii)-sum(extra,n(ii,extra))); *limit for the number of main groups e9d(ii).. sum(mg,n(ii,mg)) =l= 2*y7(ii)+10*y5(ii); *limit for CH3 if a side group of an aromatic system exist e50c(ii).. y12(ii) =l= n(ii,'CH3'); *limit for the number of chain-ending groups e50a(ii).. sum(Ceg,n(ii,Ceg))=l= 3*y5(ii)+y12(ii)+yM(ii)+y14(ii); *limit for the number of non-chain-ending groups e50b(ii).. sum(Nceg,n(ii,Nceg)) =l= 3*y5(ii)+yM(ii)+y14(ii); *Correct number of aromatic groups for a mono- or bicycle e10(ii).. sum(Ag,n(ii,Ag)) =e= 6*y7(ii)+10*y6(ii); e4f(ii).. 0.3*n(ii,'OH')+n(ii,'CH3CO')+n(ii,'CH2CO')+n(ii,'CHO')+n(ii,'CH3COO') +n(ii,'CH2COO')+n(ii,'COOH')+n(ii,'CHCL3') =l= y5(ii)+y7(ii); e4d(ii).. sum(Db,n(ii,Db)) =l= 1; *aromatic groups and side chains e38(ii).. yM(ii) =g= 0; e39(ii).. yM(ii) =l= 1; e40(ii).. n(ii,'AC')-0.9-100*y13(ii) =l= 0; e41(ii).. 100*(y13(ii)-1)-n(ii,'AC')+1 =l= 0; e42(ii).. n(ii,'ACCH')-0.9-100*y12(ii) =l= 0; e43(ii).. 100*(y12(ii)-1)-n(ii,'ACCH')+1 =l= 0; e44(ii).. n(ii,'ACCH2')-0.9-100*y14(ii) =l= 0; e45(ii).. 100*(y14(ii)-1)-n(ii,'ACCH2')+1 =l= 0; e46(ii).. 100*yM(ii) =g= y7(ii)+y13(ii)-1; e47(ii).. 100*(yM(ii)-1)-y7(ii)-y13(ii)+2 =l= 0; e48(ii).. 2*y6(ii)+yM(ii)-n(ii,'AC') =e= 0; *reduce the compexity -> only of of the following groups e50d(ii).. y12(ii)+y14(ii)+yM(ii) =l= 1; *------------------------------------------------------------------------- *Upper limit of each group; table B.5 in appendix B e50e(ii).. n(ii,'CH3') =l= Nmax*y5(ii)+2*y12(ii)+y14(ii); e70d(ii).. n(ii,'CH2') =l= 3*y5(ii); e9a(ii).. n(ii,'CH') =l= 3*y5(ii); e50(ii).. n(ii,'C') =l= y5(ii); e81a(ii).. n(ii,'CH2dCH') =l= 0*(y5(ii)+yM(ii)+y12(ii)+y14(ii)); e81b(ii).. n(ii,'CHdCH') =l= 0*(y5(ii)+yM(ii)+y14(ii)); e80(ii).. n(ii,'CH2dC') =l= 0*(y5(ii)); e70f(ii).. n(ii,'CHdC') =l= 0*(y5(ii)); e70e(ii).. n(ii,'CdC') =l= y5(ii); e81c(ii).. n(ii,'ACH') =l= 6*y7(ii)+8*y6(ii); e11(ii).. n(ii,'AC') =l= yM(ii)+2*y6(ii); e81d(ii).. n(ii,'ACCH3') =l= 6*y7(ii)+8*y6(ii); e60a(ii).. n(ii,'ACCH2') =g= y14(ii); e60b(ii).. n(ii,'ACCH2') =l= y14(ii); e50f(ii).. n(ii,'ACCH') =g= y12(ii); e60(ii).. n(ii,'ACCH') =l= y12(ii); e60e(ii).. n(ii,'OH') =l= 0*y5(ii); e81g(ii).. n(ii,'ACOH') =l= 6*y7(ii)+8*y6(ii); e81h(ii).. n(ii,'CH3CO') =l= y5(ii)+yM(ii)+y12(ii)+y14(ii); e81i(ii).. n(ii,'CH2CO') =l= y5(ii)+yM(ii)+y14(ii); e81j(ii).. n(ii,'CHO') =l= y5(ii)+yM(ii)+y12(ii)+y14(ii); e81k(ii).. n(ii,'CH3COO') =l= y5(ii)+yM(ii)+y12(ii)+y14(ii); e81l(ii).. n(ii,'CH2COO') =l= y5(ii)+yM(ii)+y14(ii); e81u(ii).. n(ii,'COOH') =l= y5(ii)+yM(ii)+y12(ii)+y14(ii); e81ac(ii).. n(ii,'ACF') =l= 6*y7(ii)+8*y6(ii); e92new(ii).. n(ii,'CHCL3') =l= y5(ii); eh2o(ii).. n(ii,'H2O') =l= 0; *-------------------------------- *bounds on optmization variables *-------------------------------- x.up(i,p)=1; x.lo(i,p)=1e-6; xs.lo(ii)=0.1; xs.up(ii)=1; xm.lo(i)=1e-3; xm.up(i)=1; n.up(ii,k)=Nmaxg; S_rate.up=2000; S_rate.lo=177; Mx.up=2708; Extract.lo=200; Extract.up=2708; Raffinate.lo=200; Raffinate.up=2708; rc.lo(i)= 0.01; qc.lo(i)= 0.01; rc.up(i)=20; qc.up(i)=20; sumr.lo(p)=0.01; sumq.lo(p)=0.01; sumr.up(p)=20; sumq.up(p)=20; rc_mod.lo(i)= 0.01; rc_mod.up(i)= 20; sumr_mod.lo(p)=0.01; sumr_mod.up(p)=20; L.lo(i,p)= 0.0001; L.up(i,p)= 20; H.lo(i,p)=0.0001; H.up(i,p)=20; H_mod.lo(i,p)=0.0001; H_mod.up(i,p)=20; Hl.lo(i,p)=1e-4; Hl.up(i,p)=20; lngc.lo(i,p)=-99; lngc.up(i,p)=99; lngr.lo(i,p)=-99; lngr.up(i,p)=99; lng.lo(i,p)=-99; lng.up(i,p)=99; e.lo(k,i)=0; e.up(k,i)=1; b.lo(i,k)=-50; b.up(i,k)=30; th.lo(k,p)=0; th.up(k,p)=1; w.lo(k,p)=0.0001; w.up(k,p)=30; wb.lo(i,k,p)=0.0001; wb.up(i,k,p)=50; m.lo(ii)=-1; m.up(ii)=1; *================================== *identity of acetic acid and water *================================= n.fx('acetic_acid',k)=va('acetic_acid',k); n.fx('water',k)=va('water',k); qc.fx('acetic_acid')=qac; rc.fx('acetic_acid')=rac; qc.fx('water')=qw; rc.fx('water')=rw; *----------------------------------------- *initializations *----------------------------------------- y.l('s1',g,gr) = 0; *initial s1 - That's pentane y.l('s1','CH3','2') = 1; y.l('s1','CH2','1') = 1; y.l('s1','CH2','2') = 1; n.l('s1',g)=y.l('s1',g,'1') + 2*y.l('s1',g,'2') + 4*y.l('s1',g,'3') ; y.l('s2',g,gr) =0; *initial s2 - That's hexane y.l('s2','CH3','2') = 1; y.l('s2','CH2','3') = 1; n.l('s2',g)=y.l('s2',g,'1') + 2*y.l('s2',g,'2') + 4*y.l('s2',g,'3'); y.l('s3',g,gr) =0; *initial s3 y.l('s3','CH3','2') = 1; y.l('s3','CH2','2') = 1; n.l('s3',g)=y.l('s3',g,'1') + 2*y.l('s3',g,'2') + 4*y.l('s3',g,'3'); S_rate.l=708; Mx.l = F + S_rate.l; Extract.l =900; Raffinate.l = F + S_rate.l - Extract.l; xs.l('s1')=0.8; xs.l('s2')=0.1; xs.l('s3')=0.1; xm.l('acetic_acid')= xf('acetic_acid')*F/Mx.l; xm.l('water') = xf('water')*F/Mx.l; xm.l(ii) = (S_rate.l*xs.l(ii))/Mx.l; x.l('acetic_acid','raf')=0.003; x.l('water','raf')=0.995; x.l('s2','raf')=0.0001; x.l('s3','raf')=0.0001; x.l('s1','raf')=1-x.l('acetic_acid','raf')-x.l('water','raf')-x.l('s2','raf')-x.l('s3','raf'); x.l(i,'extr') = (xm.l(i)*Mx.l-x.l(i,'raf')*Raffinate.l)/Extract.l; rc.l(ii)= sum(k,GS(k,'R')*n.l(ii,k)); qc.l(ii)= sum(k,GS(k,'Q')*n.l(ii,k)); rc_mod.l(i)=(rc.l(i))**0.75; sumr_mod.l(p) = sum(i,x.l(i,p)*rc_mod.l(i)); sumr.l(p)=sum(i,x.l(i,p)*rc.l(i)); sumq.l(p)=sum(i,x.l(i,p)*qc.l(i)); H_mod.l(i,p)= rc_mod.l(i)/sumr_mod.l(p); H.l(i,p)= rc.l(i)/sumr.l(p); L.l(i,p)= qc.l(i)/sumq.l(p); Hl.l(i,p)= H.l(i,p)/L.l(i,p); lngc.l(i,p)=1-H_mod.l(i,p)+log(H_mod.l(i,p))-5*qc.l(i)*(1-Hl.l(i,p)+log(Hl.l(i,p))); e.l(k,i)= n.l(i,k)*GS(k,'Q')/qc.l(i); b.l(i,k)=sum(mk,e.l(mk,i)*ps(mk,k)); th.l(k,p)=sum(i,x.l(i,p)*qc.l(i)*e.l(k,i))/sumq.l(p); w.l(k,p)=sum(mk,th.l(mk,p)*ps(mk,k)); wb.l(i,k,p)=b.l(i,k)/w.l(k,p); lngr.l(i,p)=qc.l(i)*(1-sum(k,th.l(k,p)*wb.l(i,k,p)-e.l(k,i)*log(wb.l(i,k,p)))); lng.l(i,p)= lngc.l(i,p) + lngr.l(i,p); lng.l(i,'raf')= -log(x.l(i,'raf'))+lng.l(i,'extr')+ log(x.l(i,'extr')); z.l = S_rate.l/F + x.l('water','extr')-x.l('acetic_acid','extr') ; yM.l(ii) = 0; y5.l(ii) = 1; y6.l(ii) = 0; y7.l(ii) = 1-y6.l(ii)-y5.l(ii); y12.l(ii) = 0; y13.l(ii) = 0; y14.l(ii) = 0; m.l(ii) = y5.l(ii)-y6.l(ii); *----------------------------------------------------------------------------------- model N3 /all/; $onecho > sbb.opt lspret=0; $offecho $onecho > conopt3.opt lspret=0; $offecho option nlp=conopt3; option mip=cplex; option rminlp=conopt3; option minlp=sbb; N3.optfile=1; N3.nodlim=100000; option decimals=5; OPTION OPTCA = 1e-10; option iterlim = 1000000; option optcr = 1e-5; *OPTION DOMLIM = 10; OPTION reslim = 1000000; option sysout=on; option threads=1; solve N3 using minlp minimising z; parameter recovery1a 's1 recovery in the extract phase' recovery1b 's2 recovery in the extract phase' recovery1c 's3 recovery in the extract phase' recovery2 'acetic acid recovery in the extract phase' ; recovery1a=(x.l('s1','extr')*Extract.l*100)/(S_rate.l*xs.l('s1')); recovery1b=(x.l('s2','extr')*Extract.l*100)/(S_rate.l*xs.l('s2')); recovery1c=(x.l('s3','extr')*Extract.l*100)/(S_rate.l*xs.l('s3')); recovery2 = (x.l('acetic_acid','extr')*Extract.l*100)/(F*xf('acetic_acid')); display z.l y.l n.l xs.l x.l *xs.l f,s_rate.l,extract.l,raffinate.l recovery1a,recovery1b,recovery1c,recovery2 H_mod.l,H.l,L.l,Hl.l lngr.l,lngc.l ;