• 大小: 16KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: C/C++
  • 标签: 潮流计算  C语言  

资源简介

C语言编写的IEEE30节点潮流计算程序,经过仿真和验证证明程序编写正确,可以和matpower进行对比验证。。

资源截图

代码片段和文件信息


// 30节点系统潮流计算程序.cpp : Defines the entry point for the console application.
//
#include “stdafx.h“

//*************************************************************************************************************//
//IEEE-30节点系统潮流计算程序

#include
#include

#define N 30              //节点数
#define n_PQ 24            //PQ节点数
#define n_PV 5            //PV节点数
#define n_br 41           //串联支路数
#define n_C 2             //装有并联电容节点数
//#define n_L 1

#define PI 3.1415926
double K1K2K3K4;          //变压器变比
double Yc1Yc2;
//double Xmcr;

void main()
{
//void disp_matrix(double *disp_pint disp_mint disp_n);        //矩阵显示函数

//节点电压赋初值,PV节点电压幅值已知,相角置0;平衡节点电压幅值和相角均已知;PQ节点电压幅值设1,相角设0.
//   1        2        3        4        5        6        7        8        9        10 
/*double Us[2*N]={1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.033801.005801.023001.091301.088301.05000
}; */
/*double Us[2*N]={1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.050001.050001.050001.050001.050001.05000
};*/
double Us[2*N]={1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.000001.000001.000001.000001.000001.00000
1.000001.000001.000001.000001.000001.000001.000001.000001.000001.05000
};
    
//PV节点发电机有功赋初值(除平衡节点外)
//     1      2      3      4      5      6      7      8      9      10 
double Ps[N]={0.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
  0.00000.00000.00000.00000.00000.00000.00000.00000.00000.0000
  0.00000.00000.00000.00000.57560.24560.35000.17930.1691
}; 
//发电机无功初值置0
double Qs[N]={0};                                                                                           

//各节点有功负荷赋值
//     1     2     3     4     5     6     7     8     9     10 
double PL[N]={0.0240.0760.0000.2280.0000.0580.1120.0620.0820.035
  0.0900.0320.0950.0220.1750.0000.0320.0870.0000.035
  0.0000.0000.0240.1060.2170.9420.3000.0000.000
};  

//各节点无功负荷赋值
//     1     2     3     4     5     6     7     8     9     10 
double QL[N]={0.0120.0160.0000.1090.0000.0200.0750.0160.0250.018
  0.0580.0090.0340.0070.1120.0000.0160.0670.0000.023
  0.0000.0000.0090.0190.1270.1900.3000.0000.000
};    

//double K1=1.0155;K2=0.9629;K3=1.0129;K4=0.9581;          //变压器当前变比
//double Yc1=0.19;Yc2=0.04;
double K1=1;K2=1;K3=1;K4=1;          //变压器当前变

评论

共有 条评论