cimforreduceloss/testHasttable/element/dg.cpp

38 lines
640 B
C++

#include "dg.h"
DG::DG(const QPair<QString, QString> &fromTo, double DGCapacity,const QString &id,QObject *parent):Branch(fromTo.first,fromTo.second,parent)
{
this->id=id;
this->capacity=DGCapacity;
}
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()
{
//单位阻抗
double r0=0;
double x0=0.0001;
double g0=0;
double b0=0;
this->r=r0;
this->x=x0;
this->g1=g0;
this->g2=g0;
this->b1=b0;
this->b2=b0;
}