目录
1.课题概述
基于仿射区间的分布式三相不对称配电网潮流算法matlab仿真。 基于仿射区间的,含分布式电源的配电网三相潮流算法,算法涉及仿射,三相,分布式电源注入等。
2.系统仿真结果
3.核心程序与模型
版本:MATLAB2022a
................................................................................
%%
%开始迭代
S0 = S;
k = 0;
Us = zeros(N,3,2*N+1+2*(Max_Iteration-1)*N);
TempUs = Us;
active = 2*N+1;
UsA = zeros(N,2*N+1+2*(Max_Iteration-1)*N);
TempUsA= UsA;
UsB = zeros(N,2*N+1+2*(Max_Iteration-1)*N);
TempUsB= UsB;
UsC = zeros(N,2*N+1+2*(Max_Iteration-1)*N);
TempUsC= UsC;
while k < Max_Iteration
k = k + 1;
%计算PI节点的Qk
if nPI > 0
QPI = [sqrt((DG(PINum,18)./I_base).^2.*abs(U(PIbus,2)).^2 - (DG(PINum,4)/P_base).^2),...
sqrt((DG(PINum,19)./I_base).^2.*abs(U(PIbus,3)).^2 - (DG(PINum,6)/P_base).^2),...
sqrt((DG(PINum,20)./I_base).^2.*abs(U(PIbus,4)).^2 - (DG(PINum,8)/P_base).^2)];
S(PIbus,2:4) = S0(PIbus,2:4) + QPI;
end
..................................................................
%考虑DG节点
if nPV > 0
UPVbus = U(PVbus,:);
DeltaUDG = [PVbus,real(UDG(:,2)-UPVbus(:,2)),real((UDG(:,3)-UPVbus(:,3))*exp(1i*2/3*pi)),real((UDG(:,4)-UPVbus(:,4))*exp(-1i*2/3*pi))];
DeltaQ = ZXinv*reshape(DeltaUDG(:,2:4)',size(Q,1)*size(Q,2),1);
%更新PV型DG的Q值
Q = Q + DeltaQ;
QMatr = reshape(Q,3,size(Q,1)*size(Q,2)/3)';
%检查 PV 节点的无功越界情况
for m = 1:nPV
for j = 1:3
if(QMatr(m,j) > DG(PVNum(m),10))
QMatr(m,j) = DG(PVNum(m),10);
elseif (QMatr(m,j) < DG(PVNum(m),11))
QMatr(m,j) = DG(PVNum(m),11);
end
end
end
Q = reshape(QMatr',size(Q,1)*size(Q,2),1);
end
end
A_infor(1,:)= maxreal1A(:);
A_infor(2,:)= -minreal1A(:);
A_infor(3,:)= maximag1A(:);
A_infor(4,:)= -minimag1A(:);
B_infor(1,:)= -maxreal1B(:);
B_infor(2,:)= minreal1B(:);
B_infor(3,:)= -maximag1B(:);
B_infor(4,:)= minimag1B(:);
C_infor(1,:)= -maxreal1C(:);
C_infor(2,:)= minreal1C(:);
C_infor(3,:)= maximag1C(:);
C_infor(4,:)= -minimag1C(:);
maxreal_phase1 = A_infor(1,:);
minreal_phase1 = A_infor(2,:);
maximag_phase1 = A_infor(3,:);
minimag_phase1 = A_infor(4,:);
maxreal_phase2 = B_infor(1,:);
minreal_phase2 = B_infor(2,:);
maximag_phase2 = B_infor(3,:);
minimag_phase2 = B_infor(4,:);
maxreal_phase3 = C_infor(1,:);
minreal_phase3 = C_infor(2,:);
maximag_phase3 = C_infor(3,:);
minimag_phase3 = C_infor(4,:);
%得到三相仿射的区间值
[V_abs_phase1,V_ang_phase1] = func_affine_result(maxreal_phase1,minreal_phase1,maximag_phase1,minimag_phase1,N);
[V_abs_phase2,V_ang_phase2] = func_affine_result(maxreal_phase2,minreal_phase2,maximag_phase2,minimag_phase2,N);
[V_abs_phase3,V_ang_phase3] = func_affine_result(maxreal_phase3,minreal_phase3,maximag_phase3,minimag_phase3,N);
figure;
subplot(321);
plot(V_abs_phase1(:,1),'b-s');
hold on;
plot(V_abs_phase1(:,2),'r-o');
hold on;
plot(mean(V_abs_phase1,2),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title(['A Phase']);
legend('down bands','up bands','certain trend');
disp('A相幅度值');
V_abs_phase1
subplot(322);
plot(V_ang_phase1(:,1),'b-s');
hold on;
plot(V_ang_phase1(:,2),'r-o');
hold on;
plot(mean(V_ang_phase1,2),'k');
hold off;
xlabel('节点数');
ylabel('相位值');
title(['A Phase']);
legend('down bands','up bands','certain trend');
disp('A相相位值');
V_ang_phase1
subplot(323);
plot(V_abs_phase2(:,1),'b-s');
hold on;
plot(V_abs_phase2(:,2),'r-o');
hold on;
plot(mean(V_abs_phase2,2),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title(['B Phase']);
legend('down bands','up bands','certain trend');
disp('B相幅度值');
V_abs_phase2
subplot(324);
plot(V_ang_phase2(:,1),'b-s');
hold on;
plot(V_ang_phase2(:,2),'r-o');
hold on;
plot(mean(V_ang_phase2,2),'k');
hold off;
xlabel('节点数');
ylabel('相位值');
title(['B Phase']);
legend('down bands','up bands','certain trend');
disp('B相相位值');
V_ang_phase2
subplot(325);
plot(V_abs_phase3(:,1),'b-s');
hold on;
plot(V_abs_phase3(:,2),'r-o');
hold on;
plot(mean(V_abs_phase3,2),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title(['C Phase']);
legend('down bands','up bands','certain trend');
disp('C相幅度值');
V_abs_phase3
subplot(326);
plot(V_ang_phase3(:,1),'b-s');
hold on;
plot(V_ang_phase3(:,2),'r-o');
hold on;
plot(mean(V_ang_phase3,2),'k');
hold off;
xlabel('节点数');
ylabel('相位值');
title(['C Phase']);
legend('down bands','up bands','certain trend');
disp('C相相位值');
V_ang_phase3
fprintf(' 节点 A幅值下限 A幅值上限 B幅值下限 B幅值上限 C幅值下限 C幅值上限 A幅角下限 A幅角上限 B幅角下限 B幅角上限 C幅角下限 C幅角上限');
RR = [[1:33]',V_abs_phase1,V_abs_phase2,V_abs_phase3,V_ang_phase1,V_ang_phase2,V_ang_phase3]
%是否加入分布式电源的对比
load func\No_DG.mat
figure;
r1 = [a,abs(U(:,2))];
bar(r1);
axis([0,34,0.9,1]);
legend('不加DG','加DG');
title('A Phase');
figure;
r2 = [b,abs(U(:,3))];
bar(r2);
axis([0,34,0.9,1]);
legend('不加DG','加DG');
title('B Phase');
figure;
r3 = [c,abs(U(:,4))];
bar(r3);
axis([0,34,0.9,1]);
legend('不加DG','加DG');
title('C Phase');
fprintf('网损');
DeltaSL*1000*P_base
02_021m
4.系统原理简介
当只采用区间运算,得到的结果则有可能过于保守,而采用仿射运算后,本文方法能够得到更窄的不确定区域,从而得到更窄的区间。从如下的三个方面角度考虑:
理想状态下的,确定性潮流计算------即对应本课题的"含分布式电源的配电网三相潮流算法"。
实际状态下,不确定性潮流计算,这里对应两个类型的算法:
a.基于区间算法的含分布式电源的配电网三相潮流算法,不过结果范围较大,过于保守。
b.基于仿射算法的含分布式电源的配电网三相潮流算法,其结果范围较小,效果较a更优。
我们将主要针对b算法进行编程。
传统的配电网中的节点类型一般是PQ节点,而加入分布式电源之后,会产生PV节点和PI节点,因此,在针对还有分布式电源的配电网进行潮流计算的时候,必须根据不同的节点类型采用不同的处理方法,但本质上就是在潮流计算的时候将各种类型的节点转换为潮流计算能够处理的PQ点或者PV点。
5.完整工程文件
v
v