Nikou
1
I would like to model the following logic
IF X = 0 THEN Y = 1
IF X > 0 THEN Y => 0
X is declared to be positive variable
Y is declared to be binary
I model this in GAMS as follows:
Y =g= 1 - X * BigNumber ;
So,
If X = 0 then Y => 1 and because Y is binary Y=1
If X => 1/BigNumber then Y => 0
My question is, how big should BigNumber be in order not to get into trouble?
Hi,
In Math Programming, strict inequalities (as in your condition X>0) make no sense. For more details see: https://support.gams.com/gams:formulate_a_constraint_with_a_condition
Apart from that, I don’t see how your single =g= constraint should force y=0 if x>0.
Once you know “how much” greater than zero (e.g. X>=1e-6) X should be to imply Y=0, you can use the reformulation described here: https://support.gams.com/gams:formulate_logical_expressions_in_equations?s[]=strict
If you know bounds for X, you can usually derive how big your bigNumber (frequently referred to as bigM) has to be.
I hope this helps!
Best,
Fred