1班级:姓名:学号:一、作业要求编写程序计算图1所示算例系统的潮流及三相短路电流。潮流计算:方法不限,计算系统的节点电压和相角。短路电流:4号母线发生金属性三相短路时(zf=0),分别按照精确算法和近似算法计算短路电流、系统中各节点电压以及网络中各支路的电流分布,并对两种情况下的计算结果进行比较。二、电路图及参数29836415(3)f7图13机9节点系统表19节点系统支路参数支路R(p.u.)X(p.u.)B/2(TK)(p.u.)1~400.05761.02~700.06251.03~900.05861.04~50.010.0850.0884~60.0170.0920.0795~70.0320.1610.1536~90.0390.170.1797~80.00850.0720.07458~90.01190.10080.10452表29节点系统发电机参数发电机编号节点类型PG(p.u.)VG(p.u.)dx(p.u.)E(p.u.)1平衡1.040.31.1372PV1.631.0250.31.2113PV0.851.0250.31.043表39节点系统负荷参数节点编号节点类型Pi(p.u.)Qi(p.u.)4PQ005PQ1.250.56PQ0.90.37PQ008PQ10.359PQ00三、计算步骤(1)进行系统正常运行状态的潮流计算,求得(0)iU(2)形成不含发电机和负荷的节点导纳矩阵YN;(3)将发电机表示为电流源iI(/idiEjx)和导纳iy(1/dijx)的并联组合;节点负荷用恒阻抗的接地支路表示;形成包括所有发电机支路和负荷支路的节点导纳矩阵Y,即在YN中的发电机节点和负荷节点的自导纳上分别增加发电机导纳iy和负荷导纳,LDiy(*,,22LDiLDiLDiLDiiiSPjQyVV);(4)利用1ZY,计算节点阻抗矩阵,从而得到阻抗矩阵中的第f列;(5)利用公式(6-7)或(6-10)计算短路电流;3(6)利用公式(6-8)或(6-11)计算系统中各节点电压;(7)利用公式(6-9)计算变压器支路的电流;对输电线路利用П型等值电路计算支路电流。四、计算结果节点导纳矩阵Yn:Columns1through50-17.3611i000+17.3611i000-16.0000i000000-17.0648i000+17.3611i003.3074-39.3089i-1.3652+11.6041i000-1.3652+11.6041i2.5528-17.3382i000-1.9422+10.5107i000+16.0000i00-1.1876+5.9751i00000000+17.0648i00Columns6through9000000+16.0000i000000+17.0648i-1.9422+10.5107i0000-1.1876+5.9751i003.2242-15.8409i00-1.2820+5.5882i02.8047-35.4456i-1.6171+13.6980i00-1.6171+13.6980i2.7722-23.3032i-1.1551+9.7843i-1.2820+5.5882i0-1.1551+9.7843i2.4371-32.1539i电压幅值:1.04001.02501.02501.02580.99561.01271.02581.01591.0324电压相角:00.16200.0814-0.0387-0.0696-0.06440.06490.01270.0343节点有功:0.71641.63000.85000.0000-1.2500-0.9000-0.0000-1.0000-0.0000节点无功:0.27050.0665-0.10860.0000-0.5000-0.3000-0.0000-0.3500-0.0000修正后的节点导纳矩阵Y:Columns1through540-20.6944i000+17.3611i000-19.3333i000000-20.3982i000+17.3611i003.3074-39.3089i-1.3652+11.6041i000-1.3652+11.6041i3.8716-17.6627i000-1.9422+10.5107i000+16.0000i00-1.1876+5.9751i00000000+17.0648i00Columns6through9000000+16.0000i000000+17.0648i-1.9422+10.5107i0000-1.1876+5.9751i004.1321-16.0184i00-1.2820+5.5882i02.8047-35.4456i-1.6171+13.6980i00-1.6171+13.6980i3.7323-23.6669i-1.1551+9.7843i-1.2820+5.5882i0-1.1551+9.7843i2.4371-32.1539i节点阻抗矩阵Z的第4列:0.0463+0.1252i0.0329+0.0693i0.0316+0.0707i0.0552+0.1493i0.0589+0.1204i0.0562+0.1226i0.0397+0.0838i0.0416+0.0814i0.0378+0.0845i精确计算结果:短路电流:模值:6.4459相角:-71.9365节点电压模值:0.18310.56870.54270.00000.14660.15060.45370.44630.44955支路电流:ijIij140.5779-3.1264i271.3702-1.4433i390.64294-1.4808i45-0.77968+1.5248i46-0.6411+1.477i57-0.89528+1.6436i69-0.73353+1.5487i780.50734+0.10234i890.062766+0.056451i近似计算结果:短路电流:模值:6.2838相角:-69.7198节点电压模值:0.16110.52140.51570.00000.18270.16750.42270.43480.42176五、程序流程图YNNY结束输出结果计算潮流分布输出潮流不收敛信息k←k+1kKmax?Max|fi(x[k])|ɛ?求解修正方程获得∆x[k]x[k+1]←x[k]+∆x[k]计算节点导纳矩阵参数设置节点电压初值x[0]设置k←0及最大迭代次数Kmax计算f(x[k])及雅克比矩阵开始输入电网及节点注入数据7六、程序及输入文件input_data.xls文件:Sheet19节点系统支路参数首节点编号i尾节点编号jR(p.u.)X(p.u.)B/2(p.u.)1400.057602700.062503900.05860450.010.0850.088460.0170.0920.079570.0320.1610.153690.0390.170.179780.00850.0720.0745890.01190.10080.1045Sheet29节点系统发电机及负荷参数节点编号节点类型P(p.u.)Q(p.u.)U(p.u.)Xd(p.u.)E(p.u.)1平衡1.040.31.1372PV1.631.0250.31.2113PV0.851.0250.31.0434PQ005PQ-1.25-0.56PQ-0.9-0.37PQ008PQ-1-0.359PQ00powerflow_cal.m文件:l=9;%支路数n=9;%节点数m=6;%PQ节点数Yn=zeros(n);%初始化节点导纳矩阵YDATA1=xlsread('input_data.xls',1);%计算节点导纳矩阵Yfork=1:li=DATA1(k,1);j=DATA1(k,2);R=DATA1(k,3);X=DATA1(k,4);B2=DATA1(k,5);Yn(i,i)=Yn(i,i)+1i*B2+1/(R+1i*X);Yn(j,j)=Yn(j,j)+1i*B2+1/(R+1i*X);Yn(i,j)=Yn(i,j)-1/(R+1i*X);Yn(j,i)=Yn(j,i)-1/(R+1i*X);8enddisp('节点导纳矩阵Yn:');disp(Yn);G=real(Yn);B=imag(Yn);DATA2=xlsread('input_data.xls',2);P=zeros(1,n);Q=zeros(1,n);U=ones(1,n);P(2:n)=DATA2(2:n,3);Q(4:n)=DATA2(4:n,4);U(1:3)=DATA2(1:3,5);%设置节点电压初值e(1)=DATA2(1,5);e(2:n)=1.0;f(1:n)=0.0;%设置迭代次数t=0;tmax=10;whilet=tmax%计算f(x)a(1:n)=0.0;c(1:n)=0.0;fori=2:nforj=1:na(i)=a(i)+G(i,j)*e(j)-B(i,j)*f(j);c(i)=c(i)+G(i,j)*f(j)+B(i,j)*e(j);endendfori=2:ndeltaP(i)=P(i)-e(i)*a(i)-f(i)*c(i);endforj=4:ndeltaQ(j)=Q(j)-f(j)*a(j)+e(j)*c(j);endfork=2:3deltaU2(k)=U(k)*U(k)-e(k)*e(k)-f(k)*f(k);endfx=[deltaP(2:n)deltaQ(4:n)deltaU2(2:3)]';%计算雅克比矩阵Jfori=2:nforj=2:nifi~=jH(i,j)=-(G(i,j)*e(i)+B(i,j)*f(i));9N(i,j)=B(i,j)*e(i)-G(i,j)*f(i);elseH(i,j)=-a(i)-(G(i,i)*e(i)+B(i,i)*f(i));N(i,j)=-c(i)+(B(i,i)*e(i)-G(i,i)*f(i));endendendfori=4:nforj=2:nifi~=jM(i,j)=B(i,j)*e(i)-G(i,j)*f(i);L(i,j)=G(i,j)*e(i)+B(i,j)*f(i);elseM(i,j)=c(i)+(B(i,i)*e(i)-G(i,i)*f(i));L(i,j)=-a(i)+(G(i,i)*e(i)+B(i,i)*f(i));endendendfori=2:3forj=2:nifi~=jR(i,j)=0;S(i,j)=0;elseR(i,j)=-2*e(i);S(i,j)=-2*f(i);endendendJ=[H(2:n,2:n)N(2:n,2:n);M(4:n,2:n)L(4:n,2:n);R(2:3,2:n)S(2:3,2:n)];ifmax(abs(fx))0.0001%输出结果break;else%求解修正方程获得dxdx=-J^(-1)*fx;dx=dx';e(2:n)=e(2:n)+dx(1:n-1);f(2:n)=f(2:n)+dx(n:2*(n-1));t=t+1;endendifttmax10str='潮流计算不收敛';disp(str);elsea(1:n)=0.0;c(1:n)=0.0;fori=1:nforj=1:na(i)=a(i)+G(i,j)*e(j)-B(i,j)*f(j);c(i)=c(i)+G(i,j)*f(j)+B(i,j)*e(j);endendfori=1:nU(i)=e(i)+1i*f(i);amp(i)=abs(U(i));arg(i)=angle(U(i));P(i)=e(i)*a(i)+f(i)*c(i);Q(i)=f(i)*a(i)-e(i)*c(i);enddisp('电压幅值:');disp(amp);disp('电压相角:');disp(arg);disp('节点有功:');disp(P);disp('节点无功:');disp(Q);end%计算短路电流f=4;z