• 大小: 6KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-05-21
  • 语言: C/C++
  • 标签: 前推回代  

资源简介

单相的前推回代法潮流计算

资源截图

代码片段和文件信息

#include
#include
#include

FILE *fp;//文件指针
char filename[50]={““};

///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
//节点参数结构体
struct Bus
 {
  int N;//节点号
  double P;//节点有功
  double Q;//节点无功
 };

//支路参数结构体
struct Branch
 {
  int Nbr;//支路号
  int node1;//首节点
  int node2;//末节点
  double R;//支路电阻
  double X;//支路电抗
  double bianbi;//支路变比
 };
//线路功率参数结构体
struct Zhilu
{
double P;//线路有功
double Q;//线路无功
};

void main()
{
int n=33;            //节点数
int m=32;            //支路数
int Brorder[32]={1721243216202331151922301418291328122711261025987654321};
int Border[33]={182225331721243216202331151930142913281227112610987654321};
Branch branch[32]={
{1 1 2 0.09220.04701}
{2 2 3 0.49300.25111}
{3 3 4 0.36600.18641}
{4 4 5 0.38110.19411}
{5 5 6 0.81900.70701}
{6 6 7 0.18720.61881}
{7 7 8 0.71440.23511}
{8 8 9 1.03000.74001}
{9 9 101.04400.74001}
{1010110.19660.06501}
{1111120.37440.12381}
{1212131.46801.15501}
{1313140.54160.71291}
{1414150.59100.52601}
{1515160.74630.54501}
{1616171.28901.72101}
{1717180.37200.57401}
{182 190.16400.15651}
{1919201.50421.35541}
{2020210.40950.47841}
{2121220.70890.93731}
{223 230.45120.30831}
{2323240.89800.70911}
{2424250.89600.70111}
{256 260.20300.10341}
{2626270.28420.14471}
{2727281.05900.93371}
{2828290.80420.70061}
{2929300.50750.25851}
{3030310.97440.96301}
{3131320.31050.36191}
{3232330.34100.53621}
};
Bus bus[33]={
{1 0    0   }
{2 0.1  0.06}
{3 0.09 0.04}
{4 0.12 0.08}
{5 0.06 0.03}
{6 0.06 0.02}
{7 0.2  0.1 }
{8 0.2  0.1 }
{9 0.06 0.02}
{100.06 0.02}
{110.0450.03}
{120.06 0.035}
{130.06 0.035}
{140.12 0.08}
{150.06 0.01}
{160.06 0.02}
{170.06 0.02}
{180.09 0.04}
{190.09 0.04}
{200.09 0.04}
{210.09 0.04}
{220.09 0.04}
{230.09 0.045}
{240.42 0.2 }
{250.42 0.2 }
{260.06 0.025}
{270.06 0.025}
{280.06 0.02}
{290.12 0.07}
{300.2  0.6 }
{310.15 0.07}
{320.21 0.1 }
{330.06 0.04}
};
//节点电压赋初值
double v1[33];
double a=12.66;               //节点电压基准值
for(int i=0;i<=32;i++)
{
v1[i]=a;          //各节点电压赋初值
}
double v2[33];
for(i=0;i<=32;i++)
{
v2[i]=v1[i];
}
d

评论

共有 条评论