潮流上机课程设计报告.华电

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

《电力系统潮流上机》课程设计报告院系班级:学号:学生姓名:指导教师:设计周数成绩:日期:年月日课程课程设计报告1一、课程设计的目的与要求培养学生的电力系统潮流计算机编程能力,掌握计算机潮流计算的相关知识二、设计正文(详细内容见附录)1.手算:要求应用牛顿-拉夫逊法或P-Q分解法手算求解,要求精度为0.001MW。节点1为平衡节点,电压00.11U,节点2为PQ节点,负荷功率6.08.0~2jS,节点3是PV节点,1.1,4.033UP,两条支路分别为04.001.013jZ,2.005.012jZ,对地支路33.030jy。课程课程设计报告22.计算机计算:编写潮流计算程序,要求如下:2.1据给定的潮流计算任务书整理潮流计算的基础数据:节点的分类,线路模型,等值变压器模型,电压等级的归算,标幺值的计算;2.2基础数据的计算机存储:节点数据,支路数据(包括变压器);2.3用牛顿-拉夫逊法计算;2.4根据所选潮流计算方法画流程图,划分出功能模块,有数据输入模块,导纳阵形成模块,解线性方程组模块,计算不平衡功率模块,形成雅可比矩阵模块,解修正方程模块,计算线路潮流,网损,PV节点无功功率和平衡节点功率,数据输出模块;2.5据上述模块编制程序并上机调试程序,得出潮流计算结果;2.6源程序及其程序中的符号说明集、程序流图简单系统如下图所示,支路数据如下:41.01.012jz,3.013jz,5.012.014jz,40.008.024jz01528.01,202,10jyy,0192.01,404,10jyy,01413.02,404,20jyy1.1k节点数据如下:18.030.01jS,13.055.02jS,5.03S,10.13U,oU005.143S2S1S4S4,10y1,40y2,10y1,20y4,20y2,40y12z24z14zkz13)1(13kkzkz1131)节点导纳阵#includestdio.h#includemath.h#includefstream.h#includeLF.h课程课程设计报告3//formnodeconductancematrixintMakeY(intnB,intnL,Line*sL,double**YG,double**YB){inti,j,l;doubler,x,d1,g,b,t;for(i=0;inB;i++)for(j=0;jnB;j++){YG[i][j]=0.0;YB[i][j]=0.0;}for(i=0;inL;i++){r=sL[i].R;x=sL[i].X;g=r/(r*r+x*x);b=-x/(r*r+x*x);switch(sL[i].Type){case1://Linebreak;case2://Transformerg*=1/sL[i].K;b*=1/sL[i].K;break;}YG[sL[i].NumI][sL[i].NumI]+=g;YG[sL[i].NumJ][sL[i].NumJ]+=g;YG[sL[i].NumI][sL[i].NumJ]-=g;YG[sL[i].NumJ][sL[i].NumI]-=g;YB[sL[i].NumI][sL[i].NumI]+=b+sL[i].B;YB[sL[i].NumJ][sL[i].NumJ]+=b+sL[i].B;YB[sL[i].NumI][sL[i].NumJ]-=b;YB[sL[i].NumJ][sL[i].NumI]-=b;}printf(实部:\n);for(i=0;inB;i++){for(j=0;jnB;j++)printf(%lf\t,YG[i][j]);printf(\n);}printf(虚部:\n);for(i=0;inB;i++){for(j=0;jnB;j++)printf(%lf\t,YB[i][j]);printf(\n);}/*ChecktheYmatrix*/ofstreamfout(out.txt);fout--------------YMatrix--------------------endl;for(i=0;inB;i++){for(j=0;jnB;j++)foutYG[i][j]+jYB[i][j]\t;课程课程设计报告4foutendl;}fout.close();return0;}2)计算功率不平衡量#includestdio.h#includemath.h#includefstream.h#includeLF.h//formdeltapanddeltaqintCalDeltaPQ(intnpv,intnpq,Bus*bus,double**YG,double**YB,int*p_Jtobus,double*deltaf){intk,i,j;for(k=0;knpv+npq*2;k++){i=p_Jtobus[k];if(knpv){deltaf[k]=bus[i].GenP-bus[i].LoadP;for(j=0;jnpv+npq+1;j++){deltaf[k]-=bus[i].Volt*bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));}printf(PV节点%d的有功功率是%lf\n,i,deltaf[k]);}if(knpq+npv&&k=npv){deltaf[k]=bus[i].GenP-bus[i].LoadP;for(j=0;jnpv+npq+1;j++){deltaf[k]-=bus[i].Volt*bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));}printf(PQ节点%d的有功功率是%lf\n,i,deltaf[k]);}if(knpq*2+npv&&k=npv+npq){deltaf[k]=bus[i].GenQ-bus[i].LoadQ;for(j=0;jnpv+npq+1;j++){deltaf[k]-=bus[i].Volt*bus[j].Volt*(YG[i][j]*sin(bus[i].Phase-bus[j].Phase)-YB[i][j]*cos(bus[i].Phase-bus[j].Phase));}printf(PQ节点%d的无功功率是%lf\n,i,deltaf[k]);}}return0;}3)雅各比矩阵的计算/*Purpose:forundergraduatecourseTask:LoadFlow课程课程设计报告5Copyright@NCEPU,LiuChongru*/#includestdio.h#includemath.h#includefstream.h#includeLF.h//formJacobianmatrixintFormJacobian(intnpv,intnpq,Bus*bus,double**YG,double**YB,int*p_Jtobus,double**Jac){intnp=npv+npq,j,k,i,m;//TODOdoublea[14],q[14];for(k=0;knpv+npq*2;k++){i=p_Jtobus[k];a[i]=0;q[i]=0;if(knp)//HN{for(j=0;jnp+1;j++)if(j!=i){a[i]+=bus[j].Volt*(YG[i][j]*sin(bus[i].Phase-bus[j].Phase)-YB[i][j]*cos(bus[i].Phase-bus[j].Phase));q[i]+=bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));}for(m=0;mnpv+npq*2;m++){j=p_Jtobus[m];if(j!=i){if(mnp)Jac[k][m]=bus[i].Volt*bus[j].Volt*(YG[i][j]*sin(bus[i].Phase-bus[j].Phase)-YB[i][j]*cos(bus[i].Phase-bus[j].Phase));//FormHelseJac[k][m]=bus[i].Volt*bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));//FormN}elseif(j==i){if(mnp)Jac[k][m]=-bus[i].Volt*a[i];//FormHelseJac[k][m]=bus[i].Volt*q[i]+2*bus[i].Volt*bus[i].Volt*YG[i][j];//FormN}}}else{for(j=0;jnp+1;j++)课程课程设计报告6if(j!=i){a[i]+=bus[j].Volt*(YG[i][j]*sin(bus[i].Phase-bus[j].Phase)-YB[i][j]*cos(bus[i].Phase-bus[j].Phase));q[i]+=bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));}for(m=0;mnpv+npq*2;m++){j=p_Jtobus[m];if(j!=i){if(mnp)Jac[k][m]=-bus[i].Volt*bus[j].Volt*(YG[i][j]*cos(bus[i].Phase-bus[j].Phase)+YB[i][j]*sin(bus[i].Phase-bus[j].Phase));//FormJelseJac[k][m]=bus[i].Volt*bus[j].Volt*(YG[i][j]*sin(bus[i].Phase-bus[j].Phase)-YB[i][j]*cos(bus[i].Phase-bus[j].Phase));//FormL}elseif(j==i){if(mnp)Jac[k][m]=bus[i].Volt*q[i];elseJac[k][m]=bus[i].Volt*a[i]-2*bus[i].Volt*bus[i].Volt*YB[i][j];}}}}for(i=0;inp+npq;i++){for(intj=0;jnp+npq;j++){printf(%d%d%f,i,j,Jac[i][j]);}printf(\n);}//OutputthematrixtochecktheJacobianmatrixofstreamfout(out.txt,ios::app);fout--------------JacobianMatrix--------------------endl;for(i=0;inp+npq;i++){for(j=0;jnp+npq;j++)foutJac[i][j]\t;foutendl;}fout.close();return0;}4)线路损耗//8.calculatethepowerflowdouble*p_Pij,*p_Qij,*p_Pji,*p_Qji;p_Pij=newdouble[nL];p_Qij=newdouble[nL];p_Pji=newdouble[nL];p_Qji=newdoub

1 / 13
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功