资源描述:
《潮流计算实验.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、电力系统分析实验报告实验一:潮流计算的计算机算法>>clear;n=10;nl=10;isb=1;pr=0.00001;B1=[120.03512+0.08306i0.13455i10;230.0068+0.18375i01.023811;140.05620+0.13289i0.05382i10;450.00811+0.24549i01.023811;160.05620+0.13289i0.05382i10;460.04215+0.09967i0.04037i10;670.0068+0.18375i01.023811;680.02810+0.06645i
2、0.10764i10;8100.00811+0.24549i011;890.03512+0.08306i0.13455i10]B2=[001.11.101;001002;00.343+0.21256i1002;001002;00.204+0.12638i1002;001002;00.306+0.18962i1002;001002;0.501.11.103;00.343+0.21256i1002]Y=zeros(n);e=zeros(1,n);f=zeros(1,n);V=zeros(1,n);sida=zeros(1,n);S1=zeros(nl);fo
3、ri=1:nlifB1(i,6)==0p=B1(i,1);q=B1(i,2);elsep=B1(i,2);q=B1(i,1);endY(p,q)=Y(p,q)-1./(B1(i,3)*B1(i,5));Y(q,p)=Y(p,q);Y(q,q)=Y(q,q)+1./(B1(i,3)*B1(i,5)^2)+B1(i,4)./2;Y(p,p)=Y(p,p)+1./B1(i,3)+B1(i,4)./2;enddisp('导纳矩阵Y=');disp(Y)%-------------------------------------------------------
4、---G=real(Y);B=imag(Y);fori=1:ne(i)=real(B2(i,3));f(i)=imag(B2(i,3));V(i)=B2(i,4);endfori=1:nS(i)=B2(i,1)-B2(i,2);B(i,i)=B(i,i)+B2(i,5);endP=real(S);Q=imag(S);ICT1=0;IT2=1;N0=2*n;N=N0+1;a=0;whileIT2~=0IT2=0;a=a+1;fori=1:nifi~=isbC(i)=0;D(i)=0;forj1=1:nC(i)=C(i)+G(i,j1)*e(j1)-B(i,
5、j1)*f(j1);%Σ(Gij*ej-Bij*fj)D(i)=D(i)+G(i,j1)*f(j1)+B(i,j1)*e(j1);%Σ(Gij*fj+Bij*ej)endP1=C(i)*e(i)+f(i)*D(i);Q1=C(i)*f(i)-e(i)*D(i);V2=e(i)^2+f(i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