Variable enters more than one =C= equation
Posted: Thu May 31, 2018 7:35 pm
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;
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;