DPsim
Loading...
Searching...
No Matches
EMTComponents.cpp
Go to the documentation of this file.
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>
19#include <dpsim/Simulation.h>
21#include <dpsim/pybind/Utils.h>
22
23#ifdef WITH_JSON
24#include <nlohmann/json.hpp>
25using json = nlohmann::json;
26#endif
27
28namespace py = pybind11;
29using namespace pybind11::literals;
30
31namespace {
32
33void addEMTDCComponents(py::module_ mEMTDC) {
34 py::class_<CPS::EMT::DC::VoltageSource,
35 std::shared_ptr<CPS::EMT::DC::VoltageSource>,
36 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "VoltageSource",
37 py::multiple_inheritance())
38 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
39 "loglevel"_a = CPS::Logger::Level::off)
40 .def("set_parameters", &CPS::EMT::DC::VoltageSource::setParameters,
41 "voltage"_a)
43 .def_property_readonly("V_ref",
45
46 py::class_<CPS::EMT::DC::CurrentSource,
47 std::shared_ptr<CPS::EMT::DC::CurrentSource>,
48 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "CurrentSource",
49 py::multiple_inheritance())
50 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
51 "loglevel"_a = CPS::Logger::Level::off)
52 .def("set_parameters", &CPS::EMT::DC::CurrentSource::setParameters,
53 "current"_a)
55 .def_property_readonly("I_ref",
57
58 py::class_<CPS::EMT::DC::Resistor, std::shared_ptr<CPS::EMT::DC::Resistor>,
59 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Resistor",
60 py::multiple_inheritance())
61 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
62 "loglevel"_a = CPS::Logger::Level::off)
63 .def("set_parameters", &CPS::EMT::DC::Resistor::setParameters,
64 "resistance"_a)
65 .def("connect", &CPS::EMT::DC::Resistor::connect)
66 .def_property_readonly("R", createAttributeGetter<CPS::Real>("R"));
67
68 py::class_<CPS::EMT::DC::Capacitor, std::shared_ptr<CPS::EMT::DC::Capacitor>,
69 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Capacitor",
70 py::multiple_inheritance())
71 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
72 "loglevel"_a = CPS::Logger::Level::off)
73 .def("set_parameters", &CPS::EMT::DC::Capacitor::setParameters,
74 "capacitance"_a)
75 .def("connect", &CPS::EMT::DC::Capacitor::connect)
76 .def_property_readonly("C", createAttributeGetter<CPS::Real>("C"))
77 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
78
79 py::class_<CPS::EMT::DC::Inductor, std::shared_ptr<CPS::EMT::DC::Inductor>,
80 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Inductor",
81 py::multiple_inheritance())
82 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
83 "loglevel"_a = CPS::Logger::Level::off)
84 .def("set_parameters", &CPS::EMT::DC::Inductor::setParameters,
85 "inductance"_a, "initial_current"_a = 0.0)
86 .def("connect", &CPS::EMT::DC::Inductor::connect)
87 .def_property_readonly("L", createAttributeGetter<CPS::Real>("L"))
88 .def_property_readonly("initial_current",
90 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
91
92 py::class_<CPS::EMT::DC::PiLine, std::shared_ptr<CPS::EMT::DC::PiLine>,
93 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "PiLine",
94 py::multiple_inheritance())
95 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
96 "loglevel"_a = CPS::Logger::Level::off)
97 .def("set_parameters", &CPS::EMT::DC::PiLine::setParameters,
98 "series_resistance"_a, "series_inductance"_a,
99 "parallel_capacitance"_a = 0.0, "parallel_conductance"_a = 0.0,
100 "initial_current"_a = 0.0)
101 .def("connect", &CPS::EMT::DC::PiLine::connect)
102 .def_property_readonly("series_resistance",
104 .def_property_readonly("series_inductance",
106 .def_property_readonly("parallel_capacitance",
108 .def_property_readonly("parallel_conductance",
110 .def_property_readonly("initial_current",
112}
113
114} // namespace
115
116void addEMTComponents(py::module_ mEMT) {
117 py::class_<CPS::EMT::SimNode, std::shared_ptr<CPS::EMT::SimNode>,
118 CPS::TopologicalNode>(mEMT, "SimNode", py::module_local())
119 .def(py::init<std::string>())
120 .def(py::init<std::string, CPS::PhaseType>())
121 .def(py::init<std::string, CPS::PhaseType,
122 const std::vector<CPS::Complex>>())
123 .def("set_initial_voltage",
124 py::overload_cast<CPS::MatrixComp>(
126 .def("set_initial_voltage",
127 py::overload_cast<CPS::Complex>(
129 .def("set_initial_voltage",
130 py::overload_cast<CPS::Complex, int>(
132 .def_readonly_static("gnd", &CPS::EMT::SimNode::GND);
133
134 py::module_ mEMTDC =
135 mEMT.def_submodule("dc", "scalar electromagnetic-transient DC models");
136 addEMTDCComponents(mEMTDC);
137
138 py::module mEMTPh1 = mEMT.def_submodule(
139 "ph1", "single phase electromagnetic-transient models");
140 addEMTPh1Components(mEMTPh1);
141 py::module mEMTPh3 =
142 mEMT.def_submodule("ph3", "three phase electromagnetic-transient models");
143 addEMTPh3Components(mEMTPh3);
144}
145
146void addEMTPh1Components(py::module_ mEMTPh1) {
148 std::shared_ptr<CPS::EMT::Ph1::CurrentSource>,
149 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "CurrentSource",
150 py::multiple_inheritance())
151 .def(py::init<std::string>())
152 .def(py::init<std::string, CPS::Logger::Level>())
153 .def("set_parameters", &CPS::EMT::Ph1::CurrentSource::setParameters,
154 "I_ref"_a, "f_src"_a = -1)
156 .def_property("I_ref", createAttributeGetter<CPS::Complex>("I_ref"),
158 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
160
162 std::shared_ptr<CPS::EMT::Ph1::VoltageSource>,
163 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "VoltageSource",
164 py::multiple_inheritance())
165 .def(py::init<std::string>())
166 .def(py::init<std::string, CPS::Logger::Level>())
167 .def("set_parameters", &CPS::EMT::Ph1::VoltageSource::setParameters,
168 "V_ref"_a, "f_src"_a = -1)
170 .def_property("V_ref", createAttributeGetter<CPS::Complex>("V_ref"),
172 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
174
175 py::class_<CPS::EMT::Ph1::Resistor, std::shared_ptr<CPS::EMT::Ph1::Resistor>,
176 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Resistor",
177 py::multiple_inheritance())
178 .def(py::init<std::string>())
179 .def(py::init<std::string, CPS::Logger::Level>())
180 .def("set_parameters", &CPS::EMT::Ph1::Resistor::setParameters, "R"_a)
181 .def("connect", &CPS::EMT::Ph1::Resistor::connect)
182 .def_property("R", createAttributeGetter<CPS::Real>("R"),
184
185 py::class_<CPS::EMT::Ph1::Capacitor,
186 std::shared_ptr<CPS::EMT::Ph1::Capacitor>,
187 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Capacitor",
188 py::multiple_inheritance())
189 .def(py::init<std::string>())
190 .def(py::init<std::string, CPS::Logger::Level>())
191 .def("set_parameters", &CPS::EMT::Ph1::Capacitor::setParameters, "C"_a)
192 .def("connect", &CPS::EMT::Ph1::Capacitor::connect)
193 .def_property("C", createAttributeGetter<CPS::Real>("C"),
195
196 py::class_<CPS::EMT::Ph1::Inductor, std::shared_ptr<CPS::EMT::Ph1::Inductor>,
197 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Inductor",
198 py::multiple_inheritance())
199 .def(py::init<std::string>())
200 .def(py::init<std::string, CPS::Logger::Level>())
201 .def("set_parameters", &CPS::EMT::Ph1::Inductor::setParameters, "L"_a)
202 .def("connect", &CPS::EMT::Ph1::Inductor::connect)
203 .def_property("L", createAttributeGetter<CPS::Real>("L"),
205
206 py::class_<CPS::EMT::Ph1::Switch, std::shared_ptr<CPS::EMT::Ph1::Switch>,
208 mEMTPh1, "Switch", py::multiple_inheritance())
209 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
210 "loglevel"_a = CPS::Logger::Level::off)
211 .def("set_parameters", &CPS::EMT::Ph1::Switch::setParameters,
212 "open_resistance"_a, "closed_resistance"_a,
213 "closed"_a = false) // cppcheck-suppress assignBoolToPointer
214 .def("open", &CPS::EMT::Ph1::Switch::open)
215 .def("close", &CPS::EMT::Ph1::Switch::close)
216 .def("connect", &CPS::EMT::Ph1::Switch::connect);
217
219 std::shared_ptr<CPS::EMT::Ph1::SSN::Full_Serial_RLC>,
220 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Full_Serial_RLC",
221 py::multiple_inheritance())
222 .def(py::init<std::string>())
223 .def(py::init<std::string, CPS::Logger::Level>())
224 .def("set_parameters",
226 "C"_a)
228 .def_property("R", createAttributeGetter<CPS::Real>("R"),
230 .def_property("L", createAttributeGetter<CPS::Real>("L"),
232 .def_property("C", createAttributeGetter<CPS::Real>("C"),
234
235 py::class_<CPS::EMT::Ph1::SSNTypeI2T,
236 std::shared_ptr<CPS::EMT::Ph1::SSNTypeI2T>,
237 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "SSNTypeI2T",
238 py::multiple_inheritance())
239 .def(py::init<std::string>())
240 .def(py::init<std::string, CPS::Logger::Level>())
241 .def("set_parameters", &CPS::EMT::Ph1::SSNTypeI2T::setParameters, "A"_a,
242 "B"_a, "C"_a, "D"_a)
243 .def("manual_init", &CPS::EMT::Ph1::SSNTypeI2T::manualInit,
244 "initialState"_a, "initialInput"_a, "initialOldInput"_a,
245 "initCurr"_a, "initVol"_a)
246 .def("connect", &CPS::EMT::Ph1::SSNTypeI2T::connect)
247 .def_property("mA", createAttributeGetter<CPS::Matrix>("mA"),
249 .def_property("mB", createAttributeGetter<CPS::Matrix>("mB"),
251 .def_property("mC", createAttributeGetter<CPS::Matrix>("mC"),
253 .def_property("mD", createAttributeGetter<CPS::Matrix>("mD"),
255 .def_property("mdA", createAttributeGetter<CPS::Matrix>("mdA"),
257 .def_property("mdB", createAttributeGetter<CPS::Matrix>("mdB"),
259 .def_property("mdC", createAttributeGetter<CPS::Matrix>("mdC"),
261
262 py::class_<CPS::EMT::Ph1::SSNTypeV2T,
263 std::shared_ptr<CPS::EMT::Ph1::SSNTypeV2T>,
264 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "SSNTypeV2T",
265 py::multiple_inheritance())
266 .def(py::init<std::string>())
267 .def(py::init<std::string, CPS::Logger::Level>())
268 .def("set_parameters", &CPS::EMT::Ph1::SSNTypeV2T::setParameters, "A"_a,
269 "B"_a, "C"_a, "D"_a)
270 .def("manual_init", &CPS::EMT::Ph1::SSNTypeV2T::manualInit,
271 "initialState"_a, "initialInput"_a, "initialOldInput"_a,
272 "initCurr"_a, "initVol"_a)
273 .def("connect", &CPS::EMT::Ph1::SSNTypeV2T::connect)
274 .def_property("mA", createAttributeGetter<CPS::Matrix>("mA"),
276 .def_property("mB", createAttributeGetter<CPS::Matrix>("mB"),
278 .def_property("mC", createAttributeGetter<CPS::Matrix>("mC"),
280 .def_property("mD", createAttributeGetter<CPS::Matrix>("mD"),
282 .def_property("mdA", createAttributeGetter<CPS::Matrix>("mdA"),
284 .def_property("mdB", createAttributeGetter<CPS::Matrix>("mdB"),
286 .def_property("mdC", createAttributeGetter<CPS::Matrix>("mdC"),
288}
289
290void addEMTPh3Components(py::module_ mEMTPh3) {
292 std::shared_ptr<CPS::EMT::Ph3::VoltageSource>,
293 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "VoltageSource",
294 py::multiple_inheritance())
295 .def(py::init<std::string>())
296 .def(py::init<std::string, CPS::Logger::Level>())
297 .def("set_parameters",
298 py::overload_cast<CPS::MatrixComp, CPS::Real>(
300 "V_ref"_a, "f_src"_a = 50)
302 .def_property("V_ref", createAttributeGetter<CPS::MatrixComp>("V_ref"),
304 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
306
308 std::shared_ptr<CPS::EMT::Ph3::ControlledVoltageSource>,
309 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "ControlledVoltageSource",
310 py::multiple_inheritance())
311 .def(py::init<std::string>())
312 .def(py::init<std::string, CPS::Logger::Level>())
313 .def("set_parameters",
314 py::overload_cast<CPS::Matrix>(
316 "V_ref"_a)
318 .def_property("V_ref", createAttributeGetter<CPS::MatrixComp>("V_ref"),
320
322 std::shared_ptr<CPS::EMT::Ph3::CurrentSource>,
323 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "CurrentSource",
324 py::multiple_inheritance())
325 .def(py::init<std::string>())
326 .def(py::init<std::string, CPS::Logger::Level>())
327 .def("set_parameters",
328 py::overload_cast<CPS::MatrixComp, CPS::Real>(
330 "I_ref"_a, "f_src"_a = 50)
332 .def_property("I_ref", createAttributeGetter<CPS::MatrixComp>("I_ref"),
334 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
336
337 py::class_<CPS::EMT::Ph3::Resistor, std::shared_ptr<CPS::EMT::Ph3::Resistor>,
338 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Resistor",
339 py::multiple_inheritance())
340 .def(py::init<std::string>())
341 .def(py::init<std::string, CPS::Logger::Level>())
342 .def("set_parameters", &CPS::EMT::Ph3::Resistor::setParameters, "R"_a)
343 .def("connect", &CPS::EMT::Ph3::Resistor::connect);
344
345 py::class_<CPS::EMT::Ph3::Capacitor,
346 std::shared_ptr<CPS::EMT::Ph3::Capacitor>,
347 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Capacitor",
348 py::multiple_inheritance())
349 .def(py::init<std::string>())
350 .def(py::init<std::string, CPS::Logger::Level>())
351 .def("set_parameters", &CPS::EMT::Ph3::Capacitor::setParameters, "C"_a)
352 .def("connect", &CPS::EMT::Ph3::Capacitor::connect);
353
354 py::class_<CPS::EMT::Ph3::Inductor, std::shared_ptr<CPS::EMT::Ph3::Inductor>,
355 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Inductor",
356 py::multiple_inheritance())
357 .def(py::init<std::string>())
358 .def(py::init<std::string, CPS::Logger::Level>())
359 .def("set_parameters", &CPS::EMT::Ph3::Inductor::setParameters, "L"_a)
360 .def("connect", &CPS::EMT::Ph3::Inductor::connect);
361
363 std::shared_ptr<CPS::EMT::Ph3::NetworkInjection>,
364 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "NetworkInjection",
365 py::multiple_inheritance())
366 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
367 "loglevel"_a = CPS::Logger::Level::off)
368 .def("set_parameters",
369 py::overload_cast<CPS::MatrixComp, CPS::Real>(
371 "V_ref"_a, "f_src"_a = 50)
373
374 py::class_<CPS::EMT::Ph3::PiLine, std::shared_ptr<CPS::EMT::Ph3::PiLine>,
375 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "PiLine",
376 py::multiple_inheritance())
377 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
378 "loglevel"_a = CPS::Logger::Level::off)
379 .def("set_parameters", &CPS::EMT::Ph3::PiLine::setParameters,
380 "series_resistance"_a, "series_inductance"_a,
381 "parallel_capacitance"_a = zeroMatrix(3),
382 "parallel_conductance"_a = zeroMatrix(3))
383 .def("connect", &CPS::EMT::Ph3::PiLine::connect);
384
385 py::class_<CPS::EMT::Ph3::RXLoad, std::shared_ptr<CPS::EMT::Ph3::RXLoad>,
386 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "RXLoad",
387 py::multiple_inheritance())
388 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
389 "loglevel"_a = CPS::Logger::Level::off)
390 .def("set_parameters", &CPS::EMT::Ph3::RXLoad::setParameters,
391 "active_power"_a, "reactive_power"_a, "volt"_a,
392 // cppcheck-suppress assignBoolToPointer
393 "reactance_in_series"_a = false)
394 .def("connect", &CPS::EMT::Ph3::RXLoad::connect);
395
396 py::class_<CPS::EMT::Ph3::Shunt, std::shared_ptr<CPS::EMT::Ph3::Shunt>,
397 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Shunt",
398 py::multiple_inheritance())
399 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
400 "loglevel"_a = CPS::Logger::Level::off)
401 .def("set_parameters",
402 static_cast<void (CPS::EMT::Ph3::Shunt::*)(CPS::Real, CPS::Real)>(
404 "G"_a, "B"_a)
405 .def("connect", &CPS::EMT::Ph3::Shunt::connect);
406
407 py::class_<CPS::EMT::Ph3::Switch, std::shared_ptr<CPS::EMT::Ph3::Switch>,
409 mEMTPh3, "Switch", py::multiple_inheritance())
410 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
411 "loglevel"_a = CPS::Logger::Level::off)
412 .def("set_parameters", &CPS::EMT::Ph3::Switch::setParameters,
413 "open_resistance"_a, "closed_resistance"_a,
414 // cppcheck-suppress assignBoolToPointer
415 "closed"_a = false)
418 .def("connect", &CPS::EMT::Ph3::Switch::connect);
419
421 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorIdeal>,
422 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorIdeal",
423 py::multiple_inheritance())
424 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
425 "loglevel"_a = CPS::Logger::Level::off)
427
429 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez>,
430 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorDQTrapez",
431 py::multiple_inheritance())
432 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
433 "loglevel"_a = CPS::Logger::Level::off)
434 .def("set_parameters_operational_per_unit",
436 setParametersOperationalPerUnit,
437 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
438 "nom_field_cur"_a, "Rs"_a, "Ld"_a, "Lq"_a, "Ld_t"_a, "Lq_t"_a,
439 "Ld_s"_a, "Lq_s"_a, "Ll"_a, "Td0_t"_a, "Tq0_t"_a, "Td0_s"_a,
440 "Tq0_s"_a, "inertia"_a)
441 .def("set_parameters_fundamental_per_unit",
443 setParametersFundamentalPerUnit,
444 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
445 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
446 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
447 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
448 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
449 "init_mech_power"_a)
450#ifdef WITH_JSON
451 .def("apply_parameters_from_json",
452 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez> syngen,
453 const CPS::String json) {
454 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
455 json::parse(json), syngen);
456 })
457#endif
458 .def("set_initial_values",
460 "init_active_power"_a, "init_reactive_power"_a,
461 "init_terminal_volt"_a, "init_volt_angle"_a, "init_mech_power"_a);
462
464 std::shared_ptr<CPS::EMT::Ph3::VSIVoltageControlVCO>,
465 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "VSIVoltageControlVCO",
466 py::multiple_inheritance())
467 .def(py::init<std::string>())
468 .def(py::init<std::string, CPS::Logger::Level>())
469 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
470 "uid"_a, "name"_a, "log_level"_a = CPS::Logger::Level::off,
471 py::arg("with_trafo") = false)
472 .def("set_parameters",
474 "vd_ref"_a, "vq_ref"_a)
475 .def("set_controller_parameters",
477 "kp_voltage_ctrl"_a, "ki_voltage_ctrl"_a, "kp_curr_ctrl"_a,
478 "ki_curr_ctrl"_a, "omega_nominal"_a)
479 .def("set_transformer_parameters",
481 "nom_voltage_end1"_a, "nom_voltage_end2"_a, "rated_power"_a,
482 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a,
483 "omega"_a)
484 .def("set_filter_parameters",
486 "cf"_a, "rf"_a, "rc"_a)
487 .def("set_initial_state_values",
489 "phi_d_init"_a, "phi_q_init"_a, "gamma_d_init"_a, "gamma_q_init"_a)
491 "control_on"_a)
493
495 std::shared_ptr<CPS::EMT::Ph3::ReducedOrderSynchronGeneratorVBR>,
497 mEMTPh3, "ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
498
500 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator3OrderVBR>,
502 mEMTPh3, "SynchronGenerator3OrderVBR", py::multiple_inheritance())
503 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
504 "loglevel"_a = CPS::Logger::Level::off)
505 .def("set_operational_parameters_per_unit",
506 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
508 CPS::Real>(
510 setOperationalParametersPerUnit),
511 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
512 "Lq"_a, "L0"_a, "Ld_t"_a, "Td0_t"_a)
514
516 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator4OrderVBR>,
518 mEMTPh3, "SynchronGenerator4OrderVBR", py::multiple_inheritance())
519 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
520 "loglevel"_a = CPS::Logger::Level::off)
521 .def("set_operational_parameters_per_unit",
522 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
526 setOperationalParametersPerUnit),
527 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
528 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
530
532 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator5OrderVBR>,
534 mEMTPh3, "SynchronGenerator5OrderVBR", py::multiple_inheritance())
535 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
536 "loglevel"_a = CPS::Logger::Level::off)
537 .def("set_operational_parameters_per_unit",
538 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
543 setOperationalParametersPerUnit),
544 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
545 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
546 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
548
550 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6aOrderVBR>,
552 mEMTPh3, "SynchronGenerator6aOrderVBR", py::multiple_inheritance())
553 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
554 "loglevel"_a = CPS::Logger::Level::off)
555 .def("set_operational_parameters_per_unit",
556 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
561 setOperationalParametersPerUnit),
562 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
563 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
564 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
566
568 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6bOrderVBR>,
570 mEMTPh3, "SynchronGenerator6bOrderVBR", py::multiple_inheritance())
571 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
572 "loglevel"_a = CPS::Logger::Level::off)
573 .def("set_operational_parameters_per_unit",
574 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
579 setOperationalParametersPerUnit),
580 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
581 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
582 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a = 0)
584
585#ifdef WITH_SUNDIALS
586
588 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE>,
589 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorDQODE",
590 py::multiple_inheritance())
591 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
592 "loglevel"_a = CPS::Logger::Level::off)
593 .def("set_parameters_operational_per_unit",
595 setParametersOperationalPerUnit,
596 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
597 "nom_field_cur"_a, "Rs"_a, "Ld"_a, "Lq"_a, "Ld_t"_a, "Lq_t"_a,
598 "Ld_s"_a, "Lq_s"_a, "Ll"_a, "Td0_t"_a, "Tq0_t"_a, "Td0_s"_a,
599 "Tq0_s"_a, "inertia"_a)
600 .def("set_parameters_fundamental_per_unit",
602 setParametersFundamentalPerUnit,
603 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
604 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
605 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
606 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
607 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
608 "init_mech_power"_a)
609#ifdef WITH_JSON
610 .def("apply_parameters_from_json",
611 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE> syngen,
612 const CPS::String json) {
613 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
614 json::parse(json), syngen);
615 })
616#endif
617 .def("set_initial_values",
619 "init_active_power"_a, "init_reactive_power"_a,
620 "init_terminal_volt"_a, "init_volt_angle"_a, "init_mech_power"_a);
621
622#endif
623
625 std::shared_ptr<CPS::EMT::Ph3::AvVoltageSourceInverterDQ>,
626 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "AvVoltageSourceInverterDQ",
627 py::multiple_inheritance())
628 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
629 "loglevel"_a = CPS::Logger::Level::off)
630 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
631 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
632 // cppcheck-suppress assignBoolToPointer
633 "with_trafo"_a = false)
634 .def("set_parameters",
636 "sys_omega"_a, "sys_volt_nom"_a, "p_ref"_a, "q_ref"_a)
637 .def("set_filter_parameters",
639 "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a)
640 .def("set_controller_parameters",
642 "Kp_pll"_a, "Ki_pll"_a, "Kp_power_ctrl"_a, "Ki_power_ctrl"_a,
643 "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a, "omega_cutoff"_a)
644 .def("set_transformer_parameters",
646 "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
647 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a,
648 "omega"_a)
649 .def("set_initial_state_values",
651 "p_init"_a, "q_init"_a, "phi_d_init"_a, "phi_q_init"_a,
652 "gamma_d_init"_a, "gamma_q_init"_a)
653 .def("with_control",
656
658 std::shared_ptr<CPS::EMT::Ph3::Transformer>,
659 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Transformer",
660 py::multiple_inheritance())
661 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
662 "loglevel"_a = CPS::Logger::Level::off)
663 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
664 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
665 // cppcheck-suppress assignBoolToPointer
666 "with_resistive_losses"_a = false)
667 .def("set_parameters", &CPS::EMT::Ph3::Transformer::setParameters,
668 "nom_voltage_end_1"_a, "nom_voltage_end_2"_a, "rated_power"_a,
669 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
670 .def("connect", &CPS::EMT::Ph3::Transformer::connect);
671
673 std::shared_ptr<CPS::EMT::Ph3::SeriesResistor>,
674 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SeriesResistor",
675 py::multiple_inheritance())
676 .def(py::init<std::string>())
677 .def(py::init<std::string, CPS::Logger::Level>())
678 .def("set_parameters", &CPS::EMT::Ph3::SeriesResistor::setParameters,
679 "R"_a)
681
683 std::shared_ptr<CPS::EMT::Ph3::SeriesSwitch>,
685 mEMTPh3, "SeriesSwitch", py::multiple_inheritance())
686 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
687 "loglevel"_a = CPS::Logger::Level::off)
688 .def("set_parameters", &CPS::EMT::Ph3::SeriesSwitch::setParameters,
689 "open_resistance"_a, "closed_resistance"_a,
690 // cppcheck-suppress assignBoolToPointer
691 "closed"_a = false)
694 .def("connect", &CPS::EMT::Ph3::SeriesSwitch::connect);
695
697 std::shared_ptr<CPS::EMT::Ph3::SSN::Full_Serial_RLC>,
698 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Full_Serial_RLC",
699 py::multiple_inheritance())
700 .def(py::init<std::string>())
701 .def(py::init<std::string, CPS::Logger::Level>())
702 .def("set_parameters",
704 "C"_a)
706 .def_property("R", createAttributeGetter<CPS::Matrix>("R"),
708 .def_property("L", createAttributeGetter<CPS::Matrix>("L"),
710 .def_property("C", createAttributeGetter<CPS::Matrix>("C"),
712
714 std::shared_ptr<CPS::EMT::Ph3::GenericTwoTerminalVTypeSSN>,
716 mEMTPh3, "GenericTwoTerminalVTypeSSN", py::multiple_inheritance())
717 .def(py::init<std::string>())
718 .def(py::init<std::string, CPS::Logger::Level>())
719 .def("set_parameters",
721 "B"_a, "C"_a, "D"_a)
723 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
724
726 std::shared_ptr<CPS::EMT::Ph3::GenericTwoTerminalITypeSSN>,
728 mEMTPh3, "GenericTwoTerminalITypeSSN", py::multiple_inheritance())
729 .def(py::init<std::string>())
730 .def(py::init<std::string, CPS::Logger::Level>())
731 .def("set_parameters",
733 "B"_a, "C"_a, "D"_a)
735 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
736
738 std::shared_ptr<CPS::EMT::Ph3::PiecewiseLinearInductor>,
739 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "PiecewiseLinearInductor",
740 py::multiple_inheritance())
741 .def(py::init<std::string>())
742 .def(py::init<std::string, CPS::Logger::Level>())
743 .def("set_parameters",
745 "flux_breakpoints"_a, "current_breakpoints"_a)
747 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
748
750 std::shared_ptr<CPS::EMT::Ph3::AvVoltSourceInverterStateSpace>,
752 mEMTPh3, "AvVoltSourceInverterStateSpace", py::multiple_inheritance())
753 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
754 "loglevel"_a = CPS::Logger::Level::off)
755 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
756 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
757 .def("set_parameters",
759 "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a, "omega_n"_a, "Kp_pll"_a, "Ki_pll"_a,
760 "omega_cutoff"_a, "p_ref"_a, "q_ref"_a, "Kp_power_ctrl"_a,
761 "Ki_power_ctrl"_a, "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a)
763 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"))
764 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
765 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
766 .def_property_readonly("irc_d", createAttributeGetter<CPS::Real>("irc_d"))
767 .def_property_readonly("irc_q", createAttributeGetter<CPS::Real>("irc_q"))
768 .def_property_readonly("p_inst",
770 .def_property_readonly("q_inst",
772 .def_property_readonly("omega_pll",
774
775 py::class_<CPS::EMT::Ph3::SSN_GFM, std::shared_ptr<CPS::EMT::Ph3::SSN_GFM>,
776 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_GFM",
777 py::multiple_inheritance())
778 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
779 "name"_a, "log_level"_a = CPS::Logger::Level::off)
780 .def("set_parameters", &CPS::EMT::Ph3::SSN_GFM::setParameters, "lf"_a,
781 "cf"_a, "rf"_a, "rc"_a, "nominal_voltage"_a, "omega_nominal"_a,
782 "p_ref"_a, "q_ref"_a, "virtual_inertia"_a, "damping_coefficient"_a,
783 "voltage_droop_gain"_a, "reactive_integral_gain"_a, "kp_voltage"_a,
784 "ki_voltage"_a, "kp_current"_a, "ki_current"_a,
785 "active_damping_gain"_a, "power_filter_cutoff"_a,
786 "delay_bandwidth"_a)
787 .def("set_numerical_linearization_parameters",
789 "relative_step"_a = 1e-6, "absolute_step"_a = 1e-8)
790 .def("set_virtual_impedance",
791 &CPS::EMT::Ph3::SSN_GFM::setVirtualImpedance, "virtual_resistance"_a,
792 "virtual_reactance"_a = 0.0)
793 .def("set_grid_current_feedforward",
795 .def("set_reactive_power_droop",
797 "cutoff"_a)
798 .def("connect", &CPS::EMT::Ph3::SSN_GFM::connect)
799 .def("get_state_names", &CPS::EMT::Ph3::SSN_GFM::getLocalStateNames)
800 .def("get_state", &CPS::EMT::Ph3::SSN_GFM::getState)
801 .def("get_state_derivative", &CPS::EMT::Ph3::SSN_GFM::getStateDerivative)
802 .def("get_interface_voltage",
804 .def("get_interface_current",
806 .def_property_readonly("p_inst",
808 .def_property_readonly("q_inst",
810 .def_property_readonly("omega_gfm",
812 .def_property_readonly("theta_gfm",
814 .def_property_readonly(
815 "voltage_magnitude_gfm",
816 createAttributeGetter<CPS::Real>("voltage_magnitude_gfm"))
817 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
818 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
819 .def_property_readonly("i_grid_d",
821 .def_property_readonly("i_grid_q",
823 .def_property_readonly("if_d", createAttributeGetter<CPS::Real>("if_d"))
824 .def_property_readonly("if_q", createAttributeGetter<CPS::Real>("if_q"))
825 .def_property_readonly("v_ref_d",
827 .def_property_readonly("v_ref_q",
829
831 std::shared_ptr<CPS::EMT::Ph3::SSN::Capacitor>,
832 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_Capacitor",
833 py::multiple_inheritance())
834 .def(py::init<std::string>())
835 .def(py::init<std::string, CPS::Logger::Level>())
836 .def("set_parameters", &CPS::EMT::Ph3::SSN::Capacitor::setParameters,
837 "C"_a)
839 .def_property("C", createAttributeGetter<CPS::Matrix>("C"),
841
843 std::shared_ptr<CPS::EMT::Ph3::GenericFourTerminalVTypeSSN>,
845 mEMTPh3, "GenericFourTerminalVTypeSSN", py::multiple_inheritance())
846 .def(py::init<std::string>())
847 .def(py::init<std::string, CPS::Logger::Level>())
848 .def("set_parameters",
850 "B"_a, "C"_a, "D"_a)
852 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
853}
void addEMTPh1Components(py::module_ mEMTPh1)
void addEMTPh3Components(py::module_ mEMTPh3)
void addEMTComponents(py::module_ mEMT)
void setParameters(Real capacitance)
Sets model specific parameters.
void setParameters(Real inductance)
Sets model specific parameters.
void setParameters(Real resistance)
Dynamic Phasor Three-Phase Switch.
void close()
Close switch.
void setParameters(Real openResistance, Real closedResistance, Bool closed=false)
void open()
Open switch.
void setParameters(Matrix capacitance)
Sets model specific parameters.
void setParameters(Matrix inductance)
Sets model specific parameters.
void setParameters(Matrix seriesResistance, Matrix seriesInductance, Matrix parallelCapacitance=Matrix::Zero(3, 3), Matrix parallelConductance=Matrix::Zero(3, 3)) const
void setParameters(Matrix resistance)
Sets model specific parameters.
Dynamic Phasor Three-Phase Switch.
void setParameters(Matrix openResistance, Matrix closedResistance, Bool closed=false)
void setInitialValues(Real initActivePower, Real initReactivePower, Real initTerminalVolt, Real initVoltAngle, Real initMechPower)
void setParameters(Real capacitance)
void setParameters(Real inductance, Real initialCurrent=0.0)
void setParameters(Real seriesResistance, Real seriesInductance, Real parallelCapacitance=0.0, Real parallelConductance=0.0, Real initialCurrent=0.0)
void setParameters(Real resistance)
Ideal current source model.
void setParameters(Complex currentRef, Real srcFreq=-1)
void setParameters(Real resistance, Real inductance, Real capacitance)
SSNTypeI2T Model for a one phase, two terminal I-type SSN component which can be represented using a ...
void setParameters(const Matrix A, const Matrix B, const Matrix C, const Matrix D)
void manualInit(Matrix initialState, Matrix initialInput, Matrix initialOldInput, Real initCurrent, Real initVoltage)
SSNTypeV2T Model for a one phase, two terminal V-type SSN component which can be represented using a ...
void manualInit(Matrix initialState, Matrix initialInput, Matrix initialOldInput, Real initCurrent, Real initVoltage)
void setParameters(const Matrix A, const Matrix B, const Matrix C, const Matrix D)
Ideal Voltage source model.
void setParameters(Complex voltageRef, Real srcFreq=-1)
void setParameters(Real lf, Real cf, Real rf, Real rc, Real omegaN, Real kpPLL, Real kiPLL, Real omegaCutoff, Real pRef, Real qRef, Real kpPowerCtrl, Real kiPowerCtrl, Real kpCurrCtrl, Real kiCurrCtrl)
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, Real omega)
Setter for parameters of transformer.
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 setFilterParameters(Real Lf, Real Cf, Real Rf, Real Rc)
Setter for parameters of filter.
void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref)
Setter for gengit eral parameters of inverter.
Ideal current source model.
void setParameters(MatrixComp currentRef, Real srcFreq=50.0)
Setter for reference current.
Concrete generic three-phase, two-terminal I-type SSN component.
Concrete generic three-phase, two-terminal V-type SSN component.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage parameters.
Three-phase, two-terminal, piecewise-linear flux-state inductor.
void setParameters(const std::vector< Real > &fluxBreakpoints, const std::vector< Real > &currentBreakpoints)
void setParameters(Matrix activePower, Matrix reactivePower, Real volt, bool reactanceInSeries=false)
Base class for EMT VBR simplefied synchronous generator models.
void setParameters(Matrix capacitance)
void setParameters(const Matrix &resistance, const Matrix &inductance, const Matrix &capacitance)
void setNumericalLinearizationParameters(Real relativeStep, Real absoluteStep)
Configure finite-difference steps for local linearization.
Matrix getStateDerivative() const
Matrix getInterfaceCurrent() const
Matrix getInterfaceVoltage() const
void setReactivePowerDroop(Real droopGain, Real cutoff)
Opt-in proportional Q-V droop replacing the integral excitation. droopGain is Dq [V/var]; cutoff [rad...
void setParameters(Real lf, Real cf, Real rf, Real rc, Real nominalVoltage, Real omegaN, Real pRef, Real qRef, Real virtualInertia, Real dampingCoefficient, Real voltageDroopGain, Real reactiveIntegralGain, Real kpVoltage, Real kiVoltage, Real kpCurrent, Real kiCurrent, Real activeDampingGain, Real powerFilterCutoff, Real delayBandwidth)
Configure the GFM model.
std::vector< String > getLocalStateNames() const override final
void setGridCurrentFeedforward(Real scale)
Scale on the voltage-loop grid-current feedforward (default 1).
void setVirtualImpedance(Real virtualResistance, Real virtualReactance=0.0)
Opt-in virtual output impedance Zv = Rv + jXv, subtracted from the EMF reference across the filter cu...
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 - Fou...
Ideal voltage source representing a synchronous generator.
Transformer that includes an inductance and resistance.
void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower, Real ratioAbs, Real ratioPhase, Matrix resistance, Matrix inductance)
Defines component parameters.
void setParameters(Real sysOmega, Real VdRef, Real VqRef)
Setter for general parameters of the component.
void setFilterParameters(Real Lf, Real Cf, Real Rf, Real Rc)
Setter for parameters of filter.
void setControllerParameters(Real Kp_voltageCtrl, Real Ki_voltageCtrl, Real Kp_currCtrl, Real Ki_currCtrl, Real Omega_nominal)
Setter for parameters of control loops.
void setInitialStateValues(Real phi_dInit, Real phi_qInit, Real gamma_dInit, Real gamma_qInit)
Setter for initial values applied in controllers.
void setTransformerParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance, Real omega)
Setter for parameters of transformer.
Ideal Voltage source model.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage and frequency with a sine wave generator.
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D)
static Ptr GND
Definition SimNode.h:35
Base class for all components that are transmitting power.
void connect(typename SimNode< Real >::List nodes)
void setInitialVoltage(MatrixComp voltage) const
py::cpp_function createAttributeGetter(const std::string name)
Definition Utils.h:27
py::cpp_function createAttributeSetter(const std::string name)
Definition Utils.h:20
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
CPS::Matrix zeroMatrix(int dim)
Definition Utils.cpp:11