资源简介
基于直流方程的IEEE14节点电力系统内点法潮流优化程序
代码片段和文件信息
// LP_test.cpp : Defines the entry point for the console application.
// test the DC plow based OPF
// with quadratic objective function solved by linear programming.
// test the agorithm by IEEE 14-bus system; 2008/05/21
#include “stdafx.h“
#include
#include
#include
#include
#include // for clock() CLOCKS_PER_SEC
#include
#include
#include “LP_test.h“
#define EPS 1.0e-6
FILE *fp;
int ieee=0;
double lmult=1;
int nPg = 0;
double Cost2[17]; //coefficient of g^2
double Cost1[17]; //coefficient of g
#define jingdu 0.0001
int main(int argc char* argv[])
{
fp=fopen(“output.txt““w“);
//fprintf(fp“a“);
//define variables for simplex
int M = 0;
int N = 0;
//单纯性法用-------------------------------------------------
int m1 = 0;
int m2 = 0;
int m3 = 0; // no. of constraints
int VarSucc = 0; // no. of variables for OPF
//-----------------------------------------------------------
char fname[80]; // network file name
int ArSize = 0; // number of nodes
int Nlines = 0; // number of lines
bool LoadShed_Flag = 0;
bool done = false; // Flag done building network
//read input file of IEEE test case;
//should make it be read from standard IEEE input file format.
//right now the input file is prepared by mathematica.
cout << “\n\t Input file name for power grid: “;
cin >> fname;
ifstream ftry(fname);
if(!ftry){
cout << “\n\ncannot open “ << fname;
ftry.close();
return 0;
}
else{
ArSize = NodeCount(ftry);
ftry.close();
}
Node *nodes = new Node[ArSize+1];// Networks of nodes
PLine *lines = new PLine[(ArSize*(ArSize+1))/2]; // Networks of lines
int BSize = ArSize-1; // Size of B matrix
double** B;
B = new double* [BSize];
// allocate space for B matrix
for (int i = 0; i < BSize; i++)
B[i] = new double[BSize];
double *rhs = new double[BSize];
// right hand side array
int *ip = new int[BSize];
// pivot information vector obtained from dec
double** Binv;
// B inverse matrix
Binv = new double* [BSize];
for (int j = 0; j < BSize; j++)
Binv[j] = new double[BSize];
//这些都是什么?----------------------------------------------------------------------------
//Diagnistics variables what‘s for?
double *FractOverload = new double [(ArSize*(ArSize+1))/2]; // Fraction of overloading
// for each line
double *Paveraged = new double [ArSize]; // Average power for
// each line
double *PS_iter = new double [11];
double *Out_it
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 18693 2008-05-08 23:04 LP_test14node\backup\LP_test.cpp
文件 671 2008-05-28 11:21 LP_test14node\Bmatrix
文件 516 2008-11-20 15:02 LP_test14node\Cpp1.dsw
文件 25600 2009-03-24 13:54 LP_test14node\Cpp1.ncb
文件 37888 2009-03-24 13:54 LP_test14node\Cpp1.opt
文件 278592 2009-07-06 11:10 LP_test14node\Debug\LP_test.exe
文件 308948 2009-07-06 11:10 LP_test14node\Debug\LP_test.ilk
文件 66179 2009-07-06 11:10 LP_test14node\Debug\LP_test.obj
文件 342928 2009-07-05 17:55 LP_test14node\Debug\LP_test.pch
文件 656384 2009-07-06 11:10 LP_test14node\Debug\LP_test.pdb
文件 58368 2009-10-09 10:49 LP_test14node\Debug\vc60.idb
文件 69632 2009-07-06 11:10 LP_test14node\Debug\vc60.pdb
文件 28672 2008-05-22 16:10 LP_test14node\IEEE14busdiagram.doc
文件 4713 2008-05-09 15:25 LP_test14node\ieee14cdf.txt
文件 39800 2009-10-09 12:04 LP_test14node\LP_test.cpp
文件 3413 2008-06-12 10:37 LP_test14node\LP_test.dsp
文件 522 2008-06-12 10:47 LP_test14node\LP_test.dsw
文件 5192 2009-07-05 17:54 LP_test14node\LP_test.h
文件 156672 2009-10-10 17:37 LP_test14node\LP_test.ncb
文件 53760 2009-10-10 17:37 LP_test14node\LP_test.opt
文件 753 2009-07-06 11:10 LP_test14node\LP_test.plg
文件 0 2009-03-25 21:17 LP_test14node\ONRLinputfileIEEE118
文件 0 2009-03-23 22:10 LP_test14node\ONRLinputfileIEEE14
文件 0 2009-07-06 11:05 LP_test14node\ORNLinnputfileIEEE14
文件 9829 2008-12-25 10:54 LP_test14node\ORNLinputfileIEEE118
文件 966 2009-07-06 11:05 LP_test14node\ORNLinputfileIEEE14
文件 0 2008-11-22 18:55 LP_test14node\ORNLinputfileIEEE14]
文件 0 2008-12-06 11:22 LP_test14node\ORNLinputileIEEE14
文件 100302 2009-07-06 11:10 LP_test14node\output.txt
文件 17408 2006-10-05 09:43 LP_test14node\quadprog.dll
............此处省略12个文件信息
评论
共有 条评论