云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 潮流计算--电力系统大作业(C++编写)

潮流计算--电力系统大作业(C++编写)

  • 62 次阅读
  • 3 次下载
  • 2026/1/9 22:18:56

(*a).S_end[1]=(*b).S_begin[1]+(*a).S_org[1]; };

class BinTree{ public:

friend void

pass_U(line_part*,line_part*,line_part*); //电压传递函数 pass_w(line_part*,line_part*,line_part*); line_part(0,0,0,0,0,0,0,0,0,0,0); root = aa; } vall,double u_end=0,double u_begin=0,double r=0, Pe=0,double Xe=0, P0=0,double Q0=0){ egin,r,x,b,Pe,Xe,K,P0,Q0); private: *&t,double vall,double u_end,double u_begin,double r, Pe,double Xe, Q0); };

friend void //功率传递函数 BinTree(){line_part *aa=new line_part *Getroot(){return root;} void insertline_part(double double x=0,double b=0,double double K=0,double insertline_part(root,vall,u_end,u_b} void PreOrder(){PreOrder(root);}; void PostOrder(){PostOrder(root);}; void display(){display(root);}; line_part *root; void insertline_part(line_part double x,double b,double double K,double P0,double void PreOrder(line_part *&t); void PostOrder(line_part *t); void display(line_part *&t);

void BinTree::insertline_part(line_part *&t, double vall,double u_end=0,double u_begin=0,double r=0, double x=0,double b=0,double Pe=0,double Xe=0, double K=0,double P0=0,double Q0=0){ //插入节点 double ass=t->get_val(); if(t==0||t->get_val()<=0) { t=new line_part (vall,u_end,u_begin,r,x,b,Pe,Xe,K,P0,Q0);} else if(vallget_val()) { insertline_part(t->lchild, vall,u_end,u_begin,r,x,b,Pe,Xe,K,P0,Q0);} else { insertline_part(t->rchild, vall,u_end,u_begin,r,x,b,Pe,Xe,K,P0,Q0);} };

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

void BinTree::display(line_part *&t){

if(t->get_val()>0&&t->get_val()<100) { display(t->lchild); display(t->rchild);

ofstream outfile1;

outfile1.open(\

p_cost_all +=t->get_Pcost();

double U; // 计算并存放各个节点的电压相角(始端为零) U=atan2(t->U[1],(t->get_Ubegin()-t->U[0]))/3.1415926*180;

outfile1<<\支路\电压相角\ \

outfile1<<\ \首端电压\ \//计算并存放各个支路的

首端电压

outfile1<<\ \末端电压\ \路的末端电压

//计算并存放各个支

double U_cost; //计算并存放各个支路的电压损耗

U_cost=t->get_Ubegin()-t->get_Uend();

outfile1<<\ \电压损耗\

outfile1<<\ \始端有功\首端电压

outfile1<<\ \始端无功\路的末端电压

outfile1<<\ \末端有功\首端电压

outfile1<<\ \末端无功\路的末端电压

double P_cost; 的有功损耗 P_cost=t->get_Pcost();

outfile1<<\ \有功损耗\

double Q_cost; 的无功损耗 Q_cost=t->get_Qcost();

outfile1<<\ \无功损耗\

outfile1.close();

\\//计算并存放各个支路的\ //计算并存放各个支\//计算并存放各个支路的\ //计算并存放各个支 //计算并存放各个支路 \ //计算并存放各个支路 \ } };

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void BinTree::PreOrder(line_part *&t){ //先序遍历二叉树修改电压 0) get_lchild()->get_val()<100) get_rchild()->get_val()<100) get_rchild()->get_val()<100) if(t->get_val()>0&&t->get_val()<10{ if(t->get_lchild()->get_val()>0&&t-> { if(t->get_rchild()->get_val()>0&&t-> { t->Uend(); pass_U(t,t->lchild,t->rchild); t->lchild->Uend(); t->rchild->Uend(); } else{ t->Uend(); pass_U2(t,t->lchild); t->lchild->Uend();} } else { if(t->get_rchild()->get_val()>0&&t-> { t->Uend(); pass_U2(t,t->rchild); t->rchild->Uend(); } else{} } PreOrder(t->lchild); PreOrder(t->rchild); }

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

(*a).S_end[1]=(*b).S_begin[1]+(*a).S_org[1]; }; class BinTree{ public: friend void pass_U(line_part*,line_part*,line_part*); //电压传递函数 pass_w(line_part*,line_part*,line_part*); line_part(0,0,0,0,0,0,0,0,0,0,0); root = aa; } vall,double u_end=0,double u_begin=0,double r=0, Pe=0,double Xe=0, P0=0,double Q0=0){ egin,r,x,b,Pe,Xe,K,P0,Q0);

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com