Set is under control already

Hi, there. I am pretty new to GAMS. And I am struggling with following problem.


SETS
I nodes / 1* 13 /

P(I) destination or origin / 1* 13 /

VP(P) valid od pair with positive demand;

ALIAS (I,J,II,JJ),(P,Q);

NPOD(I,J,P)$(VP(P) AND ORD(I) EQ ORD(P) AND ORD(J) EQ ORD(Q) AND ORD(I) NE ORD(J))…
M(I,J,P) =E= SUM((I,J)$HARC(I,J), X(I,J,P)*(HW(I,J,“Cost”) + HW(I,J,“Lagm”)))

  • SUM((I,J)$RARC(I,J), Y(I,J,P)*(RW(I,J,“Cost”) + RW(I,J,“Lagm”)) - C(I,J));


    I got the error information in the line “SUM((I,J)$HARC(I,J)”, and it said set is already control. Would anyone kindly point out how can i figure this out? Thanks!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

You cannot have the same variables in the equation and in the sum:

Example: NPOD(I,J,P)…M(I,J,P) =E= SUM(I,J)
You cannot sum over I if the equation NPOD(I,J,P) depends on I.

You can try to use aliases: alias(I,I2)




On Wednesday, 18 March 2015 03:05:38 UTC+1, Peiyu Luo wrote:

Hi, there. I am pretty new to GAMS. And I am struggling with following problem.


SETS
I nodes / 1* 13 /

P(I) destination or origin / 1* 13 /

VP(P) valid od pair with positive demand;

ALIAS (I,J,II,JJ),(P,Q);

NPOD(I,J,P)$(VP(P) AND ORD(I) EQ ORD(P) AND ORD(J) EQ ORD(Q) AND ORD(I) NE ORD(J))…
M(I,J,P) =E= SUM((I,J)$HARC(I,J), X(I,J,P)*(HW(I,J,“Cost”) + HW(I,J,“Lagm”)))

  • SUM((I,J)$RARC(I,J), Y(I,J,P)*(RW(I,J,“Cost”) + RW(I,J,“Lagm”)) - C(I,J));


    I got the error information in the line “SUM((I,J)$HARC(I,J)”, and it said set is already control. Would anyone kindly point out how can i figure this out? Thanks!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.