把不等式上下界放在外面

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab 2015-04-26 14:22:56 +08:00
parent 8c4500f3db
commit 29fea6f3fa
3 changed files with 20 additions and 8 deletions

View File

@ -1,4 +1,4 @@
function Lw=FormLw(Mat_G,Init_U,Loadi,rPD3P,rQD3P,mVoltABCV)
function Lw=FormLw(Mat_G,Init_U,Loadi,rPD3P,rQD3P,mVoltABCV,PDU,QDU)
% KK=999;
% %PU=GenU(:,2);%
%
@ -26,8 +26,10 @@ function Lw=FormLw(Mat_G,Init_U,Loadi,rPD3P,rQD3P,mVoltABCV)
% QDU=1.0*PD(Loadi).*sqrt(1 -PF.^2)./PF;
% PDU=1.8*ones(length(Loadi),1);
% QDU=1.8*ones(length(Loadi),1);
PDU=1.3*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
QDU=1.3*rQD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
% PDU=1.3*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
% QDU=1.3*rQD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
% t1=([PDU',QDU',1*ones(length(Volt),1)'])';
t1=([PDU',QDU'])';
t2=Mat_G+Init_U'-t1;

View File

@ -1,4 +1,4 @@
function Lz=FormLz(Mat_G,Init_L,Loadi,rPD3P,rQD3P,mVoltABCV)
function Lz=FormLz(Mat_G,Init_L,Loadi,rPD3P,rQD3P,mVoltABCV,PDL,QDL)
% KK=999;
%
% VoltL=(0.9)*ones(1,Busnum);
@ -23,8 +23,10 @@ function Lz=FormLz(Mat_G,Init_L,Loadi,rPD3P,rQD3P,mVoltABCV)
% QDL=0*PD(Loadi).*sqrt((1-PF.^2))./PF;
% PDL=0*ones(length(Loadi),1);
% QDL=0*ones(length(Loadi),1);
PDL=0.70*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
QDL=0.70*rQD3P.*(1+unifrnd(-0.15,0.15,length(rQD3P),1));
% PDL=0.70*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
% QDL=0.70*rQD3P.*(1+unifrnd(-0.15,0.15,length(rQD3P),1));
% t1=([PDL',QDL',0.88*ones(length(Volt),1)'])';
t1=([PDL',QDL'])';
t2=Mat_G-Init_L'-t1;

12
OPF.m
View File

@ -257,6 +257,7 @@ CenterA=0.1;
Volt=1*Vp3m;
% Volt=mVoltABCV;
UAngel=Vp3a;
isSetBound=0;
while(abs(Gap)>Precision)
if KK>kmax
break;
@ -288,8 +289,15 @@ while(abs(Gap)>Precision)
Mat_G=FormG(Volt,PD3P,QD3P,Loadi);
Mat_H=FormH(Busnum,Volt,PG3P,PD3P,QG3P,QD3P,Y,UAngel,r,c,Yangle,Loadi);
Ly=Mat_H;
Lz=FormLz(Mat_G,Init_L,Loadi,rPD3P,rQD3P,rVoltABCV);
Lw=FormLw(Mat_G,Init_U,Loadi,rPD3P,rQD3P,rVoltABCV);
if isSetBound==0
PDL=0.70*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
QDL=0.70*rQD3P.*(1+unifrnd(-0.15,0.15,length(rQD3P),1));
PDU=1.3*rPD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
QDU=1.3*rQD3P.*(1+unifrnd(-0.15,0.15,length(rPD3P),1));
isSetBound=1;
end
Lz=FormLz(Mat_G,Init_L,Loadi,rPD3P,rQD3P,rVoltABCV,PDL,QDL);
Lw=FormLw(Mat_G,Init_U,Loadi,rPD3P,rQD3P,rVoltABCV,PDU,QDU);
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
% YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
%% ¿ªÊ¼½â·½³Ì