《九节点系统潮流计算编程牛N_R法》由会员分享,可在线阅读,更多相关《九节点系统潮流计算编程牛N_R法(9页珍藏版)》请在金锄头文库上搜索。
1、GEX2-230STXA-230t-STNB-230;ri如图所示系统,试计算潮流分布,相关数据见PSASP7.0版潮流计算用户手册P121。GEN3-230GENl-230TTJLJLJLJ丄UUD、丄JLJLCIUL丄丄丄XfloatdivRe(floatb1,floatb2,floatb3,floatb4)floata1r;a1r=(b1*b3+b2*b4)/(b3*b3+b4*b4);return(a1r);floatdivIm(floatb1,floatb2,floatb3,floatb4)floata1i;a1i=(b2*b3-b1*b4)/(b3*b3+b4*b4);return
2、(a1i);floatmulRe(floatb1,floatb2,floatb3,floatb4)floata2r;a2r=b1*b3-b2*b4;return(a2r);floatmulIm(floatb1,floatb2,floatb3,floatb4)floata2i;a2i=b2*b3+b1*b4;return(a2i);floatMax(floata,intn)inti;floatmax;max=fabs(a0);for(i=1;imax)max=fabs(ai);return(max);voidmain()inti,j,k,h,km;intT=16;floateps,sumpi1,
3、sumpi2,sumqi1,sumqi2,max,sumir,sumii,I1r,I1i,t,xx,xxx;floatpi08,qi08,detpi8,detqi8,Iir08,Iii08,J01616,detsi16,detui16,delta_p99,delta_q99,a1632,ni1616,H88,N88,J88,L88,ei19,fi19,sp99,sq99;staticfloatybr99=3.3074,-1.3652,0,0,0,-1.9422,0,0,0,-1.3652,2.5528,-1.1876,0,0,0,0,0,0,0,-1.1876,2.8047,-1.6171,0
4、,0,0,0,0,0,0,-1.6171,2.7722,-1.1551,0,0,0,0,0,0,0,-1.1551,2.437,-1.282,0,0,0,-1.9422,0,0,0,-1.282,3.2242,0,0,0,0,0,0;staticfloatybi99=-39.3089,11.6041,0,0,0,10.5107,0,0,17.3611,11.6041,-17.3382,5.9751,0,0,0,0,0,0,0,5.9751,-35.4456,13.6980,0,0,16,0,0,0,0,13.6980,-23.3033,9.7843,0,0,0,0,0,0,0,9.782,-3
5、2.1538,5.5882,0,17.0648,0,10.5107,0,0,0,5.5882,-15.841,0,0,0,0,0,16,0,0,0,-16,0,0,0,0,0,0,17.0648,0,0,-17.0648,0,17.3611,0,0,0,0,0,0,0,-17.3611;staticfloatyd99=0,0.088,0,0,0,0.079,0,0,0,0.088,0,0.153,0,0,0,0,0,0,0,0.153,0,0.0745,0,0,0,0,0,0,0,0.0745,0,0.1045,0,0,0,0,0,0,0,0.1045,0,0.179,0,0,0,0.079,
6、0,0,0,0.179,0,0,0,0,0,0,0;floatei09=1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.04;floatfi09=0.0;floatpi9=0,-1.25,0,-1.0,0,-0.9,1.63,0.85,0;floatqi9=0,-0.5,0,-0.35,0,-0.3,0,0,0;h=0;km=15;eps=0.00001;doh+=1;printf(nNowThe%dthtimesn,h);for(i=0;i8;i+)printf(ei0%d=%ft,i,ei0i);printf(fi0%d=%ft,i,fi0i);for(i=0;i8;i
7、+)printf(pi%d=%ft,i,pii);printf(qi%d=%ft,i,qii);sumpi2=0;sumqi2=0;for(i=0;i8;i+)for(j=0;j9;j+)sumpi1=(ei0i*(ybrij*ei0j-ybiij*fi0j)+fi0i*(ybrij*fi0j+ybiij*ei0j);sumpi2+=sumpi1;pi0i=sumpi2;printf(pi0%d=%ft,i,pi0i);sumpi2=0;for(i=0;i8;i+)for(j=0;j9;j+)sumqi1=(fi0i*(ybrij*ei0j-ybiij*fi0j)-ei0i*(ybrij*fi
8、0j+ybiij*ei0j);sumqi2+=sumqi1;qi0i=sumqi2;printf(qi0%d=%ft,i,qi0i);sumqi2=0;for(i=0;i8;i+)detpii=pii-pi0i;detqii=qii-qi0i;if(i=6|i=7)qi0i=ei0i*ei0i+fi0i*fi0i;detqii=1.051-qi0i;printf(detpi%d=%ft,i,detpii);printf(detqi%d=%ft,i,detqii);TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx/节点的注入电流表达式for(i=0;i8;i+)I
9、ii0i=0;Iir0i=0;for(i=0;i8;i+)for(j=0;j9;j+)Iir0i+=ybrij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