潮流上機課程設計報告.華電_第1頁
潮流上機課程設計報告.華電_第2頁
潮流上機課程設計報告.華電_第3頁
潮流上機課程設計報告.華電_第4頁
潮流上機課程設計報告.華電_第5頁
已閱讀5頁,還剩8頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、電力系統(tǒng)潮流上機課程設計報告院系班級:學號:學生姓名:指導教師:設計周數(shù)成績:日期:年月日一、課程設計的目的與要求培養(yǎng)學生的電力系統(tǒng)潮流計算機編程能力,掌握計算機潮流計算的相關知識二、設計正文(詳細內(nèi)容見附錄)1.手算: 要求應用牛頓-拉夫遜法或P-Q分解法手算求解,要求精度為0.001MW。節(jié)點1為平衡節(jié)點,電壓,節(jié)點2為PQ節(jié)點,負荷功率,節(jié)點3是PV節(jié)點,兩條支路分別為,對地支路。2.計算機計算:編寫潮流計算程序,要求如下:2.1據(jù)給定的潮流計算任務書整理潮流計算的基礎數(shù)據(jù):節(jié)點的分類,線路模型,等值變壓器模型,電壓等級的歸算,標幺值的計算;2.2基礎數(shù)據(jù)的計算機存儲:節(jié)點數(shù)據(jù),支路數(shù)據(jù)

2、(包括變壓器);2.3用牛頓-拉夫遜法計算;2.4根據(jù)所選潮流計算方法畫流程圖,劃分出功能模塊,有數(shù)據(jù)輸入模塊,導納陣形成模塊,解線性方程組模塊,計算不平衡功率模塊,形成雅可比矩陣模塊,解修正方程模塊,計算線路潮流,網(wǎng)損,PV節(jié)點無功功率和平衡節(jié)點功率,數(shù)據(jù)輸出模塊;2.5據(jù)上述模塊編制程序并上機調(diào)試程序,得出潮流計算結果;2.6源程序及其程序中的符號說明集、程序流圖簡單系統(tǒng)如下圖所示,支路數(shù)據(jù)如下:,節(jié)點數(shù)據(jù)如下:,1)節(jié)點導納陣#include #include #include #include LF.h/form node conductance matrixintMakeY( int

3、nB, intnL, Line* sL, double* YG, double* YB )inti,j,l;double r,x,d1,g,b,t;for(i=0;inB;i+)for(j=0;jnB;j+)YGij=0.0;YBij=0.0;for(i=0;inL;i+)r=sLi.R;x=sLi.X;g=r/(r*r+x*x);b=-x/(r*r+x*x);switch(sLi.Type)case 1:/Linebreak;case 2:/Transformerg*=1/sLi.K;b*=1/sLi.K;break;YGsLi.NumIsLi.NumI+=g;YGsLi.NumJsLi.N

4、umJ+=g;YGsLi.NumIsLi.NumJ-=g;YGsLi.NumJsLi.NumI-=g;YBsLi.NumIsLi.NumI+=b+sLi.B;YBsLi.NumJsLi.NumJ+=b+sLi.B;YBsLi.NumIsLi.NumJ-=b;YBsLi.NumJsLi.NumI-=b;printf(實部:n);for(i=0;inB;i+)for(j=0;jnB;j+)printf(%lft,YGij);printf(n);printf(虛部:n);for(i=0;inB;i+)for(j=0;jnB;j+)printf(%lft,YBij);printf(n);/* Chec

5、k the Y matrix */ofstreamfout(out.txt);fout -Y Matrix- endl;for(i=0;inB;i+)for(j=0;jnB;j+)fout YGij +j YBij t;foutendl;fout.close();return 0;2)計算功率不平衡量#include #include #include #include LF.h/form delta p and delta qintCalDeltaPQ( intnpv, intnpq, Bus* bus, double* YG, double* YB, int* p_Jtobus, doub

