DPsim
SPComponents.cpp
1 /* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2  * EONERC, RWTH Aachen University
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7  *********************************************************************************/
8 
9 #include <DPsim.h>
10 #include <dpsim-models/CSVReader.h>
11 #include <dpsim-models/IdentifiedObject.h>
12 #include <dpsim/RealTimeSimulation.h>
13 #include <dpsim/Simulation.h>
14 #include <dpsim/pybind/SPComponents.h>
15 #include <dpsim/pybind/Utils.h>
16 
17 namespace py = pybind11;
18 using namespace pybind11::literals;
19 
20 void addSPComponents(py::module_ mSP) {
21  py::module mSPPh1 =
22  mSP.def_submodule("ph1", "single phase static phasor models");
23  addSPPh1Components(mSPPh1);
24  py::module mSPPh3 =
25  mSP.def_submodule("ph3", "three phase static phasor models");
26  addSPPh3Components(mSPPh3);
27 }
28 
29 void addSPPh1Components(py::module_ mSPPh1) {
30  //SP Ph1 Components
31  py::class_<CPS::SP::Ph1::VoltageSource,
32  std::shared_ptr<CPS::SP::Ph1::VoltageSource>,
33  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "VoltageSource",
34  py::multiple_inheritance())
35  .def(py::init<std::string>())
36  .def(py::init<std::string, CPS::Logger::Level>())
37  .def("set_parameters",
38  py::overload_cast<CPS::Complex, CPS::Real>(
40  "V_ref"_a, "f_src"_a = 0)
41  .def("connect", &CPS::SP::Ph1::VoltageSource::connect)
42  .def_property("V_ref", createAttributeGetter<CPS::Complex>("V_ref"),
43  createAttributeSetter<CPS::Complex>("V_ref"))
44  .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
45  createAttributeSetter<CPS::Real>("f_src"));
46 
47  py::class_<CPS::SP::Ph1::Resistor, std::shared_ptr<CPS::SP::Ph1::Resistor>,
48  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Resistor",
49  py::multiple_inheritance())
50  .def(py::init<std::string>())
51  .def(py::init<std::string, CPS::Logger::Level>())
52  .def("set_parameters", &CPS::SP::Ph1::Resistor::setParameters, "R"_a)
53  .def("connect", &CPS::SP::Ph1::Resistor::connect)
54  .def_property("R", createAttributeGetter<CPS::Real>("R"),
55  createAttributeSetter<CPS::Complex>("R"));
56 
57  py::class_<CPS::SP::Ph1::Capacitor, std::shared_ptr<CPS::SP::Ph1::Capacitor>,
58  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Capacitor",
59  py::multiple_inheritance())
60  .def(py::init<std::string>())
61  .def(py::init<std::string, CPS::Logger::Level>())
62  .def("set_parameters", &CPS::SP::Ph1::Capacitor::setParameters, "C"_a)
63  .def("connect", &CPS::SP::Ph1::Capacitor::connect)
64  .def_property("C", createAttributeGetter<CPS::Real>("C"),
65  createAttributeSetter<CPS::Real>("C"));
66 
67  py::class_<CPS::SP::Ph1::Inductor, std::shared_ptr<CPS::SP::Ph1::Inductor>,
68  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Inductor",
69  py::multiple_inheritance())
70  .def(py::init<std::string>())
71  .def(py::init<std::string, CPS::Logger::Level>())
72  .def("set_parameters", &CPS::SP::Ph1::Inductor::setParameters, "L"_a)
73  .def("connect", &CPS::SP::Ph1::Inductor::connect)
74  .def_property("L", createAttributeGetter<CPS::Real>("L"),
75  createAttributeSetter<CPS::Real>("L"));
76 
78  std::shared_ptr<CPS::SP::Ph1::NetworkInjection>,
79  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "NetworkInjection",
80  py::multiple_inheritance())
81  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
82  "loglevel"_a = CPS::Logger::Level::off)
83  .def("set_parameters",
84  py::overload_cast<CPS::Real>(
86  "voltage_set_point"_a)
87  .def("set_parameters",
88  py::overload_cast<CPS::Complex, CPS::Real>(
90  "V_ref"_a, "f_src"_a = 0)
91  .def("set_base_voltage", &CPS::SP::Ph1::NetworkInjection::setBaseVoltage,
92  "base_voltage"_a)
94  .def("modify_power_flow_bus_type",
96  "bus_type"_a);
97 
98  py::class_<CPS::SP::Ph1::PiLine, std::shared_ptr<CPS::SP::Ph1::PiLine>,
99  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "PiLine",
100  py::multiple_inheritance())
101  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
102  "loglevel"_a = CPS::Logger::Level::off)
103  .def("set_parameters", &CPS::SP::Ph1::PiLine::setParameters, "R"_a, "L"_a,
104  "C"_a = -1, "G"_a = -1)
105  .def("set_base_voltage", &CPS::SP::Ph1::PiLine::setBaseVoltage,
106  "base_voltage"_a)
107  .def("connect", &CPS::SP::Ph1::PiLine::connect);
108 
109  py::class_<CPS::SP::Ph1::Shunt, std::shared_ptr<CPS::SP::Ph1::Shunt>,
110  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Shunt",
111  py::multiple_inheritance())
112  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
113  "loglevel"_a = CPS::Logger::Level::off)
114  .def("set_parameters", &CPS::SP::Ph1::Shunt::setParameters, "G"_a, "B"_a)
115  .def("set_base_voltage", &CPS::SP::Ph1::Shunt::setBaseVoltage,
116  "base_voltage"_a)
117  .def("connect", &CPS::SP::Ph1::Shunt::connect);
118 
119  py::class_<CPS::SP::Ph1::Load, std::shared_ptr<CPS::SP::Ph1::Load>,
120  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Load",
121  py::multiple_inheritance())
122  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
123  "loglevel"_a = CPS::Logger::Level::off)
124  .def("set_parameters", &CPS::SP::Ph1::Load::setParameters,
125  "active_power"_a, "reactive_power"_a, "nominal_voltage"_a)
126  .def("modify_power_flow_bus_type",
128  .def("connect", &CPS::SP::Ph1::Load::connect);
129 
130  py::class_<CPS::SP::Ph1::Switch, std::shared_ptr<CPS::SP::Ph1::Switch>,
132  mSPPh1, "Switch", py::multiple_inheritance())
133  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
134  "loglevel"_a = CPS::Logger::Level::off)
135  .def("set_parameters", &CPS::SP::Ph1::Switch::setParameters,
136  "open_resistance"_a, "closed_resistance"_a,
137  // cppcheck-suppress assignBoolToPointer
138  "closed"_a = false)
139  .def("open", &CPS::SP::Ph1::Switch::open)
140  .def("close", &CPS::SP::Ph1::Switch::close)
141  .def("connect", &CPS::SP::Ph1::Switch::connect);
142 
144  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator>,
145  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "SynchronGenerator",
146  py::multiple_inheritance())
147  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
148  "loglevel"_a = CPS::Logger::Level::off)
149  .def("set_parameters", (&CPS::SP::Ph1::SynchronGenerator::setParameters),
150  "rated_apparent_power"_a, "rated_voltage"_a,
151  "set_point_active_power"_a, "set_point_voltage"_a,
152  "powerflow_bus_type"_a, "set_point_reactive_power"_a = 0)
153  .def("set_base_voltage", &CPS::SP::Ph1::SynchronGenerator::setBaseVoltage,
154  "base_voltage"_a)
156  .def("modify_power_flow_bus_type",
158  "bus_type"_a)
159  .def("get_apparent_power",
161 
162  py::class_<CPS::SP::Ph1::varResSwitch,
163  std::shared_ptr<CPS::SP::Ph1::varResSwitch>,
165  mSPPh1, "varResSwitch", py::multiple_inheritance())
166  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
167  "loglevel"_a = CPS::Logger::Level::off)
168  .def("set_parameters", &CPS::SP::Ph1::varResSwitch::setParameters,
169  "open_resistance"_a, "closed_resistance"_a,
170  // cppcheck-suppress assignBoolToPointer
171  "closed"_a = false)
172  .def("open", &CPS::SP::Ph1::varResSwitch::open)
173  .def("close", &CPS::SP::Ph1::varResSwitch::close)
174  .def("set_init_parameters",
175  &CPS::SP::Ph1::varResSwitch::setInitParameters, "time_step"_a)
176  .def("connect", &CPS::SP::Ph1::varResSwitch::connect);
177 
179  std::shared_ptr<CPS::SP::Ph1::SynchronGeneratorTrStab>,
180  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "SynchronGeneratorTrStab",
181  py::multiple_inheritance())
182  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
183  "loglevel"_a = CPS::Logger::Level::off)
184  .def("set_standard_parameters_PU",
186  "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "Xpd"_a, "inertia"_a,
187  "Rs"_a = 0, "D"_a = 0)
188  .def("set_initial_values",
189  &CPS::SP::Ph1::SynchronGeneratorTrStab::setInitialValues,
190  "elec_power"_a, "mech_power"_a)
192  .def("set_model_flags",
194  "convert_with_omega_mech"_a)
195  .def(
196  "set_reference_omega",
198  std::string refOmegaName, CPS::IdentifiedObject::Ptr refOmegaComp,
199  std::string refDeltaName,
200  CPS::IdentifiedObject::Ptr refDeltaComp) {
201  gen.setReferenceOmega(
202  refOmegaComp->attributeTyped<CPS::Real>(refOmegaName),
203  refDeltaComp->attributeTyped<CPS::Real>(refDeltaName));
204  },
205  "ref_omega_name"_a = "w_r", "ref_omage_comp"_a,
206  "ref_delta_name"_a = "delta_r", "ref_delta_comp"_a);
207 
209  std::shared_ptr<CPS::SP::Ph1::ReducedOrderSynchronGeneratorVBR>,
211  mSPPh1, "ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
212 
214  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator3OrderVBR>,
216  mSPPh1, "SynchronGenerator3OrderVBR", py::multiple_inheritance())
217  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
218  "loglevel"_a = CPS::Logger::Level::off)
219  .def("set_operational_parameters_per_unit",
220  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
221  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
222  CPS::Real>(
224  setOperationalParametersPerUnit),
225  "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
226  "Lq"_a, "L0"_a, "Ld_t"_a, "Td0_t"_a)
228 
230  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator4OrderVBR>,
232  mSPPh1, "SynchronGenerator4OrderVBR", py::multiple_inheritance())
233  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
234  "loglevel"_a = CPS::Logger::Level::off)
235  .def("set_operational_parameters_per_unit",
236  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
237  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
238  CPS::Real, CPS::Real, CPS::Real>(
240  setOperationalParametersPerUnit),
241  "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
242  "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
244 
246  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator5OrderVBR>,
248  mSPPh1, "SynchronGenerator5OrderVBR", py::multiple_inheritance())
249  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
250  "loglevel"_a = CPS::Logger::Level::off)
251  .def("set_operational_parameters_per_unit",
252  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
253  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
254  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
255  CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
257  setOperationalParametersPerUnit),
258  "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
259  "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
260  "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
262 
264  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator6aOrderVBR>,
266  mSPPh1, "SynchronGenerator6aOrderVBR", py::multiple_inheritance())
267  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
268  "loglevel"_a = CPS::Logger::Level::off)
269  .def("set_operational_parameters_per_unit",
270  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
271  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
272  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
273  CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
275  setOperationalParametersPerUnit),
276  "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
277  "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
278  "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
280 
282  std::shared_ptr<CPS::SP::Ph1::SynchronGenerator6bOrderVBR>,
284  mSPPh1, "SynchronGenerator6bOrderVBR", py::multiple_inheritance())
285  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
286  "loglevel"_a = CPS::Logger::Level::off)
287  .def("set_operational_parameters_per_unit",
288  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
289  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
290  CPS::Real, CPS::Real, CPS::Real, CPS::Real,
291  CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
293  setOperationalParametersPerUnit),
294  "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
295  "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
296  "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a = 0)
298 
300  std::shared_ptr<CPS::SP::Ph1::AvVoltageSourceInverterDQ>,
302  mSPPh1, "AvVoltageSourceInverterDQ", py::multiple_inheritance())
303  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
304  "loglevel"_a = CPS::Logger::Level::off)
305  .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
306  "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
307  // cppcheck-suppress assignBoolToPointer
308  "with_trafo"_a = false)
309  .def("set_parameters",
311  "sys_omega"_a, "sys_volt_nom"_a, "p_ref"_a, "q_ref"_a)
312  .def("set_filter_parameters",
314  "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a)
315  .def("set_controller_parameters",
317  "Kp_pll"_a, "Ki_pll"_a, "Kp_power_ctrl"_a, "Ki_power_ctrl"_a,
318  "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a, "omega_cutoff"_a)
319  .def("set_transformer_parameters",
321  "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
322  "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
323  .def("set_initial_state_values",
325  "p_init"_a, "q_init"_a, "phi_d_init"_a, "phi_q_init"_a,
326  "gamma_d_init"_a, "gamma_q_init"_a)
327  .def("with_control",
328  &CPS::SP::Ph1::AvVoltageSourceInverterDQ::withControl)
330 
331  py::class_<CPS::SP::Ph1::Transformer,
332  std::shared_ptr<CPS::SP::Ph1::Transformer>,
333  CPS::SimPowerComp<CPS::Complex>>(mSPPh1, "Transformer",
334  py::multiple_inheritance())
335  .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
336  "loglevel"_a = CPS::Logger::Level::off)
337  .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
338  "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
339  // cppcheck-suppress assignBoolToPointer
340  "with_resistive_losses"_a = false)
341  .def("set_parameters",
342  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
343  CPS::Real, CPS::Real>(
345  "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "ratio_abs"_a,
346  "ratio_phase"_a, "resistance"_a, "inductance"_a)
347  .def("set_parameters",
348  py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
349  CPS::Real, CPS::Real, CPS::Real>(
351  "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
352  "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
353  .def("set_base_voltage", &CPS::SP::Ph1::Transformer::setBaseVoltage,
354  "base_voltage"_a)
355  .def("connect", &CPS::SP::Ph1::Transformer::connect);
356 }
357 
358 void addSPPh3Components(py::module_ mSPPh3) {
359  py::class_<CPS::SP::Ph3::VoltageSource,
360  std::shared_ptr<CPS::SP::Ph3::VoltageSource>,
361  CPS::SimPowerComp<CPS::Complex>>(mSPPh3, "VoltageSource",
362  py::multiple_inheritance())
363  .def(py::init<std::string>())
364  .def(py::init<std::string, CPS::Logger::Level>())
365  .def("set_parameters", &CPS::SP::Ph3::VoltageSource::setParameters,
366  "V_ref"_a)
367  .def("connect", &CPS::SP::Ph3::VoltageSource::connect)
368  .def_property("V_ref", createAttributeGetter<CPS::MatrixComp>("V_ref"),
369  createAttributeSetter<CPS::MatrixComp>("V_ref"))
370  .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
371  createAttributeSetter<CPS::Real>("f_src"));
372 
373  py::class_<CPS::SP::Ph3::Resistor, std::shared_ptr<CPS::SP::Ph3::Resistor>,
374  CPS::SimPowerComp<CPS::Complex>>(mSPPh3, "Resistor",
375  py::multiple_inheritance())
376  .def(py::init<std::string>())
377  .def(py::init<std::string, CPS::Logger::Level>())
378  .def("set_parameters", &CPS::SP::Ph3::Resistor::setParameters, "R"_a)
379  .def("connect", &CPS::SP::Ph3::Resistor::connect);
380 
381  py::class_<CPS::SP::Ph3::Capacitor, std::shared_ptr<CPS::SP::Ph3::Capacitor>,
382  CPS::SimPowerComp<CPS::Complex>>(mSPPh3, "Capacitor",
383  py::multiple_inheritance())
384  .def(py::init<std::string>())
385  .def(py::init<std::string, CPS::Logger::Level>())
386  .def("set_parameters", &CPS::SP::Ph3::Capacitor::setParameters, "C"_a)
387  .def("connect", &CPS::SP::Ph3::Capacitor::connect);
388 
389  py::class_<CPS::SP::Ph3::Inductor, std::shared_ptr<CPS::SP::Ph3::Inductor>,
390  CPS::SimPowerComp<CPS::Complex>>(mSPPh3, "Inductor",
391  py::multiple_inheritance())
392  .def(py::init<std::string>())
393  .def(py::init<std::string, CPS::Logger::Level>())
394  .def("set_parameters", &CPS::SP::Ph3::Inductor::setParameters, "L"_a)
395  .def("connect", &CPS::SP::Ph3::Inductor::connect);
396 }
void setParameters(Real capacitance)
Sets model specific parameters.
void setParameters(Real inductance)
Sets model specific parameters.
Dynamic Phasor Three-Phase Switch.
void close()
Close switch.
void open()
Open switch.
void setParameters(Matrix capacitance)
Sets model specific parameters.
void setParameters(Matrix inductance)
Sets model specific parameters.
void setParameters(Matrix resistance)
Sets model specific parameters.
void setInitialStateValues(Real pInit, Real qInit, Real phi_dInit, Real phi_qInit, Real gamma_dInit, Real gamma_qInit)
Setter for initial values applied in controllers.
void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref)
Setter for general parameters of inverter.
void setFilterParameters(Real Lf, Real Cf, Real Rf, Real Rc)
Setter for parameters of filter.
void setControllerParameters(Real Kp_pll, Real Ki_pll, Real Kp_powerCtrl, Real Ki_powerCtrl, Real Kp_currCtrl, Real Ki_currCtrl, Real Omega_cutoff)
Setter for parameters of control loops.
void setTransformerParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
Setter for parameters of transformer.
void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override
Modify powerflow bus type.
Definition: SP_Ph1_Load.cpp:63
void setParameters(Real vSetPointPerUnit)
Set parameters relevant for PF solver.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override
Modify powerflow bus type.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
Base class for SP VBR synchronous generator model single phase.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Voltage-Behind-Reactance (VBR) implementation of 3rd order synchronous generator model.
Voltage-Behind-Reactance (VBR) implementation of 4th order synchronous generator model.
Voltage-Behind-Reactance (VBR) implementation of 5th type 2 order synchronous generator model Ref: Mi...
Voltage-Behind-Reactance (VBR) implementation of 6th order synchronous generator model Marconato's mo...
Voltage-Behind-Reactance (VBR) implementation of 6th order synchronous generator model Anderson-Fouad...
void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override
Modify powerflow bus type.
Complex getApparentPower() const
Get Apparent power of Powerflow solution.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void setParameters(Real ratedApparentPower, Real ratedVoltage, Real setPointActivePower, Real setPointVoltage, PowerflowBusType powerflowBusType, Real setPointReactivepower=0)
Setter for synchronous generator parameters.
Synchronous generator model for transient stability analysis.
void setModelFlags(Bool convertWithOmegaMech)
Flags to modify model behavior.
void setStandardParametersPU(Real nomPower, Real nomVolt, Real nomFreq, Real Xpd, Real inertia, Real Rs=0, Real D=0)
Initializes the machine parameters.
Transformer that includes an inductance and resistance.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
Set transformer specific parameters (without rated power)
Ideal Voltage source model.
void setParameters(Complex voltageRef, Real srcFreq=0.0)
Switch with variable resistance to avoid numerical oscillations, when an inductive current is suddenl...
Ideal Voltage source model.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17
void connect(typename SimNode< Complex >::List nodes)
Sets all nodes and checks for nominal number of Nodes for this Component.