I am working on a GAMS MILP model. In my model, I have a variable that takes both positive and negative values. However, my model objective is to minimize the sum of variable that takes only non-negative values. Please guide me on how to do that in GAMS MILP. Thanks in advance.

Variable X (can take both positive and negative values)

Objective… *(To minimize).

Answer =e= Sum(X); *where X has only non-negative values.

–

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.

Hi,

You can try this:

Y are variables which can be positive or negative. X are positive variables defined as:

X =g= Y ;

Answer =e= Sum(X) ;

Since the objective is to minimize ‘Answer’, if Y is positive, X will take the value of Y, else if Y is negative, X will take the value of 0.

Cheers,

Dylan

åœ¨ 2015å¹´5æœˆ29æ—¥æ˜ŸæœŸäº” UTC+8ä¸‹åˆ10:14:30ï¼ŒCuriousHumanå†™é“ï¼š

I am working on a GAMS MILP model. In my model, I have a variable that takes both positive and negative values. However, my model objective is to minimize the sum of variable that takes only non-negative values. Please guide me on how to do that in GAMS MILP. Thanks in advance.

Variable X (can take both positive and negative values)

Objective… *(To minimize).

Answer =e= Sum(X); *where X has only non-negative values.

–

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.