资源简介

潮流计算14节点前推回代(附节点图),以打开文件方式运行,对应文件已给出。

资源截图

代码片段和文件信息


clc
clear
Bus=xlsread(‘bus.xlsx‘);
Branch=xlsread(‘branch.xlsx‘);
[busnum~]=size(Bus);
[branchnumrow]=size(Branch);
soubus=Branch(:2);
mobus=Branch(:3);
Vbus=ones(busnum1);
Vbus1=Vbus;
Ploss=zeros(busnum1);
Qloss=zeros(busnum1);
e=1;
i=1;
k=0;
Branch1=Branch;
n=1;
%% 精髓
%%%%%%%%%%%%%%%支路重新排序,各个分支线同时进行计算
while ~isempty(Branch1)%%%%T1为排好的支路矩阵。
    m=1;
    [srow]=size(Branch1);
        while s>0
            t=find(Branch1(:2)== Branch1(s3));%判断是否是叶子节点
                if isempty(t)%空,则是叶子节点
                    T1(n:)= Branch1(s:);
                    %将叶子节点放入T1中,
                    %且从节点系统末端向首端进行;
                    %第二次由于Branch1排序问题从首端向末端,无差别,因为同事进行
                    n=n+1;
                else
                    T2(m:)= Branch1(s:);%非叶子节点
                     m=m+1;
                end
               s=s-1;
        end
        Branch1=T2;
        T2=[];
end
%% 
%%%%%%%%%%%%%%%%%%%%%%%
while e>1.0e-07%%%%收敛条件是精度
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %前推功率
    %从末端向首端推
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    P=zeros(busnum1);%%存放后续功率情况
    Q=zeros(busnum1);
        for s=1:branchnum
                i=T1(s2);
                j=T1(s3);
                R=T1(s4);
                X=T1(s5);
                %按尾节点读取Bus数据
                Pload=Bus(j2);
                Qload=Bus(j3);
                II=((Pload+P(j))^2+(Qload+Q(j))^2)/(Vbus(j)^2*1000);
                Ploss(ij)=II*R;
                Qloss(ij)=II*X;
                P(ij)=Pload+Ploss(ij)+P(j);
                Q(ij)=Qload+Qloss(ij)+Q(j);
                P(i)=P(i)+P(ij);
                Q(i)=Q(i)+Q(ij);
        end
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %后推电压
    %从首端向末端推
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
         for s=branchnum:-1:1
                i=T1(s2); 
                j=T1(s3);%存储推导电压的顺序
                R=T1(s4);
                X=T1(s5);
                Vbus(j)=(Vbus(i)-(P(ij)*R+Q(ij)*X)/(Vbus(i)*1000))^2+((P(ij)*X-Q(ij)*R)/(Vbus(i)*1000))^2;
                Vbus(j)=sqrt(Vbus(j));
         end
    e=max(abs(Vbus1-Vbus));%精度收敛条件
    Vbus1=Vbus;
   k=k+1;
end


for i=1:14
    A(i)=i;
end
A=A‘;
plot(AVbus1‘linewidth‘1.5);
xlswrite(‘OutPower.xlsx‘P);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       37637  2019-04-04 20:00  14节点配电网络.docx
     文件        9572  2019-04-09 22:23  branch.xlsx
     文件        9173  2019-04-09 22:06  bus.xlsx
     文件        2446  2019-04-09 22:21  FourteenPoint.m

评论

共有 条评论