Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
Load.h
Go to the documentation of this file.
1#ifndef _LOAD_H_
2#define _LOAD_H_
3
9#include "Load_base.h"
10
18class Load : public Load_base {
19public:
27 Load(const std::string& symbol, const std::string& location, int pins, std::vector<double> values);
28
29
30 // Destructor
31 ~Load() {}
32
33 // Access functions for resistance, inductance, and capacitance values for each phase
34 double getResistance(int phase) const {
35 if (phase >= 0 && phase < R.size()) {
36 return R[phase];
37 }
38 throw std::out_of_range("Invalid phase index");
39 }
40
41 double getInductance(int phase) const {
42 if (phase >= 0 && phase < L.size()) {
43 return L[phase];
44 }
45 throw std::out_of_range("Invalid phase index");
46 }
47
48 double getCapacitance(int phase) const {
49 if (phase >= 0 && phase < C.size()) {
50 return C[phase];
51 }
52 throw std::out_of_range("Invalid phase index");
53 }
54
55 // Power flow calculations (AC and DC)
56 void computePowerFlow(std::map<std::string, double>& busAC,
57 std::map<std::string, double>& globalParams) const override;
58
59private:
60 // Values for resistance, inductance and capacitance
61 std::vector<double> R; // Resistance for each phase
62 std::vector<double> L; // Inductance for each phase
63 std::vector<double> C; // Capacitance for each phase
64
65 // element_OPF_info is containing values for element_symbol, grid_area, rated_voltage_kv, R, L, C
66};
67#endif
Base class for load elements connected to network buses.
Common base for load models with power-flow support.
Definition Load_base.h:16
Load with resistive, inductive, and capacitive components in series.
Definition Load.h:18
double getCapacitance(int phase) const
Definition Load.h:48
void computePowerFlow(std::map< std::string, double > &busAC, std::map< std::string, double > &globalParams) const override
Compute branch power-flow quantities (override in derived classes).
Definition Load.cpp:90
double getInductance(int phase) const
Definition Load.h:41
~Load()
Definition Load.h:31
double getResistance(int phase) const
Definition Load.h:34