Conditions on the decision variable

Problems with syntax of GAMS
Post Reply
StuckOnGams
User
User
Posts: 3
Joined: 3 years ago

Conditions on the decision variable

Post by StuckOnGams »

Hi all,

My objective function depends on the quantity of an equation N(i) = I(i) - b(i) + D(i);

Would it be possible to set N(i) as 0 if it is negative and take the intrinsic value if it is positive? I am currently using NLP solver.

Thanks a lot!
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Conditions on the decision variable

Post by abhosekar »

you want N(i) to be max(0, I(i) - b(i) + D(i));
You can do this by
N(i) =g= 0;
N(i) =g= I(i) - b(i) + D(i);

However, this depends on the fact that your objective naturally tries to minimize N(i). If that's not the case, you will have to use big-M constraints.

- Atharv
Post Reply