资源描述:
《前推回代潮流计算程序.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、functionFlow1(Z,S,Sb,Vb)%Z各支路阻抗%S各节点运算负荷%Sb基准功率%Zb基准阻抗%Flow(Z,S,Sb,Vb)计算网络功率及电压分布%输出收敛迭代次数及功率分布和电压分布%数据初始化Z(:,1)=Z(:,1)+1;Z1=[1,0,1,0];Z=[Z1;Z];%使得支路编号与支路末点编号一致[m,n]=size(Z);Zb=(Vb^2)/Sb*1000;Z(:,4)=Z(:,4)/Zb;S(:,2)=S(:,2)/Sb;k=1;V=ones(m,1);dU=ones(m,1);%前推回代n=0;whilemax(abs(dU))
2、>10^-4Sr=S(:,2);V1=V;fori=m:-1:1%前推功率A=(find(Z(:,2)==i));%求以i节点为始点的各支路[b,c]=size(A);ifb~=0forj=1:1:b%求以当前节点为始点的各支路功率总和N=A(j,1);ifN~=6dSr=((abs(Sr(N,1))/V(N,1))^2)*Z(N,4);%各支路功率损耗elsedSr=0;endSr(N,2)=Sr(N,1)+dSr;%N支路功率Sr(i,1)=Sr(i,1)+Sr(N,2);endelseSr(i,2)=Sr(i,1);endendV(1,1)=1;fo
3、rt=2:m%回代电压ift~=6a=Z(t,2);%由于是辐射型网络,只有一个始点dV1=(real(Sr(t,2))*real(Z(t,4))+imag(Sr(t,2))*imag(Z(t,4)))/V(a,1);dV2=(real(Sr(t,2))*imag(Z(t,4))-imag(Sr(t,2))*real(Z(t,4)))/V(a,1);V(t,1)=((V(a,1)-dV1)^2+dV2^2)^0.5;elsedk=k*(V(5,1)/V1(5,1)-1)k=k-dkifk>=1.1k=1.1;elseifk<=0.9k=0.9;else%k
4、=vpa(k,3);k=round(k*100)/100endkV(6,1)=k*V(5,1);endenddU=V-V1;n=n+1;ifn>15fprintf('迭代15次不收!');break;endend%输出a=1:1:m;%编号fprintf('迭代收敛次数为:');nfprintf('网络功率分布为:');Sr(:,2)=Sr(:,2)*Sb;Sr=[a',Sr]fprintf('网络电压分布为:');%V=V*Vb;V=[a',V]clcclearall;Z2=[1,1,2,1.197+j*0.82;2,2,3,1.796+
5、j*1.231;3,3,4,1.306+j*0.895;4,4,5,1.851+j*1.268;5,5,6,1.524+j*1.044;6,6,7,1.905+j*1.305;7,7,8,1.197+j*0.82;8,8,9,0.653+j*0.447;9,9,10,1.143+j*0.783;10,4,11,2.823+j*1.172;11,11,12,1.184+j*0.491;12,12,13,1.002+j*0.416;13,13,14,0.455+j*0.189;14,14,15,0.546+j*0.227;15,5,16,2.55+j*1.05
6、8;16,6,17,1.366+j*0.567;17,17,18,0.819+j*0.34;18,18,19,1.548+j*0.642;19,19,20,1.368+j*0.567;20,20,21,3.552+j*1.474;21,7,22,1.548+j*0.642;22,22,23,1.092+j*0.453;23,23,24,0.91+j*0.378;24,24,25,0.455+j*0.189;25,25,26,0.364+j*0.151;26,8,27,1.002+j*0.417;27,27,28,4.403+j*1.215;];S2=[1,
7、0;2,35.28;3,14;4,35.28;5,14;6,35.28;7,35.28;8,35.28;9,14;10,14;11,56;12,35.28;13,35.28;14,14;15,35.28;16,35.28;17,8.96;18,8.96;19,35.28;20,35.28;21,14;22,35.28;23,8.96;24,5625,8.96;26,35.28;27,35.28;28,35.28;];%28nodesdataJ=[5.441,2.946,2.946;2.946,8.848,5.258;2.946,5.258,8.376;];
8、c=0.7;Vb=10.5;Sb=100;Z2(:,4)=Z2(: