电力系统潮流上机程序孙英云.docx

电力系统潮流上机程序孙英云.docx

ID:50816528

大小:41.12 KB

页数:11页

时间:2020-03-14

电力系统潮流上机程序孙英云.docx_第1页
电力系统潮流上机程序孙英云.docx_第2页
电力系统潮流上机程序孙英云.docx_第3页
电力系统潮流上机程序孙英云.docx_第4页
电力系统潮流上机程序孙英云.docx_第5页
资源描述:

《电力系统潮流上机程序孙英云.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、附录程序及结果#include"pf.h"#include"complex"usingnamespacestd;pf::pf(void){m_Line=NULL;m_Bus=NULL;bph=NULL;m_Bus_newIdx=NULL;m_pv_Num=0;m_sw_Num=0;m_pq_Num=0;}pf::~pf(void){if(m_Line!=NULL)delete[]m_Line;if(m_Bus!=NULL)delete[]m_Bus;if(bph!=NULL)delete[]bph;if

2、(m_Bus_newIdx!=NULL)delete[]m_Bus_newIdx;}intpf::readDataFromFile(stringfileName){stringstrLine,strTemp;ifstreamfin;//openfileforread;fin.open(fileName.c_str());if(!fin.fail()){//1.readSBase;getline(fin,strLine);strTemp.assign(strLine,31,6);m_SBase=atof(

3、strTemp.c_str());//2.readBusDatahere;//2.1readBusnum;getline(fin,strLine);size_tpos_begin,pos_end;pos_begin=strLine.find("FOLLOWS");pos_begin=pos_begin+size_t(10);pos_end=strLine.find("ITEM");strTemp=strLine.substr(pos_begin,pos_end-pos_begin);m_Bus_Num=

4、atoi(strTemp.c_str());cout<<"系统共有"<

5、here//allocatememoryform_Busm_Bus=newBus[m_Bus_Num];m_Bus_newIdx=newint[m_Bus_Num];for(inti=0;i

6、[i].Name=strTemp;//readbustypePQ:Type=1;PV:Type=2;swing:Type=3;strTemp=strLine.substr(24,2);if(atoi(strTemp.c_str())<=1){m_Bus[i].Type=1;m_pq_Num++;}elseif(atoi(strTemp.c_str())==2){m_Bus[i].Type=2;m_pv_Num++;}elseif(atoi(strTemp.c_str())==3){m_Bus[i].Ty

7、pe=3;m_sw_Num++;}//读入节点电压strTemp=strLine.substr(27,6);m_Bus[i].V=atof(strTemp.c_str());//读入节点相角strTemp=strLine.substr(33,6);m_Bus[i].theta=atof(strTemp.c_str());//读入负载有功strTemp=strLine.substr(39,9);m_Bus[i].LoadP=atof(strTemp.c_str());//读入负载无功strTemp=str

8、Line.substr(49,10);m_Bus[i].LoadQ=atof(strTemp.c_str());//读入发电机有功strTemp=strLine.substr(59,8);m_Bus[i].GenP=atof(strTemp.c_str());//读入发电机无功strTemp=strLine.substr(67,8);m_Bus[i].GenQ=atof(strTemp.c_str());//读入转移电导BstrTemp=s

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。