添加直接给出DG有功、无功的函数

Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab 2015-03-10 20:39:57 +08:00
parent 5825d156f6
commit 7e5c6c71a1
3 changed files with 13 additions and 1 deletions

View File

@ -286,7 +286,7 @@ void CIMExporter::exportTo(const QString& path,const QString &rootID)
ite++)
{
//保存到节点注入功率中
nodePQ.push_back(CIMExporter::NodePQ(ite->toNum,-ite->dg->capacity/100000,-ite->dg->capacity/100000) );
nodePQ.push_back(CIMExporter::NodePQ(ite->toNum,-ite->dg->getPG(0.95)/1000,-ite->dg->getQG(0.95)/1000) );//capapcity的单位是kVA
// writer<<ite->fromNum<<"\t";
// writer<<ite->toNum<<"\t";
// writer<<ite->dg->capacity<<"\r\n";

View File

@ -11,6 +11,15 @@ DG::~DG()
}
double DG::getPG(double pf)//有功出力,满发情况
{
return pf*(this->capacity);
}
double DG::getQG(double pf)//无功出力,满发情况
{
return std::sqrt(1-pf*pf)*this->capacity;
}
void DG::extract()
{
//单位阻抗

View File

@ -3,12 +3,15 @@
#include <QPair>
#include <QString>
#include <cmath>
#include "branch.h"
class DG:public Branch
{
public:
DG(const QPair<QString, QString> &fromTo, double DGCapacity, const QString &id, QObject *parent=0);
DG();
double getPG(double pf);//有功出力
double getQG(double pf);//无功出力
~DG();
QString id;
double capacity;