parent
1ee3b9312c
commit
bfd2cd8240
2
FormLw.m
2
FormLw.m
|
|
@ -24,7 +24,7 @@ QDU(indQD(3:12:end))=1.55*realQD(indQD(3:12:end));
|
||||||
QDU(indQD(9:12:end))=1.05*realQD(indQD(9:12:end));
|
QDU(indQD(9:12:end))=1.05*realQD(indQD(9:12:end));
|
||||||
% PF=0.85;
|
% PF=0.85;
|
||||||
% QDU=1.0*PD(Loadi).*sqrt(1 -PF.^2)./PF;
|
% QDU=1.0*PD(Loadi).*sqrt(1 -PF.^2)./PF;
|
||||||
t1=([PDU',QDU',VoltU,VoltU,0*ones(1,Busnum)])';
|
t1=([PDU',QDU',VoltU,VoltU,1*ones(1,Busnum)])';
|
||||||
t2=Mat_G+Init_U'-t1;
|
t2=Mat_G+Init_U'-t1;
|
||||||
Lw=t2;
|
Lw=t2;
|
||||||
|
|
||||||
|
|
|
||||||
3
OPF.m
3
OPF.m
|
|
@ -50,7 +50,7 @@ Precision=Precision/1;
|
||||||
%% ¼ÓÎó²î
|
%% ¼ÓÎó²î
|
||||||
PD0(Loadi)=PD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1));
|
PD0(Loadi)=PD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1));
|
||||||
QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1));
|
QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1));
|
||||||
Vbi=sparse(ones(Busnum,1));
|
Vbi=sparse(0.1*ones(Busnum,1));
|
||||||
while(abs(Gap)>Precision)
|
while(abs(Gap)>Precision)
|
||||||
if KK>kmax
|
if KK>kmax
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,5 +93,6 @@ while(abs(Gap)>Precision)
|
||||||
Gap=(Init_L*Init_Z'-Init_U*Init_W');
|
Gap=(Init_L*Init_Z'-Init_U*Init_W');
|
||||||
KK=KK+1;
|
KK=KK+1;
|
||||||
end
|
end
|
||||||
|
fprintf('%f\n',sum(full(Vbi)));
|
||||||
toc
|
toc
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
function deltF=func_deltF(PG,QG,PVi,PGi,wPG,wQG,wPD,wQD,PG0,QG0,PD0,PD,QD,QD0,Busnum,Loadi)
|
function deltF=func_deltF(PG,QG,PVi,PGi,wPG,wQG,wPD,wQD,PG0,QG0,PD0,PD,QD,QD0,Busnum,Loadi)
|
||||||
t3=2*wPD.*(PD(Loadi)-PD0(Loadi));
|
t3=2*wPD.*(PD(Loadi)-PD0(Loadi));
|
||||||
t4=2*wQD.*(QD(Loadi)-QD0(Loadi));
|
t4=2*wQD.*(QD(Loadi)-QD0(Loadi));
|
||||||
deltF=[sparse(t3);
|
deltF=[sparse(length(Loadi),1);
|
||||||
sparse(t4);
|
sparse(length(Loadi),1);
|
||||||
sparse(2*Busnum,1);
|
sparse(2*Busnum,1);
|
||||||
sparse(Busnum,1);
|
sparse(ones(Busnum,1));
|
||||||
];
|
];
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
@ -1,11 +1,3 @@
|
||||||
function deltdeltF=func_deltdeltF(PVi,wPG,wQG,wPD,wQD,ContrlCount)
|
function deltdeltF=func_deltdeltF(PVi,wPG,wQG,wPD,wQD,ContrlCount)
|
||||||
|
deltdeltF=0;
|
||||||
%ContrlCount=size(PVi,1)+size(PGi,1)+size(wD,1)+Busnum*2; %P,Q,Volt theta这些控制变量数
|
|
||||||
C=[wPD' wQD'];
|
|
||||||
sizeC=size(C,2);
|
|
||||||
diagC=sparse(1:sizeC,1:sizeC,C,sizeC,sizeC);
|
|
||||||
deltdeltF=[
|
|
||||||
diagC*2,sparse(sizeC,ContrlCount-sizeC);
|
|
||||||
sparse(ContrlCount-sizeC,ContrlCount);
|
|
||||||
];
|
|
||||||
end
|
end
|
||||||
Loading…
Reference in New Issue