资源描述:
《实验一潮流计算》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、学院:电气工程学院专业班级:电气F1104姓名:马路林学号:201123910725潮流计算实验运行程序»%本程序的功能足用牛顿——拉夫逊法进行潮流计算%B1矩阵:1、支路首端号;2、末端号;3、支路阻抗;4、支路对地电纳%5、支路的变比;6、支路首端处于K侧为1,1侧为0%B2矩阵:1、该节点发电机功率;2、该节点负荷功率;3、节点电压初始值%4、PV节点电压V的给定值;5、节点所接的无功补偿设备的界暈%6、节点分类标号:1为平衡节点(应为1号节点);2为PQ节点;%3为PV节点;clear;n=10;nl=10;isb=l;pr=0.00001;Bl=[l2230.03
2、512+0.08306i0.13455i0.0068+0.18375i011.023810;1;140.05620+0.13289i0.05382i10;450.0081l+0.24549i01.023811;160.05620+0.13289i0.05382i10;460.04215+0.09967i0.04037i10;670.0068+0.18375i01.023811;680.02810+0.06645i0.10764i10;8100.0081l+0.24549i011;890.03512+0.08306i0.13455i10]B2=[001.11.101;0010
3、0200.343+0.21256i1002;00100200.204+0.12638i1002;00100200.306+0.18962i1002;0010020.501.11.103;00.343+0.21256i1002]Y=zeros(n);e=zeros(1,n);f=zeros(1,n);V=zeros(1,n);sida=zeros(l,n);Sl=zeros(nl);fori=l:nlifBl(i,6)=0p=Bl(i,l);q=Bl(i,2);elsep=Bl(i,2);q=Bl(i,l);endY(p,q)=Y(p,q)-l./(B1(i,3)*B1(i,
4、5));Y(q,p)=Y(p,q);Y(q,q)=Y(q,q)+l./(Bl(i,3)*Bl(i,5)八2)+B1(i,4)./2;Y(p,p)=Y(p,p)+1./B1(i,3)+B1(i,4)./2;enddispdisp(Y)%G=real(Y);B=imag(Y);fori=l:ne(i)=real(B2(i,3));f(i)=imag(B2(i,3));V(i)=B2(i,4);endfori=l:nS(i)=B2(i,l)-B2(i,2);B(i,i)=B(i,i)+B2(i,5);endP=real(S);Q=imag(S);ICTl=0;IT2=l;N0=2
5、*n;N=N0+l;a=0;whileIT2〜=0IT2=0;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