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 a écrit :
De: Lynn
Objet: Novice struggling with a “Set Already Under Control” error
À: “gamsworld”
Date: Lundi 14 mars 2011, 16h47
Hello everyone. I am a novice at GAMS and am struggling with which
may be a simple error. I have looked at sample code and still dont
understand what I am doing wrong. Here is the code snippit with my
error inserted. Any advice and reason why I am getting the error is
greatly appreciated.
SET c chemical /c1*c20/
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(c, mixpercent(c)) =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;
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
\
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.