加了错误数据后,取一个比较大的互补变量的eps是可以收敛的,不过迭代次数多,达到29次。
Signed-off-by: dugg@lab-desk <dugg@lab-desk>
This commit is contained in:
parent
570808f747
commit
c1727c877f
8
FormLw.m
8
FormLw.m
|
|
@ -1,4 +1,4 @@
|
|||
function Lw=FormLw(Mat_G,Init_U,GenU,Busnum,PVQU,PD,PD0,QD0,Loadi,KK,PF,noDataTransCapacity)
|
||||
function Lw=FormLw(Mat_G,Init_U,GenU,Busnum,PVQU,PD,PD0,QD0,Loadi,KK,PF,eps)
|
||||
KK=999;
|
||||
VoltU=(1.1)*ones(1,Busnum);
|
||||
PDU=PD0(Loadi);
|
||||
|
|
@ -19,9 +19,9 @@ QDU(indQD(3:12:end))=1.55*realQD(indQD(3:12:end));
|
|||
QDU(indQD(9:12:end))=1.05*realQD(indQD(9:12:end));
|
||||
t1=([0*PDU',100*ones(1,length(PDU)),0*QDU',100*ones(1,length(QDU)),0*VoltU,100*ones(1,length(VoltU)),1*ones(1,Busnum+length(Loadi)*2)])';
|
||||
t1=[t1;
|
||||
sparse(ones(Busnum,1));
|
||||
sparse(ones(length(Loadi),1));
|
||||
sparse(ones(length(Loadi),1));
|
||||
sparse(eps*ones(Busnum,1));
|
||||
sparse(eps*ones(length(Loadi),1));
|
||||
sparse(eps*ones(length(Loadi),1));
|
||||
];
|
||||
t2=Mat_G+Init_U'-t1;
|
||||
Lw=t2;
|
||||
|
|
|
|||
8
FormLz.m
8
FormLz.m
|
|
@ -1,4 +1,4 @@
|
|||
function Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD,PD0,QD0,Loadi,KK,PF)
|
||||
function Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD,PD0,QD0,Loadi,KK,PF,eps)
|
||||
KK=999;
|
||||
|
||||
VoltL=(0.9)*ones(1,Busnum);
|
||||
|
|
@ -23,9 +23,9 @@ QDL(indQD(9:12:end))=0.95*realQD(indQD(9:12:end));
|
|||
% QDL=0*PD(Loadi).*sqrt((1-PF.^2))./PF;
|
||||
t1=([-100*ones(1,length(PDL)),0*PDL',-100*ones(1,length(QDL)),0*QDL',-100*ones(1,length(VoltL)),0*VoltL,0*ones(1,Busnum+length(Loadi)*2)])';
|
||||
t1=[t1;
|
||||
sparse(0*ones(Busnum,1));
|
||||
sparse(0*ones(length(Loadi),1));
|
||||
sparse(0*ones(length(Loadi),1));
|
||||
sparse(-eps*ones(Busnum,1));
|
||||
sparse(-eps*ones(length(Loadi),1));
|
||||
sparse(-eps*ones(length(Loadi),1));
|
||||
];
|
||||
t2=Mat_G-Init_L'-t1;
|
||||
Lz=t2;
|
||||
|
|
|
|||
13
OPF.m
13
OPF.m
|
|
@ -46,7 +46,7 @@ Gap=(Init_L*Init_Z'-Init_U*Init_W');
|
|||
KK=0;
|
||||
plotGap=zeros(1,60);
|
||||
ContrlCount=size(Loadi,1)*2+Busnum*2+Busnum+length(Loadi)*2;
|
||||
kmax=60;
|
||||
kmax=100;
|
||||
Precision=Precision/1;
|
||||
%% ¼ÓÎó²î
|
||||
sigma=0.01;
|
||||
|
|
@ -55,11 +55,13 @@ QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,sigma,length(Loadi),1));
|
|||
mPD=PD0;
|
||||
mQD=QD0;
|
||||
mVolt=rVolt.*(1+normrnd(0,sigma,length(rVolt),1))';
|
||||
mVolt(2)=2;
|
||||
bigM=10;
|
||||
Vbi=sparse(0.5*ones(Busnum,1));
|
||||
PDbi=sparse(0.5*ones(length(Loadi),1));
|
||||
QDbi=sparse(0.5*ones(length(Loadi),1));
|
||||
while(abs(Gap)>Precision)
|
||||
eps=10;
|
||||
while(abs(Gap)>Precision*1)
|
||||
if KK>kmax
|
||||
break;
|
||||
end
|
||||
|
|
@ -88,8 +90,11 @@ while(abs(Gap)>Precision)
|
|||
Mat_G=FormG(Volt,PD,QD,Loadi,bigM,mVolt,rVolt,sigma,Vbi,PDbi,QDbi,mPD,mQD);
|
||||
Mat_H=FormH(Busnum,Volt,PG,PD,QG,QD,Y,UAngel,r,c,Angle,Loadi);
|
||||
Ly=Mat_H;
|
||||
Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD,RealPD,RealQD,Loadi,KK,PF);
|
||||
Lw=FormLw(Mat_G,Init_U,GenU,Busnum,PVQU,PD,RealPD,RealQD,Loadi,KK,PF);
|
||||
% if KK>5
|
||||
% eps=eps*1.9;
|
||||
% end
|
||||
Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD,RealPD,RealQD,Loadi,KK,PF,eps);
|
||||
Lw=FormLw(Mat_G,Init_U,GenU,Busnum,PVQU,PD,PD0,QD0,Loadi,KK,PF,eps);
|
||||
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
|
||||
YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
|
||||
%% ¿ªÊ¼½â·½³Ì
|
||||
|
|
|
|||
Loading…
Reference in New Issue