Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
Transformer_base.h
Go to the documentation of this file.
1#ifndef TRANSFORMER_BASE_H
2#define TRANSFORMER_BASE_H
3
9#include "../Element.h"
10
16class Transformer_base : public Element {
17public:
25 Transformer_base(const std::string& symbol, const std::string& location, int pins, const std::vector<double>& values);
26
28
29 double getResistance(int winding) const {
30 if (winding >= 0 && winding < R.size()) {
31 return R[winding];
32 }
33 throw std::out_of_range("Invalid winding index");
34 }
35
36 double getInductance(int winding) const {
37 if (winding >= 0 && winding < L.size()) {
38 return L[winding];
39 }
40 throw std::out_of_range("Invalid winding index");
41 }
42
43 void computePowerFlow(std::map<std::string, double>& branchData,
44 std::map<std::string, double>& global) const override;
45
46protected:
47 std::vector<double> R; // Resistances for primary and secondary windings, and for magnetization resistance if given
48 std::vector<double> L; // Inductances for primary and secondary windings, and for the magnetization inductance if given
49 int m_pins = 0; // Store the pins value passed in the constructor
50
52 //std::complex<double> voltage_primary; // Primary winding voltage
53 //std::complex<double> voltage_secondary; // Secondary winding voltage
54};
55
56#endif
Base class for multi-phase network elements with Y-parameters and MNA stamping hooks.
Definition Element.h:29
Base transformer with primary/secondary winding R and L values.
Definition Transformer_base.h:16
std::vector< double > L
Definition Transformer_base.h:48
double getResistance(int winding) const
Definition Transformer_base.h:29
double getInductance(int winding) const
Definition Transformer_base.h:36
std::vector< double > R
Definition Transformer_base.h:47
void computePowerFlow(std::map< std::string, double > &branchData, std::map< std::string, double > &global) const override
Compute branch power-flow quantities (override in derived classes).
Definition Transformer_base.cpp:15
int m_pins
Definition Transformer_base.h:49