Linearizing the absolute value function of a binary variable

Problems with modeling
Post Reply
mohamed.omer
User
User
Posts: 1
Joined: 1 week ago

Linearizing the absolute value function of a binary variable

Post by mohamed.omer » 5 days ago

Hi Guys,
I am a new user of GAMS and I would like to know how to linearize the absolute value function of a binary variable in the model
Here is my mathematical equation:

W= abs((x*y)-z)/max(z,1)

Kindly note that X is a binary variable while Y & Z are both parameters
Here is how I wrote it in GAMS:
W(i,j)=E=abs((x(i,j)*y(i,'1'))-z(i,j))/max(z(i,j),1);

Appreciate all your help on how to linearize the abs() function in the above equation
Attachments
image.png
image.png (2.18 KiB) Viewed 125 times

Post Reply