Hello,
I did some research and I think I understand the reason why AMPL does not allow strict inequalities such as ">". Now, for my model, I really need a strict inequality as I am checking if a continuous variable lies between a certain lower and upper bound.
L = lower bound
U = upper bound
b = continuous variable
M = large number
u,v,t = binary variables
t=1 if b lies between L and U, 0 otherwise
L <= b <= U
(1) L<= b + M * (1 - u)
(2) L> b - M * u
(3) b <= U + M * (1 - v)
(4) b > U- M * v
(5) 0 <= u + v - 2t <= 1
If I replace the ">" with ">=" and if b equals L, then t takes the value 0 even though it should be 1.
It seems to me that I really need the strict inequality
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Example if I remove the strict inequality:
L = 10
U = 20
b = 10
(1) 10 <= 10 + M * (1 - (1,0)) #0,1 both works
(2) 10 >= 10 - M * (1,0) #0,1 both works
(3) 10 <= 20 + M * (1 - (1,0) #0,1 both works
(4) 10 >= 20 - M * 1 #only 1 works, so v=1
(5) 0 <= 0 + 1 - 2 * 0 <= 1 #since t=0, u is 0 as well
I would like to have no term in the objective function to force t to equal 1 whenever it can (consequently forcing u to equal 1 also)
Thank you very much in advance