DPsim
Loading...
Searching...
No Matches
DPComponents.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/DPComponents.h>
15#include <dpsim/pybind/Utils.h>
16
17namespace py = pybind11;
18using namespace pybind11::literals;
19
20void addDPComponents(py::module_ mDP) {
21 py::class_<CPS::DP::SimNode, std::shared_ptr<CPS::DP::SimNode>,
22 CPS::TopologicalNode>(mDP, "SimNode", py::module_local())
23 .def(py::init<std::string>())
24 .def(py::init<std::string, CPS::PhaseType>())
25 .def(py::init<std::string, CPS::PhaseType,
26 const std::vector<CPS::Complex>>())
27 .def("set_initial_voltage",
28 py::overload_cast<CPS::MatrixComp>(
29 &CPS::DP::SimNode::setInitialVoltage, py::const_))
30 .def("set_initial_voltage",
31 py::overload_cast<CPS::Complex>(&CPS::DP::SimNode::setInitialVoltage,
32 py::const_))
33 .def("set_initial_voltage",
34 py::overload_cast<CPS::Complex, int>(
35 &CPS::DP::SimNode::setInitialVoltage, py::const_))
36 .def("single_voltage", &CPS::DP::SimNode::singleVoltage,
37 "phase_type"_a = CPS::PhaseType::Single)
38 .def_readonly_static("gnd", &CPS::DP::SimNode::GND);
39
40 py::module mDPPh1 =
41 mDP.def_submodule("ph1", "single phase dynamic phasor models");
42 addDPPh1Components(mDPPh1);
43
44 py::module mDPPh3 =
45 mDP.def_submodule("ph3", "triple phase dynamic phasor models");
46 addDPPh3Components(mDPPh3);
47}
48
49void addDPPh1Components(py::module_ mDPPh1) {
51 std::shared_ptr<CPS::DP::Ph1::VoltageSource>,
52 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "VoltageSource",
53 py::multiple_inheritance())
54 .def(py::init<std::string>())
55 .def(py::init<std::string, CPS::Logger::Level>())
56 .def("set_parameters",
57 py::overload_cast<CPS::Complex, CPS::Real>(
59 "V_ref"_a, "f_src"_a = 0)
61 .def_property("V_ref", createAttributeGetter<CPS::Complex>("V_ref"),
62 createAttributeSetter<CPS::Complex>("V_ref"))
63 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
64 createAttributeSetter<CPS::Real>("f_src"));
65
67 std::shared_ptr<CPS::DP::Ph1::VoltageSourceNorton>,
68 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "VoltageSourceNorton",
69 py::multiple_inheritance())
70 .def(py::init<std::string>())
71 .def(py::init<std::string, CPS::Logger::Level>())
72 .def("set_parameters",
73 static_cast<void (CPS::Base::Ph1::VoltageSource::*)(CPS::Complex,
74 CPS::Real)>(
76 py::arg("voltageRef"), py::arg("srcFreq") = -1)
77 .def("set_parameters",
78 static_cast<void (CPS::DP::Ph1::VoltageSourceNorton::*)(
79 CPS::Complex, CPS::Real, CPS::Real)>(
81 py::arg("voltageRef"), py::arg("srcFreq") = -1,
82 py::arg("resistance") = 1e9)
84
86 std::shared_ptr<CPS::DP::Ph1::CurrentSource>,
87 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "CurrentSource",
88 py::multiple_inheritance())
89 .def(py::init<std::string>())
90 .def(py::init<std::string, CPS::Logger::Level>())
91 .def("set_parameters", &CPS::DP::Ph1::CurrentSource::setParameters,
92 "I_ref"_a)
94 .def_property("I_ref", createAttributeGetter<CPS::Complex>("I_ref"),
95 createAttributeSetter<CPS::Complex>("I_ref"));
96
97 py::class_<CPS::DP::Ph1::Resistor, std::shared_ptr<CPS::DP::Ph1::Resistor>,
98 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "Resistor",
99 py::multiple_inheritance())
100 .def(py::init<std::string>())
101 .def(py::init<std::string, CPS::Logger::Level>())
102 .def("set_parameters", &CPS::DP::Ph1::Resistor::setParameters, "R"_a)
103 .def("connect", &CPS::DP::Ph1::Resistor::connect)
104 .def_property("R", createAttributeGetter<CPS::Real>("R"),
105 createAttributeSetter<CPS::Real>("R"));
106
107 py::class_<CPS::DP::Ph1::Capacitor, std::shared_ptr<CPS::DP::Ph1::Capacitor>,
108 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "Capacitor",
109 py::multiple_inheritance())
110 .def(py::init<std::string>())
111 .def(py::init<std::string, CPS::Logger::Level>())
112 .def("set_parameters", &CPS::DP::Ph1::Capacitor::setParameters, "C"_a)
113 .def("connect", &CPS::DP::Ph1::Capacitor::connect)
114 .def_property("C", createAttributeGetter<CPS::Real>("C"),
115 createAttributeSetter<CPS::Real>("C"));
116
117 py::class_<CPS::DP::Ph1::Inductor, std::shared_ptr<CPS::DP::Ph1::Inductor>,
118 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "Inductor",
119 py::multiple_inheritance())
120 .def(py::init<std::string>())
121 .def(py::init<std::string, CPS::Logger::Level>())
122 .def("set_parameters", &CPS::DP::Ph1::Inductor::setParameters, "L"_a)
123 .def("connect", &CPS::DP::Ph1::Inductor::connect)
124 .def_property("L", createAttributeGetter<CPS::Real>("L"),
125 createAttributeSetter<CPS::Real>("L"));
126
128 std::shared_ptr<CPS::DP::Ph1::NetworkInjection>,
129 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "NetworkInjection",
130 py::multiple_inheritance())
131 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
132 "loglevel"_a = CPS::Logger::Level::off)
133 .def("set_parameters",
134 py::overload_cast<CPS::Complex, CPS::Real>(
136 "V_ref"_a, "f_src"_a = 0)
138
139 py::class_<CPS::DP::Ph1::PiLine, std::shared_ptr<CPS::DP::Ph1::PiLine>,
140 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "PiLine",
141 py::multiple_inheritance())
142 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
143 "loglevel"_a = CPS::Logger::Level::off)
144 .def("set_parameters", &CPS::DP::Ph1::PiLine::setParameters,
145 "series_resistance"_a, "series_inductance"_a,
146 "parallel_capacitance"_a = 0, "parallel_conductance"_a = 0)
147 .def("connect", &CPS::DP::Ph1::PiLine::connect);
148
149 py::class_<CPS::DP::Ph1::RXLoad, std::shared_ptr<CPS::DP::Ph1::RXLoad>,
150 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "RXLoad",
151 py::multiple_inheritance())
152 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
153 "loglevel"_a = CPS::Logger::Level::off)
154 .def("set_parameters", &CPS::DP::Ph1::RXLoad::setParameters,
155 "active_power"_a, "reactive_power"_a, "volt"_a)
156 .def("connect", &CPS::DP::Ph1::RXLoad::connect);
157
158 py::class_<CPS::DP::Ph1::Switch, std::shared_ptr<CPS::DP::Ph1::Switch>,
160 mDPPh1, "Switch", py::multiple_inheritance())
161 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
162 "loglevel"_a = CPS::Logger::Level::off)
163 .def("set_parameters", &CPS::DP::Ph1::Switch::setParameters,
164 "open_resistance"_a, "closed_resistance"_a,
165 // cppcheck-suppress assignBoolToPointer
166 "closed"_a = false)
167 .def("open", &CPS::DP::Ph1::Switch::open)
168 .def("close", &CPS::DP::Ph1::Switch::close)
169 .def("connect", &CPS::DP::Ph1::Switch::connect);
170
172 std::shared_ptr<CPS::DP::Ph1::varResSwitch>,
174 mDPPh1, "varResSwitch", py::multiple_inheritance())
175 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
176 "loglevel"_a = CPS::Logger::Level::off)
177 .def("set_parameters", &CPS::DP::Ph1::varResSwitch::setParameters,
178 "open_resistance"_a, "closed_resistance"_a,
179 // cppcheck-suppress assignBoolToPointer
180 "closed"_a = false)
183 .def("set_init_parameters",
184 &CPS::DP::Ph1::varResSwitch::setInitParameters, "time_step"_a)
185 .def("connect", &CPS::DP::Ph1::varResSwitch::connect);
186
188 std::shared_ptr<CPS::DP::Ph1::SynchronGeneratorTrStab>,
189 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "SynchronGeneratorTrStab",
190 py::multiple_inheritance())
191 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
192 "loglevel"_a = CPS::Logger::Level::off)
193 .def("set_standard_parameters_PU",
195 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "Xpd"_a, "inertia"_a,
196 "Rs"_a = 0, "D"_a = 0)
197 .def("set_fundamental_parameters_PU",
199 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "Ll"_a, "Lmd"_a, "Llfd"_a,
200 "H"_a, "D"_a = 0)
201 .def("set_initial_values",
202 &CPS::DP::Ph1::SynchronGeneratorTrStab::setInitialValues,
203 "elec_power"_a, "mech_power"_a)
205 .def("set_model_flags",
207 "convert_with_omega_mech"_a)
208 .def(
209 "set_reference_omega",
211 std::string refOmegaName, CPS::IdentifiedObject::Ptr refOmegaComp,
212 std::string refDeltaName,
213 CPS::IdentifiedObject::Ptr refDeltaComp) {
214 gen.setReferenceOmega(
215 refOmegaComp->attributeTyped<CPS::Real>(refOmegaName),
216 refDeltaComp->attributeTyped<CPS::Real>(refDeltaName));
217 },
218 "ref_omega_name"_a = "w_r", "ref_omage_comp"_a,
219 "ref_delta_name"_a = "delta_r", "ref_delta_comp"_a);
220
222 std::shared_ptr<CPS::DP::Ph1::ReducedOrderSynchronGeneratorVBR>,
224 mDPPh1, "ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
225
227 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator3OrderVBR>,
229 mDPPh1, "SynchronGenerator3OrderVBR", py::multiple_inheritance())
230 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
231 "loglevel"_a = CPS::Logger::Level::off)
232 .def("set_operational_parameters_per_unit",
233 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
234 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
235 CPS::Real>(
237 setOperationalParametersPerUnit),
238 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
239 "Lq"_a, "L0"_a, "Ld_t"_a, "Td0_t"_a)
241
243 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator4OrderVBR>,
245 mDPPh1, "SynchronGenerator4OrderVBR", py::multiple_inheritance())
246 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
247 "loglevel"_a = CPS::Logger::Level::off)
248 .def("set_operational_parameters_per_unit",
249 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
250 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
251 CPS::Real, CPS::Real, CPS::Real>(
253 setOperationalParametersPerUnit),
254 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
255 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
257
259 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator5OrderVBR>,
261 mDPPh1, "SynchronGenerator5OrderVBR", py::multiple_inheritance())
262 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
263 "loglevel"_a = CPS::Logger::Level::off)
264 .def("set_operational_parameters_per_unit",
265 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
266 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
267 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
268 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
270 setOperationalParametersPerUnit),
271 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
272 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
273 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
275
277 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator6aOrderVBR>,
279 mDPPh1, "SynchronGenerator6aOrderVBR", py::multiple_inheritance())
280 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
281 "loglevel"_a = CPS::Logger::Level::off)
282 .def("set_operational_parameters_per_unit",
283 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
284 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
285 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
286 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
288 setOperationalParametersPerUnit),
289 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
290 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
291 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
293
295 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator6bOrderVBR>,
297 mDPPh1, "SynchronGenerator6bOrderVBR", py::multiple_inheritance())
298 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
299 "loglevel"_a = CPS::Logger::Level::off)
300 .def("set_operational_parameters_per_unit",
301 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
302 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
303 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
304 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
306 setOperationalParametersPerUnit),
307 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
308 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
309 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a = 0)
311
313 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator4OrderTPM>,
315 CPS::MNASyncGenInterface>(mDPPh1, "SynchronGenerator4OrderTPM",
316 py::multiple_inheritance())
317 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
318 "loglevel"_a = CPS::Logger::Level::off)
319 .def("set_operational_parameters_per_unit",
320 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
321 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
322 CPS::Real, CPS::Real, CPS::Real>(
324 setOperationalParametersPerUnit),
325 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
326 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
328
330 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator4OrderPCM>,
332 CPS::MNASyncGenInterface>(mDPPh1, "SynchronGenerator4OrderPCM",
333 py::multiple_inheritance())
334 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
335 "loglevel"_a = CPS::Logger::Level::off)
336 .def("set_operational_parameters_per_unit",
337 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
338 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
339 CPS::Real, CPS::Real, CPS::Real>(
341 setOperationalParametersPerUnit),
342 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
343 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
345
347 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator6OrderPCM>,
349 CPS::MNASyncGenInterface>(mDPPh1, "SynchronGenerator6OrderPCM",
350 py::multiple_inheritance())
351 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
352 "loglevel"_a = CPS::Logger::Level::off)
353 .def("set_operational_parameters_per_unit",
354 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
355 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
356 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
357 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
359 setOperationalParametersPerUnit),
360 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
361 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
362 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a = 0)
364
366 std::shared_ptr<CPS::DP::Ph1::AvVoltageSourceInverterDQ>,
368 mDPPh1, "AvVoltageSourceInverterDQ", py::multiple_inheritance())
369 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
370 "loglevel"_a = CPS::Logger::Level::off)
371 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
372 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
373 // cppcheck-suppress assignBoolToPointer
374 "with_trafo"_a = false)
375 .def("set_parameters",
377 "sys_omega"_a, "sys_volt_nom"_a, "p_ref"_a, "q_ref"_a)
378 .def("set_filter_parameters",
380 "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a)
381 .def("set_controller_parameters",
383 "Kp_pll"_a, "Ki_pll"_a, "Kp_power_ctrl"_a, "Ki_power_ctrl"_a,
384 "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a, "omega_cutoff"_a)
385 .def("set_transformer_parameters",
387 "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
388 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
389 .def("set_initial_state_values",
391 "p_init"_a, "q_init"_a, "phi_d_init"_a, "phi_q_init"_a,
392 "gamma_d_init"_a, "gamma_q_init"_a)
393 .def("with_control",
394 &CPS::DP::Ph1::AvVoltageSourceInverterDQ::withControl)
396
397 py::class_<CPS::DP::Ph1::Inverter, std::shared_ptr<CPS::DP::Ph1::Inverter>,
398 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "Inverter",
399 py::multiple_inheritance())
400 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
401 "loglevel"_a = CPS::Logger::Level::off)
402 .def("set_parameters", &CPS::DP::Ph1::Inverter::setParameters,
403 "carrier_harms"_a, "modul_harms"_a, "input_voltage"_a, "ratio"_a,
404 "phase"_a)
405 .def("connect", &CPS::DP::Ph1::Inverter::connect);
406
407 py::class_<CPS::DP::Ph1::Transformer,
408 std::shared_ptr<CPS::DP::Ph1::Transformer>,
409 CPS::SimPowerComp<CPS::Complex>>(mDPPh1, "Transformer",
410 py::multiple_inheritance())
411 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
412 "loglevel"_a = CPS::Logger::Level::off)
413 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
414 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
415 // cppcheck-suppress assignBoolToPointer
416 "with_resistive_losses"_a = false)
417 .def("set_parameters",
418 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
419 CPS::Real, CPS::Real>(
421 "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "ratio_abs"_a,
422 "ratio_phase"_a, "resistance"_a, "inductance"_a)
423 .def("set_parameters",
424 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
425 CPS::Real, CPS::Real, CPS::Real>(
427 "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
428 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
429 .def("connect", &CPS::DP::Ph1::Transformer::connect);
430}
431
432void addDPPh3Components(py::module_ mDPPh3) {
433
434#ifdef WITH_SUNDIALS
435
437 std::shared_ptr<CPS::DP::Ph3::SynchronGeneratorDQODE>,
438 CPS::SimPowerComp<CPS::Complex>>(mDPPh3, "SynchronGeneratorDQODE",
439 py::multiple_inheritance())
440 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
441 "loglevel"_a = CPS::Logger::Level::off)
442 .def("set_parameters_fundamental_per_unit",
444 setParametersFundamentalPerUnit,
445 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
446 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
447 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
448 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
449 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
450 "init_mech_power"_a)
452
453#endif
454
456 std::shared_ptr<CPS::DP::Ph3::SynchronGeneratorDQTrapez>,
458 mDPPh3, "SynchronGeneratorDQTrapez", py::multiple_inheritance())
459 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
460 "loglevel"_a = CPS::Logger::Level::off)
461 .def("set_parameters_fundamental_per_unit",
463 setParametersFundamentalPerUnit,
464 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
465 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
466 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
467 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
468 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
469 "init_mech_power"_a)
471
473 std::shared_ptr<CPS::DP::Ph3::SeriesResistor>,
474 CPS::SimPowerComp<CPS::Complex>>(mDPPh3, "SeriesResistor",
475 py::multiple_inheritance())
476 .def(py::init<std::string>())
477 .def(py::init<std::string, CPS::Logger::Level>())
478 .def("set_parameters", &CPS::DP::Ph3::SeriesResistor::setParameters,
479 "R"_a)
481
483 std::shared_ptr<CPS::DP::Ph3::SeriesSwitch>,
485 mDPPh3, "SeriesSwitch", py::multiple_inheritance())
486 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
487 "loglevel"_a = CPS::Logger::Level::off)
488 .def("set_parameters", &CPS::DP::Ph3::SeriesSwitch::setParameters,
489 "open_resistance"_a, "closed_resistance"_a,
490 // cppcheck-suppress assignBoolToPointer
491 "closed"_a = false)
494 .def("connect", &CPS::DP::Ph3::SeriesSwitch::connect);
495}
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(Complex voltageRef, Real srcFreq=-1)
Sets model specific parameters.
void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref)
Setter for general parameters of inverter.
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 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 setFilterParameters(Real Lf, Real Cf, Real Rf, Real Rc)
Setter for parameters of filter.
Dynamic phasor ideal current source.
void setParameters(Complex voltageRef, Real srcFreq=0.0)
void setParameters(Real activePower, Real ReactivePower, Real volt)
Set model specific parameters.
Base class for DP VBR synchronous generator model single phase.
Voltage-Behind-Reactance (VBR) implementation of 3rd order synchronous generator model.
4 Order Synchronous generator model for transient stability analysis
4 Order Synchronous generator model for transient stability analysis
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...
6 Order Synchronous generator model for transient stability analysis
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 - Fou...
Synchronous generator model for transient stability analysis.
void setStandardParametersPU(Real nomPower, Real nomVolt, Real nomFreq, Real Xpd, Real inertia, Real Rs=0, Real D=0)
Initializes the machine parameters.
void setModelFlags(Bool convertWithOmegaMech)
Flags to modify model behavior.
void setFundamentalParametersPU(Real nomPower, Real nomVolt, Real nomFreq, Real Ll, Real Lmd, Real Llfd, Real inertia, Real D=0)
Initializes the machine parameters.
Transformer that includes an inductance and resistance.
void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
Defines component parameters.
Ideal Voltage source model.
void setParameters(Complex voltageRef, Real srcFreq=0.0)
Resistive dynamic phasor voltage source.
void setParameters(Complex voltage, Real srcFreq=-1, Real resistance=1e9)
THISISBAD: This declaration and Base::Ph1::VoltageSource::setParameters(Complex, Real) are ambiguous ...
Switch with variable resistance to avoid numerical oscillations, when an inductive current is suddenl...
Dynamic phasor three-phase switch.
Interface to be used by synchronous generators.
Base class for all components that are transmitting power.
void connect(typename SimNode< Complex >::List nodes)