I have an Equation which is similar to the equation below:

Sum((i,j) , xij * Aij) = C

then this can be implemented by two constraints in GAMS syntax:

constr1.. B +  flag * M =G= C;

* if flag=0 this constraint is equivalent to B >= C

*flag= 1 this constraint is always true which is equivalent to be removed from the model

constr2.. A + B + (1-flag)*M =G=C;

*when flag=1 this constraint is equivalent to A+B >=C 

*when flag=0 this constraint is always true which is equivalent to be removed from the model

More Mehrab Keshavarz's questions See All
Similar questions and discussions