📄 branch.h
字号:
#ifndef BRANCH_H
#define BRANCH_H
#include <boost\assert.hpp>
class ACBranch {
public:
///按标准格式定义的变量
int NodeI; //Tap bus number (I) *
//For transformers or phase shifters, the side of the model
// the non-unity tap is on
int NodeJ; //Z bus number (I) *
//For transformers and phase shifters, the side of the model
// the device impedance is on.
int LfArea; // Load flow area (I)
int LossZone; // Loss zone (I)
int Circuit; // Circuit (I) * (Use 1 for single lines)
int BranchType; // Type (I) *
//0 - Transmission line
//1 - Fixed tap
//2 - Variable tap for voltage control (TCUL, LTC)
//3 - Variable tap (turns ratio) for MVAR control
//4 - Variable phase angle for MW control (phase shifter)
double R; // Branch resistance R, per unit (F) *
double X; // Branch reactance X, per unit (F) * No zero impedance lines
// double B; // Line charging B, per unit (F) * (total line charging, +B)
union{ //为了兼容以前版本
double B; //用于表示B 接地电容
double B_2; //用于表示b/2 线路
double K; //变比 变压器
};
int RateNo1; // Line MVA rating No 1 (I) Left justify!
int RateNo2; // Line MVA rating No 2 (I) Left justify!
int RateNo3; // Line MVA rating No 3 (I) Left justify!
int ControlBusNum; // Control bus number
int ControlBusSide; //0 - Controlled bus is one of the terminals
// 1 - Controlled bus is near the tap side
// 2 - Controlled bus is near the impedance side (Z bus)
double TRatio; // Transformer final turns ratio (F)
double TAngle; // Transformer (phase shifter) final angle (F)
double MaxTap; // Minimum tap or phase shift (F)
double MinTap; // Maximum tap or phase shift (F)
double StepSize; // Step size (F)
double MinLimit; // Minimum voltage, MVAR or MW limit (F)
double MaxLimit; // Maximum voltage, MVAR or MW limit (F)
//----------2008.10.27----------------------------------------------
//---为处理小阻抗和R/X比值较大的支路而设置的,如果为true,
//---则在形成导纳矩阵,B'和B''矩阵时不包括此支路的矩阵
bool bExcludeRX;
//------------------------------------------------------------------
ACBranch(){BranchType=LN;TAngle=0;bExcludeRX=false;};
ACBranch(int nodei, int nodej)
{NodeI=nodei;NodeJ=nodej;BranchType=LN;TAngle=0;bExcludeRX=false;};
};
// 2008.04.13 The class for modeling a DC branch.
class DCBranch {
template < class IStream > friend IStream& operator >> ( IStream&, DCBranch& );
public:
DCBranch() : rectifier_(0), inverter_(0), Rl_(0.0) {}
int GetRectifierBusID() const { return rectifier_; }
int GetInverterBusID() const { return inverter_; }
double GetR() const { return Rl_; }
private:
int rectifier_;
int inverter_;
double Rl_;
};
template < class IStream >
IStream& operator >> ( IStream& in, DCBranch& branch )
{
if( in.eof() ) {
in.setstate( std::ios::failbit | std::ios::eofbit );
return in;
}
boost::io::ios_exception_saver ies(in);
in.exceptions( std::ios::failbit | std::ios::badbit );
in >> branch.rectifier_;
in >> branch.inverter_;
BOOST_ASSERT( branch.rectifier_ > 0 && branch.inverter_ > 0 );
in >> branch.Rl_;
return in;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -