改一种电流约束的形式,还没改完,正在进行中……
Signed-off-by: dugg@lab-desk <dugg@lab-desk>
This commit is contained in:
parent
401b698c37
commit
420ac03a92
4
FormLw.m
4
FormLw.m
|
|
@ -1,5 +1,5 @@
|
||||||
function Lw=FormLw(Loadi,Mat_G,Init_U)
|
function Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement)
|
||||||
|
|
||||||
upper=0.03*sparse(ones(length(Loadi)*1,1));
|
upper=abs(I1measurement).^2.*1.1.*sparse(ones(length(Loadi)*1,1));
|
||||||
Lw=Mat_G+Init_U-upper;
|
Lw=Mat_G+Init_U-upper;
|
||||||
end
|
end
|
||||||
4
FormLz.m
4
FormLz.m
|
|
@ -1,5 +1,5 @@
|
||||||
function Lz=FormLz(Loadi,Mat_G,Init_L)
|
function Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement)
|
||||||
|
|
||||||
lower=0*sparse(ones(length(Loadi)*1,1));
|
lower=abs(I1measurement).^2.*0.9.*sparse(ones(length(Loadi)*1,1));
|
||||||
Lz=Mat_G-Init_L-lower;
|
Lz=Mat_G-Init_L-lower;
|
||||||
end
|
end
|
||||||
12
IPMLoop.m
12
IPMLoop.m
|
|
@ -8,7 +8,12 @@ KK=0;
|
||||||
plotGap=zeros(1,60);
|
plotGap=zeros(1,60);
|
||||||
%初始化
|
%初始化
|
||||||
%状态量为 SEPD SEQD SEVmf1 SEVaf1
|
%状态量为 SEPD SEQD SEVmf1 SEVaf1
|
||||||
|
state=1;
|
||||||
|
if state==1
|
||||||
|
RestraintCount=length(Loadi)*2;
|
||||||
|
else
|
||||||
RestraintCount=length(Loadi)*1;
|
RestraintCount=length(Loadi)*1;
|
||||||
|
end
|
||||||
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));
|
||||||
|
|
@ -28,7 +33,10 @@ while(abs(Gap)>0.000001)
|
||||||
%% 形成等式约束的雅克比
|
%% 形成等式约束的雅克比
|
||||||
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
|
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
|
||||||
%% 形成不等式约束的雅克比
|
%% 形成不等式约束的雅克比
|
||||||
|
if state==1
|
||||||
|
else
|
||||||
deltG=func_deltG(busNum,Loadi,I1r,I1i);
|
deltG=func_deltG(busNum,Loadi,I1r,I1i);
|
||||||
|
end
|
||||||
%%
|
%%
|
||||||
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);
|
||||||
|
|
@ -49,8 +57,8 @@ while(abs(Gap)>0.000001)
|
||||||
Mat_G=FormG(I1r,I1i);
|
Mat_G=FormG(I1r,I1i);
|
||||||
Mat_H=FormH(fsY1,Loadi,V1r,V1i,I1r,I1i,BalI1r,BalI1i,Balance);
|
Mat_H=FormH(fsY1,Loadi,V1r,V1i,I1r,I1i,BalI1r,BalI1i,Balance);
|
||||||
Ly=Mat_H;
|
Ly=Mat_H;
|
||||||
Lz=FormLz(Loadi,Mat_G,Init_L);
|
Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement);
|
||||||
Lw=FormLw(Loadi,Mat_G,Init_U);
|
Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement);
|
||||||
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
|
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
|
||||||
YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
|
YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
|
||||||
%% 开始解方程
|
%% 开始解方程
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
function deltG=func_deltGstate1(busNum,Loadi,I1r,I1i)
|
||||||
|
deltG=[
|
||||||
|
zeros(busNum*2,length(Loadi)*1);
|
||||||
|
2*eye(length(Loadi)*1)*diag(I1r);
|
||||||
|
2*eye(length(Loadi)*1)*diag(I1i);
|
||||||
|
];
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue