资源预览内容
第1页 / 共22页
第2页 / 共22页
第3页 / 共22页
第4页 / 共22页
第5页 / 共22页
第6页 / 共22页
第7页 / 共22页
第8页 / 共22页
第9页 / 共22页
第10页 / 共22页
亲,该文档总共22页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
电力系统分析程序设计专业班级调;发电机G2的端电压为1 p.u.,按指定的有功P=0.5 p.u.发电,取 e =10-4OSB=100MVA要求计算所给系统的潮流,设发电机 G1的端电压为1 p.u.,发出的有功、无功可j0.1905j0.19051:1.05221:1.0522L10.02+jO.06j。05 0.025+j0.08X j0.05-, 0.18+j0.12 03+jO.1少 j0.05UB=Uav0.8055+j0.5320一牛顿拉夫逊法( 1) 程序代码clear;clc;%节点编号,5号为平衡节点,4号为PV节点,1、2、3号为PQ节点% 输入原始数据,求节点导纳矩阵y=0;y(1,1) = 1/(0.03+0.1i)+1/(0.025+0.08i)+0.09i+0.07i;y(1,2) = -1/(0.025+0.08i);y(1,3) = -1/(0.03+0.1i);y(2,1) = -1/(0.025+0.08i);y(2,2) = 1/(0.02+0.06i)+1/(0.025+0.08i)+0.05i+0.07i+1/1.0522A2*1/(0.1905i);y(2,3) = -1/(0.02+0.06i);y(2,4) = 4.9889i;y(3,1) = -1/(0.03+0.1i);y(3,2) = -1/(0.02+0.06i);y(3,3) = 7.7523-28.7757i;y(3,5) = 4.9889i;y(4,2) = 4.9889i;y(4,4) = -5.2493i;y(5,3) = 4.9889i;y(5,5) = -5.2493i;Y=y;%Y 为导纳矩阵display(导纳矩阵为:);YG=real(Y);B=imag(Y);% 原始节点功率Pg=zeros(1,5);Qg=zeros(1,5);Pd=zeros(1,5);Qd=zeros(1,5);S(1)=-0.8055-0.5320i;S(2)=-0.18-0.12i;S(3)=0;S(4)=0.5;S(5)=0;P=real(S);Q=imag(S);% 赋初值U = ones(1,5);a = zeros(1,5);dx=ones(7,1);fx=ones(7,1);count=0;%计算迭代次数while (max(fx)1e-4)%收敛判据for i=1:4for j=1:4H(i,j)=0;dP(i)=0;endendfor i=1:3for j=1:3L(i,j)=0;dQ(i)=0;endendfor i=1:4for j=1:3N(i,j)=0;endend for i=1:3for j=1:4K(i,j)=0;endend%P%失配功率表达式for i=1:4x=0;for j=1:5%dP(i)=dP(i)-U(i)*U(j)*(G(i,j)*cos(a(i)-a(j) + B(i,j)*sin(a(i)-a(j) );x=x+U(i)*U(j)*(G(i,j)*cos(a(i)-a(j)+B(i,j)*sin(a(i)-a(j);enddP(i)=P(i)-x;endfor i=1:3y=0;for j=1:5y=y+(U(i)*U(j)*(G(i,j)*sin(a(i)-a(j)-B(i,j)*cos(a(i)-a(j);enddQ(i)=Q(i)-y;endfx=dP,dQ;% 求雅克比矩阵% 当 i=j 时候求 H,N,K,L 如下:for i=1:4for j=1:5if i=jH(i,i)=H(i,i)+U(i)*U(j)*(G(i,j)*sin(a(i)-a(j)-B(i,j)*cos(a(i)-a(j) );endendendfor i=1:4for j=1:4if i=jH(i,j)=-U(i)*U(j)*(G(i,j)*sin(a(i)-a(j)-B(i,j)*cos(a(i)-a(j);endendendfor i=1:3x=0;for j=1:5if i=jx=x + (- (U(j)*( G(i,j)*cos(a(i)+a(j) + B(i,j)*sin(a(i)-a(j) ) );endN(i,i)=-2*U(i)*G(i,i)+x;end for i=1:4for j=1:3if i=jN(i,j)=-U(i)*( G(i, j)*cos(a(i)-a(j) + B(i,j)*sin(a(i)-a(j) );endendendfor i=1:3for j=1:5if i=jK(i,i)=K(i,i)-U(i)*U(j)*(G(i,j)*cos(a(i)-a(j) + B(i,j)*sin(a(i)-a(j) );endendendfor i=1:3for j=1:4if i=jK(i,j)=U(i)*U(j)*( G(i,j)*cos(a(i)-a(j) + B(i,j)*sin(a(i)-a(j) );endend for i=1:3x=0;for j=1:5if i=jx=x+(-( U(j)*(G(i,j)*sin(a(i)-a(j) - B(i,j)*cos(a(i)-a(j);endendL(i,i)=2*U(i)*B(i,i)+x;endfor i=1:3for j=1:3if i=jL(i,j)=-U(i)*( G(i,j)*sin(a(i)-a(j) - B(i,j)*cos(a(i)-a(j) );endendendJ=H,N;K,L;%J 为雅克比矩阵dx=-(inv(J)*fx);for i=1:4da(i)=dx(i);for i=1:3dU(i)=dx(i+4);endfor i=1:4a(i)=a(i)+da(i);endfor i=1:3U(i)=U(i)+dU(i);endcount=count+1;end% 求节点注入的净功率i=5;for j=1:5P(i)=P(i)+U(i)*U(j)*(G(i,j)*cos(a(i)-a(j)+B(i,j)*sin(a(i)-a(j);Q(i)=Q(i)+U(i)*U(j)*(G(i,j)*sin(a(i)-a(j)-B(i,j)*cos(a(i)-a(j);endS(5)=P(5)+Q(5)*sqrt(-1);if count=3display(最终结果为:);H,N,K,Ldisplay(雅可比矩阵如下:);Jdisp(/*/)disp(/*/)a./pi*180* fx,dx,U,adisplay( 迭代次数为 : );countdisplay。节点注入净功率如下:);S%求节点注入电流display(节电注入电流如下:);I=Ydisplay( 迭代次数为 : );count end运算结果如下:导纳矩阵为:-3.558T8.558T-5.0000 a ft6. 3110 -20.40221-3. 5587 +11.33791-2. 7523 + 瓦 17431 0 0最终结果为:H =-20.602111.389411.5923 -32.23989.395815.641905.0528N =-5.61273.84733.2930-8.72642.50655.04560-0.4914K =7.0121-3.9156-3.26619.0432-2.4861-5.1352+11.38791 -2.7523 + + 1743-3L 00931 -5.CO00 +15. 00001+15.0000i7.7523-28. 77571+ 4,9839100 + 4.SS80L00 + 4%8甑00 - 5*2493i000 +0C - 6.249319.2127015.59475.0528-30.118100-5.05283.02675.1580-8.0992 0-3.09650-5.2770-0.50018.11210-19.699511.19079.005011.6878 -31.442415.24319.473215.3690-29.4399雅可比矩阵如下:J =-20.60211 1. 3334D. 21270-5.61273. 64733 026711.5923-32.239815.59475.05283.2930-8.72045.15SO见 395815.41970, HS10W.50555.0456-8.03920S0S280-5,. 05280-0.491407.0121-3.9156-3. 05550-IS.599511. 19入 0050-3. 2则9. 0432-5.2770-0,. 500111.6S78-31.442415.2431-2,861-5.13528. 112109.473215.369口-29.4399*/ans =-7.4732-5.8532-5.5850-0.20060/* fx =*/-0.0017-0.002
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号