Reference
Category : GAMS NOA library
Mainfile : pool2.gms
$onText
A pooling system with five feeds, three pools and five products.
$offText
VARIABLES
q11 fraction of flow to pool 1 from feed 1
q12 fraction of flow to pool 1 from feed 2
q13 fraction of flow to pool 1 from feed 3
q21 fraction of flow to pool 2 from feed 1
q22 fraction of flow to pool 2 from feed 2
q23 fraction of flow to pool 2 from feed 3
q41 fraction of flow to pool 4 from feed 1
q42 fraction of flow to pool 4 from feed 2
q43 fraction of flow to pool 4 from feed 3
q51 fraction of flow to pool 5 from feed 1
q52 fraction of flow to pool 5 from feed 2
q53 fraction of flow to pool 5 from feed 3
z31 flow from feed 3 to product 1
z32 flow from feed 3 to product 2
z33 flow from feed 3 to product 3
z34 flow from feed 3 to product 4
z35 flow from feed 3 to product 5
y11 flow from pool 1 to product 1
y12 flow from pool 1 to product 2
y13 flow from pool 1 to product 3
y14 flow from pool 1 to product 4
y15 flow from pool 1 to product 5
y21 flow from pool 2 to product 1
y22 flow from pool 2 to product 2
y23 flow from pool 2 to product 3
y24 flow from pool 2 to product 4
y25 flow from pool 2 to product 5
y31 flow from pool 3 to product 1
y32 flow from pool 3 to product 2
y33 flow from pool 3 to product 3
y34 flow from pool 3 to product 4
y35 flow from pool 3 to product 5
objval objective function variable;
FREE VARIABLES objval;
EQUATIONS
f Objective function
g1
g2
g3
g4
g5
g6
g7
g8
g9
g10
g11
g12
g13
g14
g15
g16
g17
g18
g19 ;
f .. objval =e= (18 - 6*q11 - 16*q21 - 15*q41 - 12*q51)*y11 +
(18 - 6*q12 - 16*q22 - 15*q42 - 12*q52)*y21 +
(18 - 6*q13 - 16*q23 - 15*q43 - 12*q53)*y31 +
(15 - 6*q11 - 16*q21 - 15*q41 - 12*q51)*y12 +
(15 - 6*q12 - 16*q22 - 15*q42 - 12*q52)*y22 +
(15 - 6*q13 - 16*q23 - 15*q43 - 12*q53)*y32 +
(19 - 6*q11 - 16*q21 - 15*q41 - 12*q51)*y13 +
(19 - 6*q12 - 16*q22 - 15*q42 - 12*q52)*y23 +
(19 - 6*q13 - 16*q23 - 15*q43 - 12*q53)*y33 +
(16 - 6*q11 - 16*q21 - 15*q41 - 12*q51)*y14 +
(16 - 6*q12 - 16*q22 - 15*q42 - 12*q52)*y24 +
(16 - 6*q13 - 16*q23 - 15*q43 - 12*q53)*y34 +
(14 - 6*q11 - 16*q21 - 15*q41 - 12*q51)*y15 +
(14 - 6*q12 - 16*q22 - 15*q42 - 12*q52)*y25 +
(14 - 6*q13 - 16*q23 - 15*q43 - 12*q53)*y35 +
8*z31 + 5*z32 + 9*z33 + 6*z34 + 4*z35;
g1 .. q41*y11 + q41*y12 + q41*y13 + q41*y14 + q41*y15 + q42*y21 +
q42*y22 + q42*y23 + q42*y24 + q42*y25 + q43*y31 + q43*y32 +
q43*y33 + q43*y34 + q43*y35 =l= 50;
g2 .. y11 + y21 + y31 + z31 =l= 100;
g3 .. y12 + y22 + y32 + z32 =l= 200;
g4 .. y13 + y23 + y33 + z33 =l= 100;
g5 .. y14 + y24 + y34 + z34 =l= 100;
g6 .. y15 + y25 + y35 + z35 =l= 100;
g7 .. (3*q11 + q21 + q41 + 1.5*q51 -2.5)*y11 +
(3*q12 + q22 + q42 + 1.5*q52 - 2.5)*y21 +
(3*q13 + q23 + q43 + 1.5*q53 - 2.5)*y31 - 0.5*z31 =l= 0;
g8 .. (q11 + 3*q21 + 2.5*q41 + 2.5*q51 -2)*y11 +
(q12 + 3*q22 + 2.5*q42 + 2.5*q52 - 2)*y21 +
(q13 + 3*q23 + 2.5*q43 + 2.5*q53 - 2)*y31 + 0.5*z31 =l= 0;
g9 .. (3*q11 + q21 + q41 + 1.5*q51 -1.5)*y12 +
(3*q12 + q22 + q42 + 1.5*q52 - 1.5)*y22 +
(3*q13 + q23 + q43 + 1.5*q53 - 1.5)*y32 + 0.5*z32 =l= 0;
g10 .. (q11 + 3*q21 + 2.5*q41 + 2.5*q51 -2.5)*y12 +
(q12 + 3*q22 + 2.5*q42 + 2.5*q52 - 2.5)*y22 +
(q13 + 3*q23 + 2.5*q43 + 2.5*q53 - 2.5)*y32 =l= 0;
g11 .. (3*q11 + q21 + q41 + 1.5*q51 -2)*y13 +
(3*q12 + q22 + q42 + 1.5*q52 - 2)*y23 +
(3*q13 + q23 + q43 + 1.5*q53 - 2)*y33 =l= 0;
g12 .. (q11 + 3*q21 + 2.5*q41 + 2.5*q51 -2.6)*y13 +
(q12 + 3*q22 + 2.5*q42 + 2.5*q52 - 2.6)*y23 +
(q13 + 3*q23 + 2.5*q43 + 2.5*q53 - 2.6)*y33 - 0.1*z33 =l= 0;
g13 .. (3*q11 + q21 + q41 + 1.5*q51 -2)*y14 +
(3*q12 + q22 + q42 + 1.5*q52 - 2)*y24 +
(3*q13 + q23 + q43 + 1.5*q53 - 2)*y34 =l= 0;
g14 .. (q11 + 3*q21 + 2.5*q41 + 2.5*q51 -2)*y14 +
(q12 + 3*q22 + 2.5*q42 + 2.5*q52 - 2)*y24 +
(q13 + 3*q23 + 2.5*q43 + 2.5*q53 - 2)*y34 + 0.5*z34 =l= 0;
g15 .. (3*q11 + q21 + q41 + 1.5*q51 -2)*y15 +
(3*q12 + q22 + q42 + 1.5*q52 - 2)*y25 +
(3*q13 + q23 + q43 + 1.5*q53 - 2)*y35 =l= 0;
g16 .. (q11 + 3*q21 + 2.5*q41 + 2.5*q51 -2)*y15 +
(q12 + 3*q22 + 2.5*q42 + 2.5*q52 - 2)*y25 +
(q13 + 3*q23 + 2.5*q43 + 2.5*q53 - 2)*y35 + 0.5*z35 =l= 0;
g17 .. q11 + q21 + q41 + q51 =e= 1;
g18 .. q12 + q22 + q42 + q52 =e= 1;
g19 .. q13 + q23 + q43 + q53 =e= 1;
* Bounds
q11.LO = 0; q11.UP = 1;
q12.LO = 0; q12.UP = 1;
q13.LO = 0; q13.UP = 1;
q21.LO = 0; q21.UP = 1;
q22.LO = 0; q22.UP = 1;
q23.LO = 0; q23.UP = 1;
q41.LO = 0; q41.UP = 1;
q42.LO = 0; q42.UP = 1;
q43.LO = 0; q43.UP = 1;
q51.LO = 0; q51.UP = 1;
q52.LO = 0; q52.UP = 1;
q53.LO = 0; q53.UP = 1;
y11.LO = 0; y11.UP = 100;
y12.LO = 0; y12.UP = 200;
y13.LO = 0; y13.UP = 100;
y14.LO = 0; y14.UP = 100;
y15.LO = 0; y15.UP = 100;
y21.LO = 0; y21.UP = 100;
y22.LO = 0; y22.UP = 200;
y23.LO = 0; y23.UP = 100;
y24.LO = 0; y24.UP = 100;
y25.LO = 0; y25.UP = 100;
y31.LO = 0; y31.UP = 100;
y32.LO = 0; y32.UP = 200;
y33.LO = 0; y33.UP = 100;
y34.LO = 0; y34.UP = 100;
y35.LO = 0; y35.UP = 100;
z31.LO = 0; z31.UP = 100;
z32.LO = 0; z32.UP = 200;
z33.LO = 0; z33.UP = 100;
z34.LO = 0; z34.UP = 100;
z35.LO = 0; z35.UP = 100;
* Starting point (global solution)
* q11.L = 1; q12.L = 0; q13.L = 0.2757;
* q21.L = 0; q22.L = 0; q23.L = 0;
* q41.L = 0; q42.L = 0; q43.L = 0;
* q51.L = 0; q52.L = 1; q53.L = 0.7243;
* y11.L = 51.5527; y12.L = 0; y13.L = 0;
* y14.L = 7.9609; y15.L = 15.7866;
* y21.L = 0; y22.L = 200; y23.L = 0;
* y24.L = 0; y25.L = 20.5622;
* y31.L = 17.9054; y32.L = 0; y33.L = 0;
* y34.L = 92.0391; y35.L = 63.6512;
* z31.L = 30.4969; z32.L = 0; z33.L = 100;
* z34.L = 0; z35.L = 0;
MODEL Pool2 /ALL/;
SOLVE Pool2 USING NLP MAXIMIZING objval;
* End Pool2