Infeasible value for SDR OPF problem


(Xristos Agathokleous) #1

Hello i am new in cvx!!I have the following simple power network and i want to solve the opf problem with the sdp relaxation technique.

My code is the following:

function [W,Pg]=mpopfcase6(ybus,6);
Pload=[0 0 0.7 0 0 0.7];
Qload=[0 0 0.7 0 0 0.7];
cvx_begin
variable W(n,n) complex semidefinite;
variable Pg(n);
variable Qg(n);
minimize 0.1*(Pg(1)) ;
subject to
0.9^2<= W(1,1)<=1.1^2;
0.9^2<= W(2,2)<=1.1^2;
0.9^2<=W(3,3)<=1.1^2;
0.9^2<= W(4,4)<=1.1^2;
0.9^2<= W(5,5)<=1.1^2;
0.9^2<= W(6,6)<=1.1^2;
Pg(1)-Qload(1)==real(conj(ybus(1,1))*W(1,1)+conj(ybus(1,5))*W(1,5))+conj(ybus(1,4))*W(1,4);
Pg(2)-Qload(2)==real(conj(ybus(2,2))*W(2,2)+conj(ybus(2,4))*W(2,4))+conj(ybus(2,3))*W(2,3);
Pg(3)-Qload(3)==real(conj(ybus(3,3))*W(3,3)+conj(ybus(3,2))*W(3,2));
Pg(4)-Qload(4)==real(conj(ybus(4,4))*W(4,4)+conj(ybus(4,1))*W(4,1))+conj(ybus(4,2))*W(4,2);
Pg(5)-Qload(5)==real(conj(ybus(5,5))*W(5,5)+conj(ybus(5,1))*W(5,1))+conj(ybus(5,6))*W(5,6);
Pg(6)-Qload(6)==real(conj(ybus(6,6))*W(6,6)+conj(ybus(6,5))*W(6,5));
Qg(1)-Qload(1)==imag(conj(ybus(1,1))*W(1,1)+conj(ybus(1,5))*W(1,5))+conj(ybus(1,4))*W(1,4);
Qg(2)-Qload(2)==imag(conj(ybus(2,2))*W(2,2)+conj(ybus(2,4))*W(2,4))+conj(ybus(2,3))*W(2,3);
Qg(3)-Qload(3)==imag(conj(ybus(3,3))*W(3,3)+conj(ybus(3,2))*W(3,2));
Qg(4)-Qload(4)==imag(conj(ybus(4,4))*W(4,4)+conj(ybus(4,1))*W(4,1))+conj(ybus(4,2))*W(4,2);
Qg(5)-Qload(5)==imag(conj(ybus(5,5))*W(5,5)+conj(ybus(5,1))*W(5,1))+conj(ybus(5,6))*W(5,6);
Qg(6)-Qload(6)==imag(conj(ybus(6,6))*W(6,6)+conj(ybus(6,5))*W(6,5));
for i=1:n
for j=1:n
if i~=j
abs(-conj(ybus(i,j))*W(i,i)+conj(ybus(i,j))*W(i,j))<=1.6;
W(i,j)==conj(W(j,i));
end
end
end
W(1,2)==0; W(1,3)==0; W(1,6)==0; W(2,1)==0;
W(2,5)==0; W(2,6)==0; W(3,1)==0; W(3,4)==0; W(3,5)==0; W(3,6)==0;
W(4,3)==0; W(4,5)==0; W(4,6)==0; W(5,2)==0; W(5,3)==0; W(5,4)==0;
W(6,1)==0; W(6,2)==0; W(6,3)==0; W(6,4)==0;

 W==semidefinite(n);
 W(1,1)==1;
Pg(2)==0;Pg(3)==0;  Pg(4)==0; Pg(5)==0; Pg(6)==0;
   Qg(2)==0; Qg(3)==0;  Qg(4)==0; Qg(5)==0; Qg(6)==0  

cvx_end
end

The system is very simple and the optimal solution is the only solution of the system(slack bus gives the power to the loads, there isn’t any other generator).I dont know what is going wrong, i am sure that SDP relax problem of optimal power flow problem is convex…)
ybus parameter is the admittance matrix of the system.