6、le* deltaf )intk,i,j;for(k=0;knpv+npq*2;k+) i=p_Jtobusk;if(knpv) deltafk=busi.GenP-busi.LoadP;for(j=0;jnpv+npq+1;j+)deltafk-=busi.Volt*busj.Volt*(YGij*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);printf(PV節(jié)點%d的有功功率是%lfn,i,deltafk);if(k=npv) deltafk=busi.GenP-busi.LoadP;for(j=0;jnpv+npq

7、+1;j+) deltafk-=busi.Volt*busj.Volt*(YGij*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);printf(PQ節(jié)點%d的有功功率是%lfn,i,deltafk);if(k=npv+npq)deltafk=busi.GenQ-busi.LoadQ;for(j=0;jnpv+npq+1;j+) deltafk-=busi.Volt*busj.Volt*(YGij*sin(busi.Phase-busj.Phase)-YBij*cos(busi.Phase-busj.Phase);print

8、f(PQ節(jié)點%d的無功功率是 %lfn,i,deltafk);return 0;3)雅各比矩陣的計算/*Purpose: for undergraduate courseTask: Load FlowCopyright NCEPU, Liu Chongru*/#include #include #include #include LF.h/form Jacobian matrixintFormJacobian( intnpv, intnpq, Bus* bus, double* YG, double* YB, int* p_Jtobus, double* Jac )intnp = npv+np

