MIP equation for "lower equal", "greater equal", "lower then" and "greater then"

Problems with modeling
Post Reply
zoe_optim
User
User
Posts: 1
Joined: 4 years ago

MIP equation for "lower equal", "greater equal", "lower then" and "greater then"

Post by zoe_optim »

Hello,
I am quite new in programming gams and I need a MIP version of the following equation:

equation eq;
eq.. F =e= rel_le(c,1)*0.9
+rel_gt(c,1)*rel_lt(c,4)*(0.8+0.1*(4-c)/3)
+rel_ge(c,4)*0.8;

So: F is 0.8 for c = 1 or lower and 0.9 for c= 4 or higher, linear between.

I would be so happy to receive help! Thank you!
User avatar
bussieck
Moderator
Moderator
Posts: 1042
Joined: 7 years ago

Re: MIP equation for "lower equal", "greater equal", "lower then" and "greater then"

Post by bussieck »

This is a classic example for piece-wise linear functions. There are many ways to formulate this, see e.g. https://www.gams.com/latest/gamslib_ml/ ... nspwl.html. If your c is bounded, then I would go for the binary formulation (trnsdiscB).

Have fun.

-Michael
Post Reply