yeah! i think youjust needed to rename the set c
find the code below
SET c chemical /c1*c20/ ; alias (c, cc); |
|
PARAMETER heat(c) heat Values
/ c1 2.45, c2 1.32, c3 1.23, c4 4.21, c5 2.83, c6 1.92, c7 2.2, c8 6.69, c9 3.67, c10 1.28, c11 2.45, c12 3.33, c13 3.27, c14 1.91, c15 2.32, c16 2.82, c17 1.72, c18 2.62, c19 2.72, c20 1.77/; POSITIVE VARIABLES
mixpercent(c) Mixing percentages associated with chemicals ; FREE VARIABLE
mixheat Objective to minimize ; EQUATIONS
maxlimit(c) Limit of % of any one chemical mixlimit(c) Limit on mix percentage mixobj Objective function ; * No chemical can be more than 20% of mix
maxlimit(c).. mixpercent(c) =l= 0.2; |
* The sum of all the mixing percentages must be less or equal to 50% |
mixlimit(c).. sum(cc, mixpercent(cc)) =e= 0.5; |
|
**** $125 Set is under control already
* Objective to minimize total heat of mix
mixobj.. mixheat =e= sum(c, heat(c)*mixpercent(c)); |
MODEL mix /ALL/; SOLVE mix using LP minimizing mixheat; |
display mixpercent.l;
- - - - - - -- -- -- --- --- --- ----- ---- ---- ---- ----
M. Hervé Jean-Louis GUENE
Ingénieur Statisticien - Economiste
Service du Suivi de la Paurevté (Insitut National de la Statistique et de la Démographie)
cel:(+226) 78 35 77 76/ 71 31 53 52
--- En date de : Lun 14.3.11, Lynn <lynn...@hotmail.com> a écrit : |
|