help me to linearize equation

22 views
Skip to first unread message

Fatemi

unread,
May 30, 2012, 12:48:10 AM5/30/12
to gams...@googlegroups.com
Dear GAMS users,

I want to linearize the following equation in the format of MILP:
D=a*b*c;
where 'a' and 'b' are continuous variables with 0<a<1; 0<=b<=1. 'c' is binary variable.

Thanks in advance

olcay emin

unread,
May 30, 2012, 6:20:16 AM5/30/12
to gams...@googlegroups.com
this is my exam. I think you can find good idea.

variables
x1,x2,y1,y2,func,w1;
positive variables
x1,x2,y1,y2;
parameters
x1L,x2L,y1L,y2L
x1U,x2U,y1U,y2U;

x1L=0;
x2L=0;
y1L=0;
y2L=0;

x1U=0;
x2U=0;
y1U=0;
y2U=0;

equations
eq,eq2,q1,q2,q3,q4,q5,q6,we1,we2,we3,we4;

eq.. func=e=x1-x2-y1+x1*y2;
eq2.. func=e=x1-x2-y1+w1;

q1.. x1+4*x2=l=8;
q2.. 4*x1+x2=l=12;
q3.. 3*x1+4*x2=l=12;
q4.. 2*y1+y2=l=8;
q5.. y1+2*y2=l=8;
q6.. y1+y2=l=5;

we1.. x1L*y2+y2L*x1-x1L*y2L-w1=l=0;
we2.. x1U*y2+y2U*x1-x1U*y2U-w1=l=0;
we3.. -x1U*y2-y2L*x1+x1U*y2L+w1=l=0;
we4.. -x1L*y2-y2U*x1+x1L*y2U+w1=l=0;

*x1.lo=0;
*x2.lo=0;
*y1.lo=0;
*y2.lo=0;

*x1.up=10;
*x2.up=10;
*y1.up=10;
*y2.up=10;

model mccormick/eq2,q1,q2,q3,q4,q5,q6,we1,we2,we3,we4 /;

option lp=cplex;

solve mccormick minimizing func using lp;



2012/5/30 Fatemi <yazdan...@gmail.com>
Thanks in advance --
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/HbPGF0LGHTAJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Fatemi

unread,
May 31, 2012, 12:21:19 AM5/31/12
to gams...@googlegroups.com

Thanks Olcay. I try it to find a idea.
Reply all
Reply to author
Forward
0 new messages