9、q,j,k,i,m;/TODOdouble a14,q14;for(k=0;knpv+npq*2;k+) i=p_Jtobusk;ai=0; qi=0;if(knp)/H Nfor(j=0;jnp+1;j+)if(j!=i) ai+=busj.Volt*(YGij*sin(busi.Phase-busj.Phase)-YBij*cos(busi.Phase-busj.Phase); qi+=busj.Volt*(YGij*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);for(m=0;mnpv+npq*2;m+)j=p_Jt

10、obusm;if(j!=i) if(mnp) Jackm=busi.Volt*busj.Volt*(YGij*sin(busi.Phase-busj.Phase)-YBij*cos(busi.Phase-busj.Phase);/Form H else Jackm=busi.Volt*busj.Volt*(YGij*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);/Form Nelse if(j=i)if(mnp)Jackm=-busi.Volt*ai;/Form H else Jackm=busi.Volt*qi+2*bu

11、si.Volt*busi.Volt*YGij;/Form Nelsefor(j=0;jnp+1;j+)if(j!=i) ai+=busj.Volt*(YGij*sin(busi.Phase-busj.Phase)-YBij*cos(busi.Phase-busj.Phase); qi+=busj.Volt*(YGij*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);for(m=0;mnpv+npq*2;m+)j=p_Jtobusm;if(j!=i)if(mnp) Jackm=-busi.Volt*busj.Volt*(YGi

12、j*cos(busi.Phase-busj.Phase)+YBij*sin(busi.Phase-busj.Phase);/Form JelseJackm=busi.Volt*busj.Volt*(YGij*sin(busi.Phase-busj.Phase)-YBij*cos(busi.Phase-busj.Phase);/Form Lelse if(j=i) if(mnp)Jackm=busi.Volt*qi;elseJackm=busi.Volt*ai-2*busi.Volt*busi.Volt*YBij;for(i=0;inp+npq;i+)for(int j=0;jnp+npq;j+

13、)printf(%d %d %f ,i,j,Jacij);printf(n);/Output the matrix to check the Jacobian matrixofstreamfout(out.txt,ios:app);fout -Jacobian Matrix- endl;for(i=0; inp+npq;i+ )for(j=0; jnp+npq; j+ )foutJacij t;foutendl;fout.close();return 0;4)線路損耗/8.calculate the power flow double* p_Pij, *p_Qij, *p_Pji, *p_Qj

14、i;p_Pij = new doublenL;p_Qij = new doublenL;p_Pji = new doublenL;p_Qji = new doublenL;int x1,x2;for( i=0; inL; i+ )x1=linei.NumI;x2=linei.NumJ;if(linei.Type=1)p_Piji=busx1.Volt*busx1.Volt*(-YGx1x2)-busx1.Volt*busx2.Volt*(-YGx1x2)*cos(busx1.Phase-busx2.Phase)+(-YBx1x2)*sin(busx1.Phase-busx2.Phase);p_

15、Qiji=-busx1.Volt*busx1.Volt*(linei.B+(-YBx1x2)-busx1.Volt*busx2.Volt*(-YGx1x2)*sin(busx1.Phase-busx2.Phase)-(-YBx1x2)*cos(busx1.Phase-busx2.Phase); p_Pjii=busx2.Volt*busx2.Volt*(-YGx2x1)-busx2.Volt*busx1.Volt*(-YGx2x1)*cos(busx2.Phase-busx1.Phase)+(-YBx2x1)*sin(busx2.Phase-busx1.Phase);p_Qjii=-busx2

16、.Volt*busx2.Volt*(linei.B+(-YBx2x1)-busx2.Volt*busx1.Volt*(-YGx2x1)*sin(busx2.Phase-busx1.Phase)-(-YBx2x1)*cos(busx2.Phase-busx1.Phase);elsep_Piji=busx1.Volt*busx1.Volt*(-YGx1x2)/linei.K-busx1.Volt*busx2.Volt*(-YGx1x2)*cos(busx1.Phase-busx2.Phase)+(-YBx1x2)*sin(busx1.Phase-busx2.Phase); p_Qiji=-busx

17、1.Volt*busx1.Volt*(-YBx1x2)/linei.K+linei.B)-busx1.Volt*busx2.Volt*(-YGx1x2)*sin(busx1.Phase-busx2.Phase)-(-YBx1x2)*cos(busx1.Phase-busx2.Phase); p_Pjii=busx2.Volt*busx2.Volt*(-YGx2x1*linei.K)-busx2.Volt*busx1.Volt*(-YGx2x1)*cos(busx2.Phase-busx1.Phase)+(-YBx2x1)*sin(busx2.Phase-busx1.Phase); p_Qjii

18、=-busx2.Volt*busx2.Volt*(-YBx2x1)*linei.K+linei.B)-busx2.Volt*busx1.Volt*(-YGx2x1)*sin(busx2.Phase-busx1.Phase)-(-YBx2x1)*cos(busx2.Phase-busx1.Phase);/p and q of PH bus and PV busint s=0;double p9,q9,Ps9,Qs9,PS=0,QS=0;for( i=0; inB; i+ )pi=0;qi=0;for(int j=0; jnB; j+ )pi+=(busj.Volt*(YGij)*cos(busj

19、.Phase)-busj.Volt*(YBij)*sin(busj.Phase); qi-=(busj.Volt*(YGij)*sin(busj.Phase)+busj.Volt*(YBij)*cos(busj.Phase); Psi=busi.Volt*cos(busi.Phase)*pi-busi.Volt*sin(busi.Phase)*qi; Qsi=busi.Volt*cos(busi.Phase)*qi+busi.Volt*sin(busi.Phase)*pi;for(i=0;inB;i+)PS+=Psi;QS+=Qsi;printf(PS=%7.7f,QS=%7.7fn,PS,Q

20、S);/lossdoublePloss=0, Qloss=0;for( i=0; in?計算雅客比矩陣各元素增加迭代次數(shù)k=k+1增加節(jié)點號i=i+1解修正方程,由及雅客比矩陣用高斯法求各節(jié)點的電壓增量計算節(jié)點的新電壓求出迭代是否收斂停止計算平衡節(jié)點的功率及線路功率6)得到的數(shù)據(jù)(out.txt)-Y Matrix-0+j-17.36110+j00+j00+j17.36110+j00+j00+j00+j00+j00+j00+j-160+j00+j00+j00+j00+j160+j00+j00+j00+j00+j-17.06480+j00+j00+j00+j00+j00+j17.06480+j1

21、7.36110+j00+j03.30738+j-39.3089-1.36519+j11.6041-1.94219+j10.51070+j00+j00+j00+j00+j00+j0-1.36519+j11.60412.55279+j-17.33820+j0-1.1876+j5.975130+j00+j00+j00+j00+j0-1.94219+j10.51070+j03.2242+j-15.84090+j00+j0-1.28201+j5.588240+j00+j160+j00+j0-1.1876+j5.975130+j02.80473+j-35.4456-1.61712+j13.6980+j00

22、+j00+j00+j00+j00+j00+j0-1.61712+j13.6982.77221+j-23.3032-1.15509+j9.784270+j00+j00+j17.06480+j00+j0-1.28201+j5.588240+j0-1.15509+j9.784272.4371+j-32.1539-Jacobian Matrix-16.40000-16.400000000017.491500000-17.49150000000040.1703-11.6041-10.51070003.30738-1.36519-1.9421900000-11.604117.57920-5.9751300

23、-1.365192.552790-1.18760000-10.5107016.098900-5.58824-1.9421903.224200-1.28201-16.400-5.97513036.0731-13.69800-1.187602.80473-1.61712000000-13.69823.4822-9.78427000-1.617122.77221-1.155090-17.491500-5.588240-9.7842732.86400-1.282010-1.155092.437100-3.307381.365191.9421900038.4474-11.6041-10.51070000

24、01.36519-2.5527901.187600-11.604117.09720-5.9751300001.942190-3.2242001.28201-10.5107015.582900-5.588240001.18760-2.804731.6171200-5.97513034.8181-13.6980000001.61712-2.772211.15509000-13.69823.1242-9.7842700001.2820101.15509-2.437100-5.588240-9.7842731.4437-Jacobian Matrix-16.92690000-16.9269000001

25、.6879300018.169100000-18.1691000000.0041.9297-12.1301-11.15360003.54272-1.0628-1.7664600000-12.045518.06090-6.0153900-1.781381.308190-2.102620000-11.0484016.814400-5.76607-2.3360802.4259800-1.97778-16.926900-6.36224037.9476-14.658500-0.03.05959-0.000000-14.472124.8873-10.4152000-2.5091.86088-1.47389

26、0-18.169100-6.051570-10.472134.692800-0.0-0.2.662700-3.521491.06281.7664600042.0299-12.1301-11.1536000001.78138-3.88402.1026200-12.045517.20370-6.0153900002.336080-4.31386001.97778-11.0484016.299300-5.766071.68793000.0-2.975490.00-6.36224038.3226-14.65850000002.509-3.982891.47389000-14.472124.2355-1

27、0.415200.000.00.-2.6089300-6.051570-10.472134.8585-Jacobian Matrix-16.74570000-16.7457000001.6304300018.038800000-18.0388000000.0041.3695-11.8919-10.96860003.48069-1.02775-1.7371200000-11.805717.69180-5.886100-1.76021.280910-2.02170000-10.8651016.547600-5.68251-2.2973702.4065500-1.91027-16.745700-6.

28、21183037.3041-14.346500-0.02.95313-0.000000-14.170424.4052-10.2348000-2.429091.86079-1.433530-18.038800-5.946930-10.287234.27300-0.0-0.2.5984700-3.480891.027751.7371200041.3703-11.8919-10.9686000001.7602-3.7818902.021700-11.805716.69410-5.886100002.297370-4.20764001.91027-10.8651015.948800-5.682511.

29、63043000.0-2.950770.00-6.21183037.3083-14.34650000002.42909-3.862621.43353000-14.170423.7059-10.234800.000.00.-2.5970600-5.946930-10.287234.2743-Jacobian Matrix-16.74350000-16.7435000001.6300018.037400000-18.0374000000.850041.3625-11.8888-10.96640003.48016-1.02713-1.7366200000-11.802617.68710-5.8845

30、00-1.760081.280530-2.020450000-10.8628016.544400-5.68158-2.2970302.4063200-1.90929-16.743500-6.20987037.296-14.342600-0.02.95114-0.000000-14.166724.3994-10.2326000-2.427941.86097-1.433020-18.037400-5.945670-10.28534.268100-0.0-0.2.5973400-3.480161.027131.7366200041.3625-11.8888-10.9664000001.76008-3

31、.7805302.0204500-11.802616.68710-5.884500002.297030-4.20632001.90929-10.8628015.944400-5.681581.63000.0-2.951140.00-6.20987037.296-14.34260000002.42794-3.860971.43302000-14.166723.6994-10.232600.85000.00.-2.5973400-5.945670-10.28534.2681-iteration- iteration = 4-voltage magnitude and angle-1.04001.0

32、250.9.280011.0250.4.664761.02579-0.-2.216790.-0.-3.988811.01265-0.-3.68741.025770.3.71971.015880.0.1.032350.1.96672-bus P and Q-10.716410.21.630.30.85-0.4005-1.25-0.56-0.9-0.37008-1-0.35900-line flow-NUM-i-j-begin-end-141-0.71641+j-0.0.71641+j0.27046272-1.63+j0.1.63+j0.393-0.85+j0.0.85+j-0.4780.+j-0

33、.-0.+j-0.5980.+j0.-0.+j-0.6750.+j-0.-0.+j-0.7960.+j-0.-0.+j-0.854-0.+j-0.0.+j0.964-0.+j-0.0.+j0.-Ploss and Qloss-Ploss = 0.Qloss = -0.3.思考題3.1潮流計算的方法有哪些?各有何特點?答:潮流計算分為手算和機算兩大類,其中機算又有高斯-賽德爾迭代法、牛頓-拉夫遜迭代法、P-Q分解法等算法。特點:手算求解潮流一般只用在簡單的網(wǎng)絡中,其計算量大,對于多節(jié)點的網(wǎng)絡用手算一般難以解決問題,但通過手算可以加深物理概念的理解,還可以在運用計算機計算前以手算求取某些原始數(shù)據(jù)。

34、高斯-賽德爾迭代法:算法簡單,對初值的要求不高,但需要迭代的次數(shù)多,收斂的速度慢,在早期的潮流計算程序中應用很多,之后逐漸被牛頓-拉夫遜迭代法所取代,但仍可作為計算程序前幾次迭代的算法,以彌補后者對初值要求高的缺點。牛頓-拉夫遜迭代法:是常用的解非線性方程組的方法,也是當前廣泛采用的計算潮流的方法,其收斂速度快,幾次迭代就可以得到最終的結果。但其缺點是要求初值的選擇得比較接近它們的精確值,否則迭代過程可能不收斂。P-Q分解法潮流計算:派生于以極坐標表示時的牛頓-拉夫遜法,其根據(jù)電力系統(tǒng)的特點,對后者的修正方程做了簡化,P-Q分解法的系數(shù)矩陣B和B”代替了牛拉法中的雅可比矩陣J,階數(shù)降低,其中的

35、元素在迭代過程中不發(fā)生變化,而且元素對稱,這些都大大提高了運算速度,而且精確度幾乎不受影響。P-Q分解法的收斂特性接近于直線,而牛頓-拉夫遜的收斂速度要比P-Q分解法快,但是由于牛頓-拉夫遜每次迭代都要形成雅客比矩陣,所以一次迭代的時間比P-Q分解法長。3.2 如果交給你一個任務,請你用已有的潮流計算軟件計算北京城市電網(wǎng)的潮流,你應該做哪些工作?(收集哪些數(shù)據(jù),如何整理,計算結果如何分析) 有現(xiàn)有的潮流計算軟件分析北京城市電網(wǎng)的潮流,主要收集以下數(shù)據(jù):(1)北京城市電網(wǎng)中所有的節(jié)點支路的相關數(shù)據(jù),并對節(jié)點和支路分類處理PQ節(jié)點要了解節(jié)點的注入有功和無功功率PV節(jié)點要了解節(jié)點電壓大小注入有功功率及節(jié)點所能提供的最大和最小無功功率對于平衡節(jié)點要了解節(jié)點的電壓大小相位、

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論