Professional Documents
Culture Documents
Ex 1d - WaterNetwokProblem-LG-WOEps - Gms
Ex 1d - WaterNetwokProblem-LG-WOEps - Gms
Networks
$Ontext
The objective of this model is to minimize the total cost of the integrated
process water networks consist of water using and water treatment operations
$Offtext
$OFFSYMXREF
$OFFSYMLIST
Alias (p,pp);
Alias (t,tt);
Alias (d_p,d_pp);
Alias (d_t,d_tt);
Alias (d_s,d_ss);
Scalar Recycle_PU 'Recycle around PU (if yes then 1)(if not then 0) ' /0/;
Scalar Recycle_TU 'Recycle around TU (if yes then 1) (if not then 0)' /0/;
Parameter IC(t) 'Investment cost coeff. for treatment units' /t1 16800,
t2 12600/;
Parameter IPT (t) Investment cost coefficient for pipe (t) /t1 100
t2 100/;
Parameter IPP (p) Investment cost coefficient for pipe (p) /p1 100
p2 100/;
Parameter IPF (s) Investment cost coefficient for pipe (p) /s1 100/;
Parameter CPT (t) Cost coefficient corresponding to existence of pipe (t) [$]
/t1 6
t2 6/;
Parameter CPP (p) Cost coefficient corresponding to existence of pipe (p) [$]
/p1 6
p2 6/;
Parameter CPF (s) Cost coefficient corresponding to existence of pipe (p) [$]
/s1 6/;
Parameter expT(t) Cost function exponent for the investment cost of pipe (t)
/t1 0.6,
t2 0.6/;
Parameter expP(p) Cost function exponent for the investment cost of pipe (p)
/p1 0.6,
p2 0.6/;
Parameter expF(s) Cost function exponent for the investment cost of pipe (p)
/s1 0.6/;
Parameter PMP(p) Operating cost coefficient for pumping water through pipe (p)
/p1 0.006
p2 0.006/;
Parameter PMT(t) Operating cost coefficient for pumping water through pipe (t)
/t1 0.006
t2 0.006/;
Parameter PMF(s) Operating cost coefficient for pumping water through pipe (t)
/s1 0.006 /;
Binary variables
yFIP(s,p) 'if value of yFIP(p) is equal to 1 pipes (or streams FIP) exist
in the network'
yFIT(s,t) 'if value of yFIT(t) is equal to 1 pipes (or streams FIT) exist
in the network '
yFIF(d_s) 'if value of yFIF(t) is equal to 1 pipes (or streams FIF) exist
in the network '
yFTO(t) 'if value of yFTO(t) is equal to 1 pipes (or streams FTO) exist
in the network'
yFT(tt,t) 'if value of yFT(tt,t) is equal to 1 pipes (or streams FT)
exist in the network'
yFTP(t,p) 'if value of yFTP(t,p) is equal to 1 pipes (or streams FTP)
exist in the network';
Positive variables
FW(s) flowrate of water streams going to initial spliter
FIP(s,p) flowrate of water streams from initial spliter going to MPU
FIT(s,t) flowrate of water streams from initial spliter going to
treatment units
FIF(s) flowrate of water streams from SI going to FM
Equations
obj Total cost for water network
eq17 design constraint for streams from spliter treatment units to mixer
process units
eq18 " "
eq19 design constraint for streams from spliter process units to mixer
process units
eq20 " "
eq21 design constraint for streams from spliter process units to mixer
process units
eq22 " "
eq23 design constraint for streams from spliter process units to mixer
treatment units
eq24 " "
eq25 design constraint for streams from spliter process units to final
mixer
eq26 " "
eq27 design constraint for streams from spliter treatment units to final
mixer
eq28 " "
eq29 design constraint for streams from spliter treatment units to mixer
treatment units
eq30 " "
eq31 " "
eq32 " "
eq33 design constraint for streams from initial spliter to mixer process
units
eq34 " "
eq35 design constraint for streams from initial spliter to mixer treatment
units
eq36 " "
eq37 design constraint for streams from initial spliter to final mixer
unit
eq38 " "
eq39 design constraint for maximum number of streams in the network;
eq3MPU(d_p,d_j).. FPUin(d_p)*xPUin(d_p,d_j)=e=
sum(d_s, FIP(d_s,d_p)*xWin(d_s,d_j) )
+ sum(d_pp$(ord(d_pp)<>ord(d_p)and (Recycle_PU =
0)),FP(d_pp,d_p)*xPUout(d_pp,d_j))
+ sum(d_pp$(Recycle_PU = 1),FP(d_pp,d_p)*xPUout(d_pp,d_j))
+ sum(d_t,FTP(d_t,d_p)*xTUout(d_t,d_j))
;
eq11TU(d_t,d_j).. xTUout(d_t,d_j)=e=betaTU(d_t,d_j)*xTUin(d_t,d_j);
eq13STU(d_t,d_j).. xSTUout(d_t,d_j)=e=xTUout(d_t,d_j);
eq14MF.. Fout=e=
sum(d_p,FPO(d_p))
+ sum(d_t,FTO(d_t))
+ sum(d_s$(card(d_p)=0), FIF(d_s))
;
eq15MF(d_j).. Fout*xout(d_j)=e=
sum(d_p,FPO(d_p)*xSPUout(d_p,d_j))
+ sum(d_t,FTO(d_t)*xSTUout(d_t,d_j))
+ sum(d_s$(card(d_p)=0), FIF(d_s)*xWin(d_s,d_j))
;
********************************************
*Design constraints relate the design variables
yFTP(t,p),yFP(pp,p),yFPT(p,t),yFPO(p),yFTO(t),yFT(tt,t)
*and variables of flowrates through the pipes in the network
*(these simply imply that if a pipe exists, the maximum flow in that pipe can take
the values between specified bounds
*while it does not exist the maximum flowrate goes to be zero)
*design constraint which relate the design variables (binary variables and
flowrates through pipes)
*streams from spliter treatment units to mixer process units
eq17(d_t,d_p).. FTP(d_t,d_p)=l=FTP.up(d_t,d_p)*yFTP(d_t,d_p);
eq18(d_t,d_p).. FTP.lo(d_t,d_p)*yFTP(d_t,d_p)=l=FTP(d_t,d_p);
eq21(d_pp,d_p)$((Recycle_PU = 1))..FP(d_pp,d_p)=l=FP.up(d_pp,d_p)*yFP(d_pp,d_p);
eq22(d_pp,d_p)$((Recycle_PU = 1))..FP.lo(d_pp,d_p)*yFP(d_pp,d_p)=l=FP(d_pp,d_p);
eq31(d_tt,d_t)$((Recycle_TU = 1))..FT(d_tt,d_t)=l=FT.up(d_tt,d_t)*yFT(d_tt,d_t);
eq32(d_tt,d_t)$((Recycle_TU = 1))..FT.lo(d_tt,d_t)*yFT(d_tt,d_t)=l=FT(d_tt,d_t);
+ sum((d_p),yFPO(d_p))
+ sum((d_p,d_t),yFPT(d_p,d_t))
+ sum((d_tt,d_t)$(ord(d_tt)<>ord(d_t) and (Recycle_TU = 0)),yFT(d_tt,d_t))
+ sum((d_tt,d_t)$((Recycle_TU = 1)),yFT(d_tt,d_t))
+ sum((d_t),yFTO(d_t))
+ sum((d_t,d_p),yFTP(d_t,d_p))
) =l= N_max_streams;
*Variable bounds
******************Initial Splitter**********************
FW.up(d_s)$(card(d_p)<>0) = sum(d_p,FPUin(d_p));
FW.lo(d_s)$(card(d_p)<>0 and card(d_s)=1)
= smin(d_p,FPUin(d_p));
FWWtotal.fx$(card(d_p)=0) = sum(d_s,FWWin(d_s));
FW.fx(d_s)$(card(d_p)=0) = FWWin(d_s);
FIP.up(d_s,d_p) = FPUin(d_p);
FIT.up(d_s,d_t)$(card(d_p)<>0) = sum(d_p,FPUin(d_p));
FIT.up(d_s,d_t)$(card(d_p)=0) = FWWin(d_s);
FIF.up(d_s)$(card(d_p)=0) = FWWin(d_s);
******************Final Mixer***************************
Fout.lo$(card(d_p)<>0) = (smin(d_p,FPUin(d_p))) ;
Fout.lo$(card(d_p)=0) = (smin(d_s,FWWin(d_s)));
Fout.up$(card(d_p)<>0) = (sum(d_p,FPUin(d_p)));
Fout.up$(card(d_p)=0) = (sum(d_s,FWWin(d_s)));
xout.up(d_j) = xout_max(d_j);
loop((d_j), xout.up(d_j)$(card(d_t)=0)
= smax(d_p,(xPUin_max(d_p,d_j)*FPUin(d_p)+1e03*LPU(d_p,d_j))/
(FPUin(d_p))));
******************Process Units*************************
FPUout.fx(d_p) = FPUin(d_p);
xPUin.up(d_p,d_j) = xPUin_max(d_p,d_j);
xPUout.lo(d_p,d_j) = 1e03*LPU(d_p,d_j)/FPUin(d_p);
xPUout.up(d_p,d_j) = (xPUin_max(d_p,d_j)*FPUin(d_p)+1e03*LPU(d_p,d_j))/
(FPUin(d_p));
FPT.up(d_p,d_t) = FPUin(d_p);
FPO.up(d_p) = FPUin(d_p);
xSPUout.up(d_p,d_j) = xPUout.up(d_p,d_j) ;
******************Treatment Units***********************
FTUin.up(d_t)$(card(d_p)<>0) = sum(d_p,FPUin(d_p)) ;
FTUin.up(d_t)$(card(d_p)=0) = sum(d_s,FWWin(d_s)) ;
FTUout.up(d_t)$(card(d_p)<>0) = sum(d_p,FPUin(d_p));
FTUout.up(d_t)$(card(d_p)=0) = sum(d_s,FWWin(d_s)) ;
loop((d_t,d_j),
xTUin.up(d_t,d_j)$(card(d_p)<>0)
= smax(d_p,(xPUin_max(d_p,d_j)*FPUin(d_p)+1e03*LPU(d_p,d_j))/
FPUin(d_p)));
xTUin.up(d_t,d_j)$(card(d_p)=0) =smax(d_s,xWin(d_s,d_j));
xTUout.up(d_t,d_j) = betaTU(d_t,d_j)*xTUin.up(d_t,d_j);
xSTUout.up(d_t,d_j) = xTUout.up(d_t,d_j);
obj..z=e=
hours*sum(d_s, FW(d_s)*CFW(d_s))
+ AR*sum(d_t,IC(d_t)*FTUout(d_t)**exp(d_t))
+ hours*sum(d_t,OC(d_t)*FTUout(d_t))
+ AR*(
sum((d_s,d_p),CPP(d_p)*yFIP(d_s,d_p)+IPP(d_p)*FIP(d_s,d_p)**expP(d_p))
+ sum((d_s,d_t),CPT(d_t)*yFIT(d_s,d_t)+IPT(d_t)*FIT(d_s,d_t)**expT(d_t))
+ sum((d_s)$(card(d_p)=0),CPF(d_s)*yFIF(d_s)+IPF(d_s)*FIF(d_s)**expF(d_s))
+ sum((d_t,d_p),CPT(d_t)*yFTP(d_t,d_p)+IPT(d_t)*FTP(d_t,d_p)**expT(d_t))
+ sum((d_t),CPT(d_t)*yFTO(d_t)+IPT(d_t)*FTO(d_t)**expT(d_t))
+ sum((d_tt,d_t)$(ord(d_tt)<>ord(d_t) and (Recycle_TU =
0)),CPT(d_t)*yFT(d_tt,d_t)+IPT(d_t)*FT(d_tt,d_t)**expT(d_t))
+ sum((d_tt,d_t)$((Recycle_TU = 1)),CPT(d_t)*yFT(d_tt,d_t)
+IPT(d_t)*FT(d_tt,d_t)**expT(d_t))
)
+ hours*(
sum((d_s,d_p),FIP(d_s,d_p)*PMP(d_p))
+ sum((d_s,d_t),FIT(d_s,d_t)*PMT(d_t))
+ sum((d_s)$(card(d_p)=0),FIF(d_s)*PMF(d_s))
+ sum((d_t,d_p),FTP(d_t,d_p)*PMT(d_t))
+ sum((d_t),FTO(d_t)*PMT(d_t))
+ sum((d_tt,d_t)$(ord(d_tt)<>ord(d_t) and (Recycle_TU =
0)),FT(d_tt,d_t)*PMT(d_tt))
+ sum((d_tt,d_t)$((Recycle_TU = 1)),FT(d_tt,d_t)*PMT(d_tt))
);
Option LIMROW = 0;
Option LIMCOL = 0;
Display z.l;