把电流不等式约束改成了电流的平方,收敛了,但还没检查一下代码是不是全对。吃完饭要看看。
Signed-off-by: dugg@lab-desk <dugg@lab-desk>
This commit is contained in:
parent
89b368dedf
commit
42228639e5
7
FormG.m
7
FormG.m
|
|
@ -1,6 +1,9 @@
|
||||||
function Mat_G=FormG(I1r,I1i)
|
function Mat_G=FormG(I1r,I1i)
|
||||||
|
% Mat_G=[
|
||||||
|
% I1r;
|
||||||
|
% I1i;
|
||||||
|
% ];
|
||||||
Mat_G=[
|
Mat_G=[
|
||||||
I1r;
|
I1r.^2+I1i.^2;
|
||||||
I1i;
|
|
||||||
];
|
];
|
||||||
end
|
end
|
||||||
2
FormLw.m
2
FormLw.m
|
|
@ -7,6 +7,6 @@ function Lw=FormLw(Loadi,Mat_G,Init_U)
|
||||||
% VoltU];
|
% VoltU];
|
||||||
% t2=Mat_G+Init_U-t1;
|
% t2=Mat_G+Init_U-t1;
|
||||||
% Lw=t2;
|
% Lw=t2;
|
||||||
upper=0.20*sparse(ones(length(Loadi)*2,1));
|
upper=1*sparse(ones(length(Loadi)*1,1));
|
||||||
Lw=Mat_G+Init_U-upper;
|
Lw=Mat_G+Init_U-upper;
|
||||||
end
|
end
|
||||||
2
FormLz.m
2
FormLz.m
|
|
@ -8,7 +8,7 @@ function Lz=FormLz(Loadi,Mat_G,Init_L)
|
||||||
% ];
|
% ];
|
||||||
% t2=Mat_G-Init_L-t1;
|
% t2=Mat_G-Init_L-t1;
|
||||||
% Lz=t2;
|
% Lz=t2;
|
||||||
lower=-0.20*sparse(ones(length(Loadi)*2,1));
|
lower=0*sparse(ones(length(Loadi)*1,1));
|
||||||
Lz=Mat_G-Init_L-lower;
|
Lz=Mat_G-Init_L-lower;
|
||||||
% Lz=-[]
|
% Lz=-[]
|
||||||
end
|
end
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function deltG=func_deltG(busNum,Loadi)
|
function deltG=func_deltG(busNum,Loadi,I1r,I1i)
|
||||||
% dgV_dPD=sparse(length(Loadi),busNum);
|
% dgV_dPD=sparse(length(Loadi),busNum);
|
||||||
% dgV_dQD=sparse(length(Loadi),busNum);
|
% dgV_dQD=sparse(length(Loadi),busNum);
|
||||||
% dgV_dx=[sparse(1:busNum,1:busNum,ones(busNum,1),busNum,busNum);
|
% dgV_dx=[sparse(1:busNum,1:busNum,ones(busNum,1),busNum,busNum);
|
||||||
|
|
@ -15,7 +15,8 @@ function deltG=func_deltG(busNum,Loadi)
|
||||||
% %%
|
% %%
|
||||||
|
|
||||||
deltG=[
|
deltG=[
|
||||||
zeros(busNum*2,length(Loadi)*2);
|
zeros(busNum*2,length(Loadi)*1);
|
||||||
eye(length(Loadi)*2);
|
2*eye(length(Loadi)*1)*diag(I1r);
|
||||||
|
2*eye(length(Loadi)*1)*diag(I1i);
|
||||||
];
|
];
|
||||||
end
|
end
|
||||||
4
run.m
4
run.m
|
|
@ -257,7 +257,7 @@ KK=0;
|
||||||
plotGap=zeros(1,60);
|
plotGap=zeros(1,60);
|
||||||
%初始化
|
%初始化
|
||||||
%状态量为 SEPD SEQD SEVmf1 SEVaf1
|
%状态量为 SEPD SEQD SEVmf1 SEVaf1
|
||||||
RestraintCount=length(Loadi)*2;
|
RestraintCount=length(Loadi)*1;
|
||||||
ContrlCount=busNum*2+length(Loadi)*2;
|
ContrlCount=busNum*2+length(Loadi)*2;
|
||||||
CenterA=0.1;
|
CenterA=0.1;
|
||||||
Init_Z=sparse(ones(RestraintCount,1));
|
Init_Z=sparse(ones(RestraintCount,1));
|
||||||
|
|
@ -276,7 +276,7 @@ while Gap>1e-5 && KK<20
|
||||||
KK=KK+1;
|
KK=KK+1;
|
||||||
Init_u=Gap/2/RestraintCount*CenterA;
|
Init_u=Gap/2/RestraintCount*CenterA;
|
||||||
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
|
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
|
||||||
deltG=func_deltG(busNum,Loadi);
|
deltG=func_deltG(busNum,Loadi,I1r,I1i);
|
||||||
% deltG=0;
|
% deltG=0;
|
||||||
L_1Z=diag(Init_Z./Init_L);
|
L_1Z=diag(Init_Z./Init_L);
|
||||||
U_1W=diag(Init_W./Init_U);
|
U_1W=diag(Init_W./Init_U);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue