Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
Source_base.h
Go to the documentation of this file.
1#ifndef _SOURCE_BASE_H
2#define _SOURCE_BASE_H
3
9#include "../Element.h"
10
16class Source_base : public Element {
17public:
24 Source_base(const std::string& symbol, const std::string& location, int pins) : Element(symbol, location, pins, pins) {}
26
27 // Power flow computations for AC and DC networks
28 void computePowerFlow(std::map<std::string, double>& branchData,
29 std::map<std::string, double>& globalParams) const override;
30
31 double getZsrc() const { return Zsrc.empty() ? 0 : Zsrc[0]; }
32 double getVg() const { return V.empty() ? 0 : V[0]; }
33protected:
34 vector<double> Zsrc = {}; // Internal source impedance [Ohms]
35 vector<double> V = {}; // Voltage amplitude or DC voltage [kV]
36 vector<double> theta = {}; // Phase shift, used only for AC sources [radians]
37
38 // Properties used for power flow
39 double P; // Active power output [MW]
40 double Q; // Reactive power output [MVAr]
41 double P_min; // Min active power output [MW]
42 double P_max; // Max active power output [MW]
43 double Q_min; // Min reactive power output [MVA]
44 double Q_max; // Max reactive power output [MVA]
45};
46
47#endif
Base class for multi-phase network elements with Y-parameters and MNA stamping hooks.
Definition Element.h:29
Common properties and power-flow methods for source elements.
Definition Source_base.h:16
double Q
Definition Source_base.h:40
double getVg() const
Definition Source_base.h:32
~Source_base()
Definition Source_base.h:25
vector< double > theta
Definition Source_base.h:36
double Q_min
Definition Source_base.h:43
double P_min
Definition Source_base.h:41
double P
Definition Source_base.h:39
double getZsrc() const
Definition Source_base.h:31
vector< double > Zsrc
Definition Source_base.h:34
double Q_max
Definition Source_base.h:44
Source_base(const std::string &symbol, const std::string &location, int pins)
Construct a source with equal input and output pin counts.
Definition Source_base.h:24
void computePowerFlow(std::map< std::string, double > &branchData, std::map< std::string, double > &globalParams) const override
Compute branch power-flow quantities (override in derived classes).
Definition Source_base.cpp:8
double P_max
Definition Source_base.h:42
vector< double > V
Definition Source_base.h:35