Hey all,

I need your help. I develop a SOCP formulation for optimal power flow. However, The following error shows

**** Variable enters more than one =C= equation

X(i1)

**** Variable enters more than one =C= equation

X(i2)

**** Variable enters more than one =C= equation

X(i3)

**** Variable enters more than one =C= equation

X(i4)

**** Variable enters more than one =C= equation

X(i5)

Here is the model

***************************************************************

*** SETS

***************************************************************

set i bus /i1*i5/;

alias (i,j);

***************************************************************

*** PARAMETERS

***************************************************************

table G(i,j)

$include g.txt

;

table B(i,j)

$include b.txt

;

***************************************************************

*** VARIABLES

***************************************************************

variable obj

variable P(i)

variable Q(i)

variable X(i)

variable R(i,j)

variable Y(i,j)

***************************************************************

*** EQUATION DECLARATION

***************************************************************

equations

power_loss

active_power(i)

reactive_power(i)

cone(i,j)

;

***************************************************************

*** EQUATION

***************************************************************

X.fx(i)$(ord(i)=1)=1.06*1.06/sqrt(2);

power_loss..

obj =e= sum((i,j),G(i,j)*(sqrt(2)*X(i)+sqrt(2)*X(j)-2*R(i,j)));

active_power(i)..

P(i) =e= sum(j,G(i,j)*R(i,j)+B(i,j)*Y(i,j));

reactive_power(i)..

Q(i) =e= sum(j,-B(i,j)*R(i,j)+G(i,j)*Y(i,j));

cone(i,j)..

X(i)+X(j) =C= R(i,j)+Y(i,j);

model ep /all/;

option limrow = 10000;

option lp=mosek;

solve ep using lp minimizing obj;

## Variable enters more than one =C= equation

### Re: Variable enters more than one =C= equation

Hi

You might have a closer look here: https://www.gams.com/latest/docs/UG_Lan ... rogramming.

Cheers

Renger

You might have a closer look here: https://www.gams.com/latest/docs/UG_Lan ... rogramming.

Cheers

Renger

### Re: Variable enters more than one =C= equation

Hi Renger,

Thanks for your response. I read this document carefully and realize that each decision variables is a member of at most one set in SOCP. Therefore, It seems that one decision variable can only be in one =C= equation.

Do you think my model is a SOCP formulation? and how do I reformulate it as a SOCP one?

Thanks.

Thanks for your response. I read this document carefully and realize that each decision variables is a member of at most one set in SOCP. Therefore, It seems that one decision variable can only be in one =C= equation.

Do you think my model is a SOCP formulation? and how do I reformulate it as a SOCP one?

Thanks.