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/EMTComponents.h>
15#include <dpsim/pybind/Utils.h>
18#include <nlohmann/json.hpp>
19using json = nlohmann::json;
22namespace py = pybind11;
23using namespace pybind11::literals;
25void addEMTComponents(py::module_ mEMT) {
26 py::class_<CPS::EMT::SimNode, std::shared_ptr<CPS::EMT::SimNode>,
28 .def(py::init<std::string>())
29 .def(py::init<std::string, CPS::PhaseType>())
30 .def(py::init<std::string, CPS::PhaseType,
31 const std::vector<CPS::Complex>>())
32 .def(
"set_initial_voltage",
33 py::overload_cast<CPS::MatrixComp>(
34 &CPS::EMT::SimNode::setInitialVoltage, py::const_))
35 .def(
"set_initial_voltage",
36 py::overload_cast<CPS::Complex>(
37 &CPS::EMT::SimNode::setInitialVoltage, py::const_))
38 .def(
"set_initial_voltage",
39 py::overload_cast<CPS::Complex, int>(
40 &CPS::EMT::SimNode::setInitialVoltage, py::const_))
41 .def_readonly_static(
"gnd", &CPS::EMT::SimNode::GND);
43 py::module mEMTPh1 = mEMT.def_submodule(
44 "ph1",
"single phase electromagnetic-transient models");
45 addEMTPh1Components(mEMTPh1);
47 mEMT.def_submodule(
"ph3",
"three phase electromagnetic-transient models");
48 addEMTPh3Components(mEMTPh3);
51void addEMTPh1Components(py::module_ mEMTPh1) {
53 std::shared_ptr<CPS::EMT::Ph1::CurrentSource>,
55 py::multiple_inheritance())
56 .def(py::init<std::string>())
57 .def(py::init<std::string, CPS::Logger::Level>())
58 .def(
"set_parameters", &CPS::EMT::Ph1::CurrentSource::setParameters,
59 "I_ref"_a,
"f_src"_a = -1)
61 .def_property(
"I_ref", createAttributeGetter<CPS::Complex>(
"I_ref"),
62 createAttributeSetter<CPS::Complex>(
"I_ref"))
63 .def_property(
"f_src", createAttributeGetter<CPS::Real>(
"f_src"),
64 createAttributeSetter<CPS::Real>(
"f_src"));
67 std::shared_ptr<CPS::EMT::Ph1::VoltageSource>,
69 py::multiple_inheritance())
70 .def(py::init<std::string>())
71 .def(py::init<std::string, CPS::Logger::Level>())
72 .def(
"set_parameters", &CPS::EMT::Ph1::VoltageSource::setParameters,
73 "V_ref"_a,
"f_src"_a = -1)
75 .def_property(
"V_ref", createAttributeGetter<CPS::Complex>(
"V_ref"),
76 createAttributeSetter<CPS::Complex>(
"V_ref"))
77 .def_property(
"f_src", createAttributeGetter<CPS::Real>(
"f_src"),
78 createAttributeSetter<CPS::Real>(
"f_src"));
80 py::class_<CPS::EMT::Ph1::Resistor, std::shared_ptr<CPS::EMT::Ph1::Resistor>,
82 py::multiple_inheritance())
83 .def(py::init<std::string>())
84 .def(py::init<std::string, CPS::Logger::Level>())
85 .def(
"set_parameters", &CPS::EMT::Ph1::Resistor::setParameters,
"R"_a)
87 .def_property(
"R", createAttributeGetter<CPS::Real>(
"R"),
88 createAttributeSetter<CPS::Real>(
"R"));
91 std::shared_ptr<CPS::EMT::Ph1::Capacitor>,
93 py::multiple_inheritance())
94 .def(py::init<std::string>())
95 .def(py::init<std::string, CPS::Logger::Level>())
98 .def_property(
"C", createAttributeGetter<CPS::Real>(
"C"),
99 createAttributeSetter<CPS::Real>(
"C"));
101 py::class_<CPS::EMT::Ph1::Inductor, std::shared_ptr<CPS::EMT::Ph1::Inductor>,
103 py::multiple_inheritance())
104 .def(py::init<std::string>())
105 .def(py::init<std::string, CPS::Logger::Level>())
108 .def_property(
"L", createAttributeGetter<CPS::Real>(
"L"),
109 createAttributeSetter<CPS::Real>(
"L"));
111 py::class_<CPS::EMT::Ph1::Switch, std::shared_ptr<CPS::EMT::Ph1::Switch>,
113 mEMTPh1,
"Switch", py::multiple_inheritance())
114 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
115 "loglevel"_a = CPS::Logger::Level::off)
116 .def(
"set_parameters", &CPS::EMT::Ph1::Switch::setParameters,
117 "open_resistance"_a,
"closed_resistance"_a,
124 std::shared_ptr<CPS::EMT::Ph1::SSN::Full_Serial_RLC>,
126 py::multiple_inheritance())
127 .def(py::init<std::string>())
128 .def(py::init<std::string, CPS::Logger::Level>())
129 .def(
"set_parameters",
130 &CPS::EMT::Ph1::SSN::Full_Serial_RLC::setParameters,
"R"_a,
"L"_a,
133 .def_property(
"R", createAttributeGetter<CPS::Real>(
"R"),
134 createAttributeSetter<CPS::Real>(
"R"))
135 .def_property(
"L", createAttributeGetter<CPS::Real>(
"L"),
136 createAttributeSetter<CPS::Real>(
"L"))
137 .def_property(
"C", createAttributeGetter<CPS::Real>(
"C"),
138 createAttributeSetter<CPS::Real>(
"C"));
141 std::shared_ptr<CPS::EMT::Ph1::SSNTypeI2T>,
143 py::multiple_inheritance())
144 .def(py::init<std::string>())
145 .def(py::init<std::string, CPS::Logger::Level>())
146 .def(
"set_parameters", &CPS::EMT::Ph1::SSNTypeI2T::setParameters,
"A"_a,
148 .def(
"manual_init", &CPS::EMT::Ph1::SSNTypeI2T::manualInit,
149 "initialState"_a,
"initialInput"_a,
"initialOldInput"_a,
150 "initCurr"_a,
"initVol"_a)
152 .def_property(
"mA", createAttributeGetter<CPS::Matrix>(
"mA"),
153 createAttributeSetter<CPS::Matrix>(
"mA"))
154 .def_property(
"mB", createAttributeGetter<CPS::Matrix>(
"mB"),
155 createAttributeSetter<CPS::Matrix>(
"mB"))
156 .def_property(
"mC", createAttributeGetter<CPS::Matrix>(
"mC"),
157 createAttributeSetter<CPS::Matrix>(
"mC"))
158 .def_property(
"mD", createAttributeGetter<CPS::Matrix>(
"mD"),
159 createAttributeSetter<CPS::Matrix>(
"mD"))
160 .def_property(
"mdA", createAttributeGetter<CPS::Matrix>(
"mdA"),
161 createAttributeSetter<CPS::Matrix>(
"mdA"))
162 .def_property(
"mdB", createAttributeGetter<CPS::Matrix>(
"mdB"),
163 createAttributeSetter<CPS::Matrix>(
"mdB"))
164 .def_property(
"mdC", createAttributeGetter<CPS::Matrix>(
"mdC"),
165 createAttributeSetter<CPS::Matrix>(
"mdC"));
168 std::shared_ptr<CPS::EMT::Ph1::SSNTypeV2T>,
170 py::multiple_inheritance())
171 .def(py::init<std::string>())
172 .def(py::init<std::string, CPS::Logger::Level>())
173 .def(
"set_parameters", &CPS::EMT::Ph1::SSNTypeV2T::setParameters,
"A"_a,
175 .def(
"manual_init", &CPS::EMT::Ph1::SSNTypeV2T::manualInit,
176 "initialState"_a,
"initialInput"_a,
"initialOldInput"_a,
177 "initCurr"_a,
"initVol"_a)
179 .def_property(
"mA", createAttributeGetter<CPS::Matrix>(
"mA"),
180 createAttributeSetter<CPS::Matrix>(
"mA"))
181 .def_property(
"mB", createAttributeGetter<CPS::Matrix>(
"mB"),
182 createAttributeSetter<CPS::Matrix>(
"mB"))
183 .def_property(
"mC", createAttributeGetter<CPS::Matrix>(
"mC"),
184 createAttributeSetter<CPS::Matrix>(
"mC"))
185 .def_property(
"mD", createAttributeGetter<CPS::Matrix>(
"mD"),
186 createAttributeSetter<CPS::Matrix>(
"mD"))
187 .def_property(
"mdA", createAttributeGetter<CPS::Matrix>(
"mdA"),
188 createAttributeSetter<CPS::Matrix>(
"mdA"))
189 .def_property(
"mdB", createAttributeGetter<CPS::Matrix>(
"mdB"),
190 createAttributeSetter<CPS::Matrix>(
"mdB"))
191 .def_property(
"mdC", createAttributeGetter<CPS::Matrix>(
"mdC"),
192 createAttributeSetter<CPS::Matrix>(
"mdC"));
195void addEMTPh3Components(py::module_ mEMTPh3) {
197 std::shared_ptr<CPS::EMT::Ph3::VoltageSource>,
199 py::multiple_inheritance())
200 .def(py::init<std::string>())
201 .def(py::init<std::string, CPS::Logger::Level>())
202 .def(
"set_parameters",
203 py::overload_cast<CPS::MatrixComp, CPS::Real>(
205 "V_ref"_a,
"f_src"_a = 50)
207 .def_property(
"V_ref", createAttributeGetter<CPS::MatrixComp>(
"V_ref"),
208 createAttributeSetter<CPS::MatrixComp>(
"V_ref"))
209 .def_property(
"f_src", createAttributeGetter<CPS::Real>(
"f_src"),
210 createAttributeSetter<CPS::Real>(
"f_src"));
213 std::shared_ptr<CPS::EMT::Ph3::ControlledVoltageSource>,
215 py::multiple_inheritance())
216 .def(py::init<std::string>())
217 .def(py::init<std::string, CPS::Logger::Level>())
218 .def(
"set_parameters",
219 py::overload_cast<CPS::Matrix>(
223 .def_property(
"V_ref", createAttributeGetter<CPS::MatrixComp>(
"V_ref"),
224 createAttributeSetter<CPS::MatrixComp>(
"V_ref"));
227 std::shared_ptr<CPS::EMT::Ph3::CurrentSource>,
229 py::multiple_inheritance())
230 .def(py::init<std::string>())
231 .def(py::init<std::string, CPS::Logger::Level>())
232 .def(
"set_parameters",
233 py::overload_cast<CPS::MatrixComp, CPS::Real>(
235 "I_ref"_a,
"f_src"_a = 50)
237 .def_property(
"I_ref", createAttributeGetter<CPS::MatrixComp>(
"I_ref"),
238 createAttributeSetter<CPS::MatrixComp>(
"V_ref"))
239 .def_property(
"f_src", createAttributeGetter<CPS::Real>(
"f_src"),
240 createAttributeSetter<CPS::Real>(
"f_src"));
242 py::class_<CPS::EMT::Ph3::Resistor, std::shared_ptr<CPS::EMT::Ph3::Resistor>,
244 py::multiple_inheritance())
245 .def(py::init<std::string>())
246 .def(py::init<std::string, CPS::Logger::Level>())
251 std::shared_ptr<CPS::EMT::Ph3::Capacitor>,
253 py::multiple_inheritance())
254 .def(py::init<std::string>())
255 .def(py::init<std::string, CPS::Logger::Level>())
259 py::class_<CPS::EMT::Ph3::Inductor, std::shared_ptr<CPS::EMT::Ph3::Inductor>,
261 py::multiple_inheritance())
262 .def(py::init<std::string>())
263 .def(py::init<std::string, CPS::Logger::Level>())
268 std::shared_ptr<CPS::EMT::Ph3::NetworkInjection>,
270 py::multiple_inheritance())
271 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
272 "loglevel"_a = CPS::Logger::Level::off)
273 .def(
"set_parameters",
274 py::overload_cast<CPS::MatrixComp, CPS::Real>(
276 "V_ref"_a,
"f_src"_a = 50)
279 py::class_<CPS::EMT::Ph3::PiLine, std::shared_ptr<CPS::EMT::Ph3::PiLine>,
281 py::multiple_inheritance())
282 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
283 "loglevel"_a = CPS::Logger::Level::off)
284 .def(
"set_parameters", &CPS::EMT::Ph3::PiLine::setParameters,
285 "series_resistance"_a,
"series_inductance"_a,
286 "parallel_capacitance"_a = zeroMatrix(3),
287 "parallel_conductance"_a = zeroMatrix(3))
290 py::class_<CPS::EMT::Ph3::RXLoad, std::shared_ptr<CPS::EMT::Ph3::RXLoad>,
292 py::multiple_inheritance())
293 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
294 "loglevel"_a = CPS::Logger::Level::off)
295 .def(
"set_parameters", &CPS::EMT::Ph3::RXLoad::setParameters,
296 "active_power"_a,
"reactive_power"_a,
"volt"_a,
298 "reactance_in_series"_a =
false)
301 py::class_<CPS::EMT::Ph3::Switch, std::shared_ptr<CPS::EMT::Ph3::Switch>,
303 mEMTPh3,
"Switch", py::multiple_inheritance())
304 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
305 "loglevel"_a = CPS::Logger::Level::off)
306 .def(
"set_parameters", &CPS::EMT::Ph3::Switch::setParameters,
307 "open_resistance"_a,
"closed_resistance"_a,
310 .def(
"open", &CPS::EMT::Ph3::Switch::openSwitch)
311 .def(
"close", &CPS::EMT::Ph3::Switch::closeSwitch)
315 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez>,
317 py::multiple_inheritance())
318 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
319 "loglevel"_a = CPS::Logger::Level::off)
320 .def(
"set_parameters_operational_per_unit",
322 setParametersOperationalPerUnit,
323 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
324 "nom_field_cur"_a,
"Rs"_a,
"Ld"_a,
"Lq"_a,
"Ld_t"_a,
"Lq_t"_a,
325 "Ld_s"_a,
"Lq_s"_a,
"Ll"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Td0_s"_a,
326 "Tq0_s"_a,
"inertia"_a)
327 .def(
"set_parameters_fundamental_per_unit",
329 setParametersFundamentalPerUnit,
330 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
331 "nom_field_cur"_a,
"Rs"_a,
"Ll"_a,
"Lmd"_a,
"Lmq"_a,
"Rfd"_a,
332 "Llfd"_a,
"Rkd"_a,
"Llkd"_a,
"Rkq1"_a,
"Llkq1"_a,
"Rkq2"_a,
333 "Llkq2"_a,
"inertia"_a,
"init_active_power"_a,
334 "init_reactive_power"_a,
"init_terminal_volt"_a,
"init_volt_angle"_a,
337 .def(
"apply_parameters_from_json",
338 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez> syngen,
339 const CPS::String json) {
340 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
341 json::parse(json), syngen);
344 .def(
"set_initial_values",
345 &CPS::EMT::Ph3::SynchronGeneratorDQTrapez::setInitialValues,
346 "init_active_power"_a,
"init_reactive_power"_a,
347 "init_terminal_volt"_a,
"init_volt_angle"_a,
"init_mech_power"_a);
350 std::shared_ptr<CPS::EMT::Ph3::ReducedOrderSynchronGeneratorVBR>,
352 mEMTPh3,
"ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
355 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator3OrderVBR>,
357 mEMTPh3,
"SynchronGenerator3OrderVBR", py::multiple_inheritance())
358 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
359 "loglevel"_a = CPS::Logger::Level::off)
360 .def(
"set_operational_parameters_per_unit",
361 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
362 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
365 setOperationalParametersPerUnit),
366 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
367 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Td0_t"_a)
371 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator4OrderVBR>,
373 mEMTPh3,
"SynchronGenerator4OrderVBR", py::multiple_inheritance())
374 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
375 "loglevel"_a = CPS::Logger::Level::off)
376 .def(
"set_operational_parameters_per_unit",
377 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
378 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
379 CPS::Real, CPS::Real, CPS::Real>(
381 setOperationalParametersPerUnit),
382 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
383 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a)
387 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator5OrderVBR>,
389 mEMTPh3,
"SynchronGenerator5OrderVBR", py::multiple_inheritance())
390 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
391 "loglevel"_a = CPS::Logger::Level::off)
392 .def(
"set_operational_parameters_per_unit",
393 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
394 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
395 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
396 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
398 setOperationalParametersPerUnit),
399 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
400 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
401 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a)
405 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6aOrderVBR>,
407 mEMTPh3,
"SynchronGenerator6aOrderVBR", py::multiple_inheritance())
408 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
409 "loglevel"_a = CPS::Logger::Level::off)
410 .def(
"set_operational_parameters_per_unit",
411 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
412 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
413 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
414 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
416 setOperationalParametersPerUnit),
417 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
418 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
419 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a)
423 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6bOrderVBR>,
425 mEMTPh3,
"SynchronGenerator6bOrderVBR", py::multiple_inheritance())
426 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
427 "loglevel"_a = CPS::Logger::Level::off)
428 .def(
"set_operational_parameters_per_unit",
429 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
430 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
431 CPS::Real, CPS::Real, CPS::Real, CPS::Real,
432 CPS::Real, CPS::Real, CPS::Real, CPS::Real>(
434 setOperationalParametersPerUnit),
435 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
436 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
437 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a = 0)
443 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE>,
445 py::multiple_inheritance())
446 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
447 "loglevel"_a = CPS::Logger::Level::off)
448 .def(
"set_parameters_operational_per_unit",
450 setParametersOperationalPerUnit,
451 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
452 "nom_field_cur"_a,
"Rs"_a,
"Ld"_a,
"Lq"_a,
"Ld_t"_a,
"Lq_t"_a,
453 "Ld_s"_a,
"Lq_s"_a,
"Ll"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Td0_s"_a,
454 "Tq0_s"_a,
"inertia"_a)
455 .def(
"set_parameters_fundamental_per_unit",
457 setParametersFundamentalPerUnit,
458 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
459 "nom_field_cur"_a,
"Rs"_a,
"Ll"_a,
"Lmd"_a,
"Lmq"_a,
"Rfd"_a,
460 "Llfd"_a,
"Rkd"_a,
"Llkd"_a,
"Rkq1"_a,
"Llkq1"_a,
"Rkq2"_a,
461 "Llkq2"_a,
"inertia"_a,
"init_active_power"_a,
462 "init_reactive_power"_a,
"init_terminal_volt"_a,
"init_volt_angle"_a,
465 .def(
"apply_parameters_from_json",
466 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE> syngen,
467 const CPS::String json) {
468 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
469 json::parse(json), syngen);
472 .def(
"set_initial_values",
473 &CPS::EMT::Ph3::SynchronGeneratorDQODE::setInitialValues,
474 "init_active_power"_a,
"init_reactive_power"_a,
475 "init_terminal_volt"_a,
"init_volt_angle"_a,
"init_mech_power"_a);
480 std::shared_ptr<CPS::EMT::Ph3::AvVoltageSourceInverterDQ>,
482 py::multiple_inheritance())
483 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
484 "loglevel"_a = CPS::Logger::Level::off)
485 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
486 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
488 "with_trafo"_a =
false)
489 .def(
"set_parameters",
491 "sys_omega"_a,
"sys_volt_nom"_a,
"p_ref"_a,
"q_ref"_a)
492 .def(
"set_filter_parameters",
494 "Lf"_a,
"Cf"_a,
"Rf"_a,
"Rc"_a)
495 .def(
"set_controller_parameters",
497 "Kp_pll"_a,
"Ki_pll"_a,
"Kp_power_ctrl"_a,
"Ki_power_ctrl"_a,
498 "Kp_curr_ctrl"_a,
"Ki_curr_ctrl"_a,
"omega_cutoff"_a)
499 .def(
"set_transformer_parameters",
501 "nom_voltage_end_1"_a,
"nom_voltage_end_2"_a,
"rated_power"_a,
502 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a,
504 .def(
"set_initial_state_values",
506 "p_init"_a,
"q_init"_a,
"phi_d_init"_a,
"phi_q_init"_a,
507 "gamma_d_init"_a,
"gamma_q_init"_a)
509 &CPS::EMT::Ph3::AvVoltageSourceInverterDQ::withControl)
513 std::shared_ptr<CPS::EMT::Ph3::Transformer>,
515 py::multiple_inheritance())
516 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
517 "loglevel"_a = CPS::Logger::Level::off)
518 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
519 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
521 "with_resistive_losses"_a =
false)
523 "nom_voltage_end_1"_a,
"nom_voltage_end_2"_a,
"rated_power"_a,
524 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a)
528 std::shared_ptr<CPS::EMT::Ph3::SeriesResistor>,
530 py::multiple_inheritance())
531 .def(py::init<std::string>())
532 .def(py::init<std::string, CPS::Logger::Level>())
533 .def(
"set_parameters", &CPS::EMT::Ph3::SeriesResistor::setParameters,
538 std::shared_ptr<CPS::EMT::Ph3::SeriesSwitch>,
540 mEMTPh3,
"SeriesSwitch", py::multiple_inheritance())
541 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
542 "loglevel"_a = CPS::Logger::Level::off)
543 .def(
"set_parameters", &CPS::EMT::Ph3::SeriesSwitch::setParameters,
544 "open_resistance"_a,
"closed_resistance"_a,
552 std::shared_ptr<CPS::EMT::Ph3::SSN::Full_Serial_RLC>,
554 py::multiple_inheritance())
555 .def(py::init<std::string>())
556 .def(py::init<std::string, CPS::Logger::Level>())
557 .def(
"set_parameters",
558 &CPS::EMT::Ph3::SSN::Full_Serial_RLC::setParameters,
"R"_a,
"L"_a,
561 .def_property(
"R", createAttributeGetter<CPS::Matrix>(
"R"),
562 createAttributeSetter<CPS::Matrix>(
"R"))
563 .def_property(
"L", createAttributeGetter<CPS::Matrix>(
"L"),
564 createAttributeSetter<CPS::Matrix>(
"L"))
565 .def_property(
"C", createAttributeGetter<CPS::Matrix>(
"C"),
566 createAttributeSetter<CPS::Matrix>(
"C"));
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 setParameters(Matrix capacitance)
Sets model specific parameters.
void setParameters(Matrix inductance)
Sets model specific parameters.
void setParameters(Matrix resistance)
Sets model specific parameters.
Dynamic Phasor Three-Phase Switch.
Ideal current source model.
SSNTypeI2T Model for a one phase, two terminal I-type SSN component which can be represented using a ...
SSNTypeV2T Model for a one phase, two terminal V-type SSN component which can be represented using a ...
Ideal Voltage source model.
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.
Controlled Ideal Voltage source model.
void setParameters(Matrix voltageRef)
Ideal current source model.
void setParameters(MatrixComp currentRef, Real srcFreq=50.0)
Setter for reference current.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage parameters.
Base class for EMT VBR simplefied synchronous generator models.
EMT three-phase resistor.
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 model.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage and frequency with a sine wave generator.
Base class for all components that are transmitting power.
void connect(typename SimNode< Real >::List nodes)