*Title: 'Select 1 solvent to maximise the solubility of Ibuprofen *N=1 *Solved with DICOPT *============================================================================== SETS s 'solvents' /methanol, ethanol, 2-propanol, acetone, mibk, ethylacetate, chloroform, toluene, water/ i 'components in mixture' /ibuprofen, s1/ ii(i) 'selected solvent' /s1/ k 'groups' /ch3, ch2, ch, ach, acch3, acch2, acch, oh, ch3oh, h2o, ch3co, ch3coo, cooh, chcl3/ alias(k,m); PARAMETERS Hm 'enthalpy of fusion of ibuprofen' /25500/ Tm 'melting point of ibuprofen' /347.15/ T 'system temperature' /300/ Rg 'gas constant' /8.3144/ R(k) 'Van der Waals volume of group k' /ch3 0.9011 ch2 0.6744 ch 0.4469 ach 0.5313 acch3 1.2663 acch2 1.0396 acch 0.8121 oh 1.0000 ch3oh 1.4311 h2o 0.9200 ch3co 1.6724 ch3coo 1.9031 cooh 1.3013 chcl3 2.8700 / Q(k) 'Van der Waals surface area of group k' /ch3 0.848 ch2 0.540 ch 0.228 ach 0.400 acch3 0.968 acch2 0.660 acch 0.348 oh 1.200 ch3oh 1.432 h2o 1.400 ch3co 1.488 ch3coo 1.728 cooh 1.224 chcl3 2.410 / table v(s,k) 'number of groups in molecule i' ch3 ch2 ch ach acch3 acch2 acch oh ch3oh h2o ch3co ch3coo cooh chcl3 methanol 1 ethanol 1 1 1 2-propanol 2 1 1 acetone 1 1 mibk 2 1 1 1 ethylacetate 1 1 1 chloroform 1 toluene 5 1 water 1 table vib(i,k)'identity of ibuprofen' ch3 ch ach acch2 acch cooh ibuprofen 3 1 4 1 1 1 ; ; *=============================================================================== *group interaction parameters *=============================================================================== table a(k,m) 'group interaction parameters' ch3 ch2 ch ach acch3 acch2 acch oh ch3oh h2o ch3co ch3coo cooh chcl3 ch3 0 0 0 61.13 76.5 76.5 76.5 986.5 697.2 1318 476.4 232.1 663.5 24.9 ch2 0 0 0 61.13 76.5 76.5 76.5 986.5 697.2 1318 476.4 232.1 663.5 24.9 ch 0 0 0 61.13 76.5 76.5 76.5 986.5 697.2 1318 476.4 232.1 663.5 24.9 ach -11.12 -11.12 -11.12 0 167 167 167 636.1 637.4 903.8 25.77 5.994 537.4 -231.9 acch3 -69.7 -69.7 -69.7 -146.8 0 0 0 803.2 603.3 5695 -52.1 5688 872.3 -80.25 acch2 -69.7 -69.7 -69.7 -146.8 0 0 0 803.2 603.3 5695 -52.1 5688 872.3 -80.25 acch -69.7 -69.7 -69.7 -146.8 0 0 0 803.2 603.3 5695 -52.1 5688 872.3 -80.25 oh 156.4 156.4 156.4 89.6 25.82 25.82 25.82 0 -137.1 353.5 84 101.1 199 -98.12 ch3oh 16.51 16.51 16.51 -50 -44.5 -44.5 -44.5 249.1 0 -181 23.39 -10.72 -202 -139.4 h2o 300 300 300 362.3 377.6 377.6 377.6 -229.1 289.6 0 -195.4 72.87 -14.09 353.7 ch3co 26.76 26.76 26.76 140.1 365.8 365.8 365.8 164.5 108.7 472.5 0 -213.7 669.4 -354.6 ch3coo 114.8 114.8 114.8 85.84 -170 -170 -170 245.4 249.6 200.8 372.2 0 660.2 -209.7 cooh 315.3 315.3 315.3 62.32 89.86 89.86 89.86 -151 339.8 -66.17 -297.8 -256.3 0 39.63 chcl3 36.7 36.7 36.7 288.5 69.9 69.9 69.9 742.1 649.1 826.8 552.1 176.5 504.2 0 ; parameter ps(k,m); ps(k,m)= exp(-a(k,m)/T); parameter nib(i,k); nib('ibuprofen',k)= vib('ibuprofen',k); parameter qib; qib = sum(k,nib('ibuprofen',k)*Q(k)); parameter rib; rib = sum(k,nib('ibuprofen',k)*R(k)); parameter qs(s); qs(s) = sum(k,v(s,k)*Q(k)); parameter rs(s); rs(s) = sum(k,v(s,k)*R(k)); parameter eib(i,k); eib('ibuprofen',k)=vib('ibuprofen',k)*Q(k)/qib; parameter bib(i,k); bib('ibuprofen',k)=sum(m,eib('ibuprofen',m)*ps(m,k)); POSITIVE VARIABLES x(i) 'liquid phase mole fraction of component i' rc(i) 'van der waals volume of component i' qc(i) 'van der waals area of component i' J(i),L(i) b(i,k) 'intermediates' e(i,k) 'group k area fraction in component ii' th(k) w(k) FREE VARIABLES z 'objective function' lng(i) 'natural log of activity coefficient of ibuprofen' lngc(i) 'natural log of combinatorial activity coefficient of ibuprofen' lngr(i) 'natural log of residual activity coefficient of ibuprofen' BINARY VARIABLES y(ii,s) 'selected solvents' INTEGER VARIABLE n(i,k) 'number of groups k in component i' ; EQUATIONS eq_z 'objective function maximise solubility of ibuprofen' eq_x 'mole fraction constrain' eq_n(ii,k) eq_qc(ii) eq_rc(ii) eq_J,eq_L eq_lngc eq_e(i,k) eq_b(i,k) eq_th(k) eq_w(k) eq_lngr eq_lng eq_solub *equations for logical conditions logic1 ; *********************choose only 1 solvents************************************* logic1.. sum(s,y('s1',s))=e=1; *******************************UNIFAC******************************************* eq_z.. z=e=x('ibuprofen'); eq_x.. sum(i,x(i))=e=1; eq_n(ii,k).. n(ii,k)=e=sum(s,v(s,k)*y(ii,s)); eq_qc(ii).. qc(ii)=e= sum(s,qs(s)*y(ii,s)); eq_rc(ii).. rc(ii)=e= sum(s,rs(s)*y(ii,s)); *combinatorial part of activity coefficient eq_J..J('ibuprofen')*sum(i,x(i)*rc(i))=e=rib; eq_L..L('ibuprofen')*sum(i,x(i)*qc(i))=e=qib; eq_lngc.. lngc('ibuprofen')=e=1-J('ibuprofen')+log(J('ibuprofen'))-5*qib*(1-J('ibuprofen')/L('ibuprofen')+log(J('ibuprofen'))-log(L('ibuprofen'))); *residual part of activity coefficient eq_e(i,k)..e(i,k)*qc(i)=e= n(i,k)*Q(k); eq_b(i,k)..b(i,k)=e=sum(m,e(i,m)*ps(m,k)); eq_th(k)..th(k)*sum(i,x(i)*qc(i))=e=sum(i,x(i)*qc(i)*e(i,k)); eq_w(k)..w(k)=e=sum(m,th(m)*ps(m,k)); eq_lngr.. lngr('ibuprofen')=e=qib*(1-sum(k,th(k)*bib('ibuprofen',k)/w(k)-eib('ibuprofen',k)*(log(bib('ibuprofen',k))-log(w(k))))); *activity coefficient eq_lng.. lng('ibuprofen') =e= lngc('ibuprofen') + lngr('ibuprofen'); *ibuprofen solubility constraint eq_solub.. log(x('ibuprofen'))+ lng('ibuprofen') =e= Hm/Rg *(1/Tm-1/T); *******************************BOUNDS******************************************* *bounds on optmization variables x.up(i)=1; x.lo(i)$(sameas(i,'ibuprofen'))=0.001; n.up(ii,k)=6; *variable bounds rc.lo(i)= 0.1; rc.up(i)= 10; qc.lo(i)= 0.1; qc.up(i)= 10; J.lo('ibuprofen')=0.1; J.up('ibuprofen')=10; L.lo('ibuprofen')=0.1; L.up('ibuprofen')=10; b.lo(i,k)=0; b.up(i,k)=10; e.lo(i,k)=0; e.up(i,k)=1; th.up(k)=1; th.lo(k)=0; w.up(k)=10; w.lo(k)=0; lngc.lo('ibuprofen')=-100; lngc.up('ibuprofen')=100; lngr.lo('ibuprofen')=-100; lngr.up('ibuprofen')=100; lng.lo('ibuprofen') = -100; lng.up('ibuprofen') = 100; *********************INITIAL POINTS********************************************* *fixing of ibuprofen identity qc.fx('ibuprofen')=qib; rc.fx('ibuprofen')=rib; b.fx('ibuprofen',k)=bib('ibuprofen',k); e.fx('ibuprofen',k)=eib('ibuprofen',k); n.fx('ibuprofen',k)=vib('ibuprofen',k); *initilaization of optimal solvent x.l('ibuprofen')=0.3; x.l('s1')=1-x.l('ibuprofen'); y.l('s1','chloroform')=1; z.l=x.l('ibuprofen'); n.l(ii,k)=sum(s,v(s,k)*y.l(ii,s)); rc.l(ii)= sum(s,rs(s)*y.l(ii,s)); qc.l(ii)= sum(s,qs(s)*y.l(ii,s)); J.l('ibuprofen')=rib/sum(i,x.l(i)*rc.l(i)); L.l('ibuprofen')=qib/sum(i,x.l(i)*rc.l(i)); lngc.l('ibuprofen')=1-J.l('ibuprofen')+log(J.l('ibuprofen'))-5*qib*(1-J.l('ibuprofen')/L.l('ibuprofen')+log(J.l('ibuprofen'))-log(L.l('ibuprofen'))); e.l(i,k)= n.l(i,k)*Q(k)/qc.l(i); b.l(i,k)=sum(m,e.l(i,m)*ps(m,k)); th.l(k)=sum(i,x.l(i)*qc.l(i)*e.l(i,k))/sum(i,x.l(i)*qc.l(i)); w.l(k)=sum(m,th.l(m)*ps(m,k)); lngr.l('ibuprofen')=qib*(1-sum(k,th.l(k)*bib('ibuprofen',k)/w.l(k)-eib('ibuprofen',k)*(log(bib('ibuprofen',k))-log(w.l(k))))); lng.l('ibuprofen') = lngc.l('ibuprofen') + lngr.l('ibuprofen'); MODEL N1 / ALL/; $onecho > dicopt.opt stop 0 maxcycles 400 $offecho option nlp=conopt3; option mip=cplex; option rminlp=conopt3; option minlp=dicopt; N1.optfile=1; option decimals=5; OPTION OPTCA = 1e-10; option iterlim = 1000000; option optcr = 1e-5; OPTION reslim = 1000000; option sysout=on; solve N1 using minlp maximising z; display z.l y.l x.l ;