[Three-phase power flow] Three-phase power flow algorithm for distribution network with distributed power supply based on affine interval

1. Software version

matlab2021a

2. Theoretical knowledge of this algorithm

      When only interval operation is used, the result obtained may be too conservative, but after using affine operation, the method in this paper can obtain a narrower uncertainty region and thus a narrower interval.

    According to the requirements of this subject, " Three-phase power flow algorithm of distribution network with distributed power supply based on affine interval", the concept of this aspect is mainly considered from the following three aspects:

    In the ideal state, deterministic power flow calculation - that is, " three-phase power flow algorithm for distribution network with distributed power supply" corresponding to this topic.

    In the actual state, the uncertainty power flow calculation corresponds to two types of algorithms:

a. The three-phase power flow algorithm of the distribution network with distributed power based on the interval algorithm , but the result range is large and too conservative.

b. The three-phase power flow algorithm of the distribution network with distributed generation based on the affine algorithm has a smaller range of results, and the effect is better than a.

       The node type in the traditional distribution network is generally PQ nodes, and after adding distributed power sources, PV nodes and PI nodes will be generated. Different node types use different processing methods, but in essence, during power flow calculation, various types of nodes are converted into PQ points or PV points that can be processed by power flow calculation.

       As can be seen from the above table, it is essentially converted into the calculation of PQ and PV nodes. Therefore, in the final calculation, it is converted into the calculation of PQ and PV.

3. Core code

clc;
clear;
close all;
warning off;
addpath 'func\'

PI_injection                  = 1;
PQ_injection                  = 2;
PV_injection                  = 3;
PIQ_injection                 = 4;
PIV_injection                 = 5;
PQV_injection                 = 6;
PIVQ_injection                = 7;
SEL                           = PIQ_injection;

V_base                        = 7.3093;    %电压基准
P_base                        = 10;        %功率基准
eps                           = 1e-4;      %收敛精度,由于忽略纵向电压,精度不宜设置过高
Max_Iteration                 = 50;        %最大迭代次数
Z_base                        = V_base^2/P_base; 
I_base                        = P_base ./ V_base;
 
%33节点
[branch,bus,DG]               = func_IEEE33(SEL);
N                             = size(bus,1);    %节点数
b                             = size(branch,1); %支路数

global PQNum;
global nPQ;
global PQbus;
global PVNum;
global nPV;
global PVbus;
global PINum;
global nPI;
global PIbus;

%A、S、U分别存储支路、节点和电压数据
[A,S,U]                       = func_ASU(branch,bus,Z_base,P_base);

%DG节点加入,PQ、PV型分别处理
[S,X0,DGpath]                 = func_PVPQPI(A,DG,S,P_base,b);

%生成节点的关联矩阵 
[A0,DeltaU,Q,ZXinv,UDG]       = func_Incidence_matrix(A,S,N,b,DG,X0,DGpath);

%%%%%%%%%%%%%%%%%%%%%%这里参考了下你的那个函数,所以以上几个函数功能和你提供的那个相似,这里将仿射部分加在了func_affine_system.m函数中%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%这里参考了下你的那个函数,所以以上几个函数功能和你提供的那个相似,这里将仿射部分加在了func_affine_system.m函数中%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%这里参考了下你的那个函数,所以以上几个函数功能和你提供的那个相似,这里将仿射部分加在了func_affine_system.m函数中%%%%%%%%%%%%%%%%%%%%%


%开始迭代,加入仿射算法的不确定潮流分析过程
%开始迭代,加入仿射算法的不确定潮流分析过程
[A_infor,B_infor,C_infor,U,DeltaSL]    = func_affine_system(A,A0,U,S,DG,UDG,ZXinv,P_base,I_base,Q,DeltaU,Max_Iteration,N);
 



%基于仿射区间的,含分布式电源的配电网三相潮流算法
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]   = func_affine_result(maxreal_phase1,minreal_phase1,maximag_phase1,minimag_phase1,N);
[V_abs_phase2]   = func_affine_result(maxreal_phase2,minreal_phase2,maximag_phase2,minimag_phase2,N);
[V_abs_phase3]   = func_affine_result(maxreal_phase3,minreal_phase3,maximag_phase3,minimag_phase3,N);


 
 

if SEL == 1
   NAME = 'PI型DG注入';
end
if SEL == 2
   NAME = 'PQ型DG注入';
end
if SEL == 3
   NAME = 'PV型DG注入';
end
if SEL == 4
   NAME = 'PI PQ型DG注入';
end
if SEL == 5
   NAME = 'PIV型DG注入';
end
if SEL == 6
   NAME = 'PQ PV型DG注入';
end
if SEL == 7
   NAME = 'PI PQ PV型DG注入';
end


figure;
subplot(311);
plot(V_abs_phase1(:,1),'b-s');
hold on;
plot(V_abs_phase1(:,2),'r-o');
hold on;
plot(abs(U(:,2)),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title([NAME,'A Phase']);
legend('down bands','up bands','certain trend');
disp('A相幅度值');
V_abs_phase1


subplot(312);
plot(V_abs_phase2(:,1),'b-s');
hold on;
plot(V_abs_phase2(:,2),'r-o');
hold on;
plot(abs(U(:,3)),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title([NAME,'B Phase']);
legend('down bands','up bands','certain trend');
disp('B相幅度值');
V_abs_phase2





subplot(313);
plot(V_abs_phase3(:,1),'b-s');
hold on;
plot(V_abs_phase3(:,2),'r-o');
hold on;
plot(abs(U(:,4)),'k');
hold off;
xlabel('节点数');
ylabel('幅度值');
title([NAME,'C Phase']);
legend('down bands','up bands','certain trend');
disp('C相幅度值');
V_abs_phase3




fprintf('    节点      A幅值下限  A幅值上限 B幅值下限  B幅值上限 C幅值下限  C幅值上限');
RR = [[1:33]',V_abs_phase1,V_abs_phase2,V_abs_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


 4. Operation steps and simulation conclusion

 5. References

 A02-21

Guess you like

Origin blog.csdn.net/ccsss22/article/details/124418787