Linearisation of Bilinear Terms Using McCormick Envelopes

Hi Everyone,

I am solving a problem by linearizing bilinear terms using McCormick envelopes.

*NOTE: Equations are not written exactly as per standard GAMS syntex, so please ignore that and get the idea.

*I want to linearize the following biliear term (EQ 1) using McCormick Envelopes:

VARIABLES q, stream(n,i,f), z;

*Bilinear Term
= q * sum(f, stream(n,i, f)) 	----EQ 1

*using McCormick, it will be equal to z.
z =E= q*sum(f, stream(n,i, f)); 	----EQ 2

*Here I face a problem, EQ 2 cannot be modeled this way in GAMS, the variable z should also hold sets n, i, f as its domain, like this in EQ 3:

z(n,i,f) =E=  q*sum(f, stream(n,i, f)); ---EQ 3

*EQ 3 cannot be formulated this way as in EQ 3, because GAMS will generate an Error message 'uncontrolled set entered as constant'.

*EQ 3 cannot be formulated in following way also, because GAMS will generate many equations instead of a single line summation equation.

Relax1(n,i,f).. z(n,i,f) =E=  q*sum(f, stream(n,i, f)); ----EQ 4

HOW SHOULD I FORMULATE EQ 4 ? APPRECIATE YOUR TIME AND HELP.
THANKS

Hi
If you sum over f in your equations, the equation can’t have the index f in it.

z(n,i,f) =E=  q*sum(f, stream(n,i, f)); 
Relax1(n,i,f).. z(n,i,f) =E=  q*sum(f, stream(n,i, f))

should then be

variable 
   z(n,i)

equations
    eq3(n,i), relax1(n,i);
    
eq3..    
   z(n,i) =E=  q*sum(f, stream(n,i, f)); 

Relax1(n,i).. 
    z(n,i) =E=  q*sum(f, stream(n,i, f));

Cheers
Renger