Hi. I have a binary variable and a nonlinear constraint in my model. Since I dont want to use MINLP I would like to change my non-linear constraint to a linear one and use MILP.(If it is possible). I could not convert the constraint yet so I thought maybe you have an idea.
I have two variables as "D" and "Ad" and the condition is:
if D<0 then Ad=D
if D>=0 then 0<=Ad<=D
I model the constraint as
(D-|D|)/2<= Ad <=D
so the left side takes "D" if "D" is negative and "Ad" will be equal to "D" and it takes 0 if "D" is positive. I could not change this problem to linear. I know we can use binary variable to change absolute value to the linear form but since I already have a binary variable, by adding a new one the size will be huge and it is not solvable with the memory we have. I appreciate any idea you have.
Assuming D is bounded both above and below, you can linearize this as follows:
var X binary;
Ad <= D;
/* if X = 1 then D <= 0 else redundant */
D <= D.ub * (1 - X);
/* if X = 1 then D <= Ad else redundant */
D - Ad <= (D.ub - D.lb) * (1 - X);
/* if X = 0 then D >= 0 else redundant */
D >= D.lb * X;
/* if X = 0 then Ad >= 0 else redundant */
Ad >= D.lb * X;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.