20namespace py = pybind11;
21using namespace pybind11::literals;
24 py::class_<CPS::DP::SimNode, std::shared_ptr<CPS::DP::SimNode>,
26 .def(py::init<std::string>())
27 .def(py::init<std::string, CPS::PhaseType>())
29 const std::vector<CPS::Complex>>())
30 .def(
"set_initial_voltage",
31 py::overload_cast<CPS::MatrixComp>(
33 .def(
"set_initial_voltage",
36 .def(
"set_initial_voltage",
37 py::overload_cast<CPS::Complex, int>(
39 .def(
"set_complex_initial_voltage_scale",
46 mDP.def_submodule(
"ph1",
"single phase dynamic phasor models");
50 mDP.def_submodule(
"ph3",
"triple phase dynamic phasor models");
56 std::shared_ptr<CPS::DP::Ph1::VoltageSource>,
58 py::multiple_inheritance())
59 .def(py::init<std::string>())
60 .def(py::init<std::string, CPS::Logger::Level>())
61 .def(
"set_parameters",
62 py::overload_cast<CPS::Complex, CPS::Real>(
64 "V_ref"_a,
"f_src"_a = 0)
72 std::shared_ptr<CPS::DP::Ph1::VoltageSourceNorton>,
74 py::multiple_inheritance())
75 .def(py::init<std::string>())
76 .def(py::init<std::string, CPS::Logger::Level>())
77 .def(
"set_parameters",
81 py::arg(
"voltageRef"), py::arg(
"srcFreq") = -1)
82 .def(
"set_parameters",
86 py::arg(
"voltageRef"), py::arg(
"srcFreq") = -1,
87 py::arg(
"resistance") = 1e9)
91 std::shared_ptr<CPS::DP::Ph1::CurrentSource>,
93 py::multiple_inheritance())
94 .def(py::init<std::string>())
95 .def(py::init<std::string, CPS::Logger::Level>())
102 py::class_<CPS::DP::Ph1::Resistor, std::shared_ptr<CPS::DP::Ph1::Resistor>,
104 py::multiple_inheritance())
105 .def(py::init<std::string>())
106 .def(py::init<std::string, CPS::Logger::Level>())
112 py::class_<CPS::DP::Ph1::Capacitor, std::shared_ptr<CPS::DP::Ph1::Capacitor>,
114 py::multiple_inheritance())
115 .def(py::init<std::string>())
116 .def(py::init<std::string, CPS::Logger::Level>())
122 py::class_<CPS::DP::Ph1::Inductor, std::shared_ptr<CPS::DP::Ph1::Inductor>,
124 py::multiple_inheritance())
125 .def(py::init<std::string>())
126 .def(py::init<std::string, CPS::Logger::Level>())
133 std::shared_ptr<CPS::DP::Ph1::NetworkInjection>,
135 py::multiple_inheritance())
136 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
137 "loglevel"_a = CPS::Logger::Level::off)
138 .def(
"set_parameters",
139 py::overload_cast<CPS::Complex, CPS::Real>(
141 "V_ref"_a,
"f_src"_a = 0)
144 py::class_<CPS::DP::Ph1::PiLine, std::shared_ptr<CPS::DP::Ph1::PiLine>,
146 py::multiple_inheritance())
147 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
148 "loglevel"_a = CPS::Logger::Level::off)
150 "series_resistance"_a,
"series_inductance"_a,
151 "parallel_capacitance"_a = 0,
"parallel_conductance"_a = 0)
154 py::class_<CPS::DP::Ph1::RXLoad, std::shared_ptr<CPS::DP::Ph1::RXLoad>,
156 py::multiple_inheritance())
157 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
158 "loglevel"_a = CPS::Logger::Level::off)
160 "active_power"_a,
"reactive_power"_a,
"volt"_a)
163 py::class_<CPS::DP::Ph1::Shunt, std::shared_ptr<CPS::DP::Ph1::Shunt>,
165 py::multiple_inheritance())
166 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
167 "loglevel"_a = CPS::Logger::Level::off)
171 py::class_<CPS::DP::Ph1::Switch, std::shared_ptr<CPS::DP::Ph1::Switch>,
173 mDPPh1,
"Switch", py::multiple_inheritance())
174 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
175 "loglevel"_a = CPS::Logger::Level::off)
177 "open_resistance"_a,
"closed_resistance"_a,
185 std::shared_ptr<CPS::DP::Ph1::varResSwitch>,
187 mDPPh1,
"varResSwitch", py::multiple_inheritance())
188 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
189 "loglevel"_a = CPS::Logger::Level::off)
191 "open_resistance"_a,
"closed_resistance"_a,
196 .def(
"set_init_parameters",
201 std::shared_ptr<CPS::DP::Ph1::SSN::Full_Serial_RLC>,
203 py::multiple_inheritance())
204 .def(py::init<std::string>())
205 .def(py::init<std::string, CPS::Logger::Level>())
211 std::shared_ptr<CPS::DP::Ph1::AvVoltSourceInverterStateSpace>,
213 mDPPh1,
"AvVoltSourceInverterStateSpace", py::multiple_inheritance())
214 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
215 "loglevel"_a = CPS::Logger::Level::off)
216 .def(py::init<std::string, std::string, CPS::Logger::Level>(),
"uid"_a,
217 "name"_a,
"loglevel"_a = CPS::Logger::Level::off)
218 .def(
"set_parameters",
220 "Cf"_a,
"Rf"_a,
"Rc"_a,
"omega_n"_a,
"Kp_pll"_a,
"Ki_pll"_a,
221 "omega_cutoff"_a,
"p_ref"_a,
"q_ref"_a,
"Kp_power_ctrl"_a,
222 "Ki_power_ctrl"_a,
"Kp_curr_ctrl"_a,
"Ki_curr_ctrl"_a)
229 .def_property_readonly(
"p_inst",
231 .def_property_readonly(
"q_inst",
233 .def_property_readonly(
"omega_pll",
237 std::shared_ptr<CPS::DP::Ph1::GenericTwoTerminalVTypeSSN>,
239 mDPPh1,
"GenericTwoTerminalVTypeSSN", py::multiple_inheritance())
240 .def(py::init<std::string>())
241 .def(py::init<std::string, CPS::Logger::Level>())
242 .def(
"set_parameters",
249 std::shared_ptr<CPS::DP::Ph1::GenericTwoTerminalITypeSSN>,
251 mDPPh1,
"GenericTwoTerminalITypeSSN", py::multiple_inheritance())
252 .def(py::init<std::string>())
253 .def(py::init<std::string, CPS::Logger::Level>())
254 .def(
"set_parameters",
261 std::shared_ptr<CPS::DP::Ph1::SynchronGeneratorIdeal>,
263 py::multiple_inheritance())
264 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
265 "loglevel"_a = CPS::Logger::Level::off)
269 std::shared_ptr<CPS::DP::Ph1::SynchronGeneratorTrStab>,
271 py::multiple_inheritance())
272 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
273 "loglevel"_a = CPS::Logger::Level::off)
274 .def(
"set_standard_parameters_PU",
276 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"Xpd"_a,
"inertia"_a,
277 "Rs"_a = 0,
"D"_a = 0)
278 .def(
"set_fundamental_parameters_PU",
280 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"Ll"_a,
"Lmd"_a,
"Llfd"_a,
282 .def(
"set_initial_values",
284 "elec_power"_a,
"mech_power"_a)
286 .def(
"set_model_flags",
288 "convert_with_omega_mech"_a)
290 "set_reference_omega",
293 std::string refDeltaName,
296 refOmegaComp->attributeTyped<
CPS::Real>(refOmegaName),
297 refDeltaComp->attributeTyped<
CPS::Real>(refDeltaName));
299 "ref_omega_name"_a =
"w_r",
"ref_omage_comp"_a,
300 "ref_delta_name"_a =
"delta_r",
"ref_delta_comp"_a);
303 std::shared_ptr<CPS::DP::Ph1::ReducedOrderSynchronGeneratorVBR>,
305 mDPPh1,
"ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
308 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator3OrderVBR>,
310 mDPPh1,
"SynchronGenerator3OrderVBR", py::multiple_inheritance())
311 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
312 "loglevel"_a = CPS::Logger::Level::off)
313 .def(
"set_operational_parameters_per_unit",
318 setOperationalParametersPerUnit),
319 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
320 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Td0_t"_a)
324 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator4OrderVBR>,
326 mDPPh1,
"SynchronGenerator4OrderVBR", py::multiple_inheritance())
327 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
328 "loglevel"_a = CPS::Logger::Level::off)
329 .def(
"set_operational_parameters_per_unit",
334 setOperationalParametersPerUnit),
335 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
336 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a)
342 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator5OrderVBR>,
344 mDPPh1,
"SynchronGenerator5OrderVBR", py::multiple_inheritance())
345 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
346 "loglevel"_a = CPS::Logger::Level::off)
347 .def(
"set_operational_parameters_per_unit",
353 setOperationalParametersPerUnit),
354 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
355 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
356 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a)
360 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator6aOrderVBR>,
362 mDPPh1,
"SynchronGenerator6aOrderVBR", py::multiple_inheritance())
363 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
364 "loglevel"_a = CPS::Logger::Level::off)
365 .def(
"set_operational_parameters_per_unit",
371 setOperationalParametersPerUnit),
372 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
373 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
374 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a)
378 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator6bOrderVBR>,
380 mDPPh1,
"SynchronGenerator6bOrderVBR", py::multiple_inheritance())
381 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
382 "loglevel"_a = CPS::Logger::Level::off)
383 .def(
"set_operational_parameters_per_unit",
389 setOperationalParametersPerUnit),
390 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
391 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a,
"Ld_s"_a,
392 "Lq_s"_a,
"Td0_s"_a,
"Tq0_s"_a,
"Taa"_a = 0)
396 std::shared_ptr<CPS::DP::Ph1::SynchronGenerator4OrderTPM>,
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_operational_parameters_per_unit",
407 setOperationalParametersPerUnit),
408 "nom_power"_a,
"nom_voltage"_a,
"nom_frequency"_a,
"H"_a,
"Ld"_a,
409 "Lq"_a,
"L0"_a,
"Ld_t"_a,
"Lq_t"_a,
"Td0_t"_a,
"Tq0_t"_a)
413 std::shared_ptr<CPS::DP::Ph1::AvVoltageSourceInverterDQ>,
415 mDPPh1,
"AvVoltageSourceInverterDQ", py::multiple_inheritance())
416 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
417 "loglevel"_a = CPS::Logger::Level::off)
418 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
419 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
421 "with_trafo"_a =
false)
422 .def(
"set_parameters",
424 "sys_omega"_a,
"sys_volt_nom"_a,
"p_ref"_a,
"q_ref"_a)
425 .def(
"set_filter_parameters",
427 "Lf"_a,
"Cf"_a,
"Rf"_a,
"Rc"_a)
428 .def(
"set_controller_parameters",
430 "Kp_pll"_a,
"Ki_pll"_a,
"Kp_power_ctrl"_a,
"Ki_power_ctrl"_a,
431 "Kp_curr_ctrl"_a,
"Ki_curr_ctrl"_a,
"omega_cutoff"_a)
432 .def(
"set_transformer_parameters",
434 "nom_voltage_primary"_a,
"nom_voltage_secondary"_a,
"rated_power"_a,
435 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a)
436 .def(
"set_initial_state_values",
438 "p_init"_a,
"q_init"_a,
"phi_d_init"_a,
"phi_q_init"_a,
439 "gamma_d_init"_a,
"gamma_q_init"_a)
444 py::class_<CPS::DP::Ph1::Inverter, std::shared_ptr<CPS::DP::Ph1::Inverter>,
446 py::multiple_inheritance())
447 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
448 "loglevel"_a = CPS::Logger::Level::off)
450 "carrier_harms"_a,
"modul_harms"_a,
"input_voltage"_a,
"ratio"_a,
455 std::shared_ptr<CPS::DP::Ph1::Transformer>,
457 py::multiple_inheritance())
458 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
459 "loglevel"_a = CPS::Logger::Level::off)
460 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
461 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
463 "with_resistive_losses"_a =
false)
464 .def(
"set_parameters",
468 "nom_voltage_primary"_a,
"nom_voltage_secondary"_a,
"ratio_abs"_a,
469 "ratio_phase"_a,
"resistance"_a,
"inductance"_a)
470 .def(
"set_parameters",
474 "nom_voltage_primary"_a,
"nom_voltage_secondary"_a,
"rated_power"_a,
475 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a)
476 .def(
"set_reference_winding",
478 "reference_winding"_a)
483 .def(
"set_magnetizing_branch",
485 "no_load_current"_a,
"no_load_loss"_a)
491 std::shared_ptr<CPS::DP::Ph3::Transformer>,
493 py::multiple_inheritance())
494 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
495 "loglevel"_a = CPS::Logger::Level::off)
496 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
497 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
499 "with_resistive_losses"_a =
false)
501 "nom_voltage_primary"_a,
"nom_voltage_secondary"_a,
"rated_power"_a,
502 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a)
503 .def(
"set_reference_winding",
505 "reference_winding"_a)
510 .def(
"set_magnetizing_branch",
512 "no_load_current"_a,
"no_load_loss"_a)
516 std::shared_ptr<CPS::DP::Ph3::VoltageSource>,
518 py::multiple_inheritance())
519 .def(py::init<std::string>())
520 .def(py::init<std::string, CPS::Logger::Level>())
522 "V_ref"_a,
"f_src"_a = 0.0)
530 std::shared_ptr<CPS::DP::Ph3::NetworkInjection>,
532 py::multiple_inheritance())
533 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
534 "loglevel"_a = CPS::Logger::Level::off)
536 "V_ref"_a,
"f_src"_a = 0.0)
539 py::class_<CPS::DP::Ph3::PiLine, std::shared_ptr<CPS::DP::Ph3::PiLine>,
541 py::multiple_inheritance())
542 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
543 "loglevel"_a = CPS::Logger::Level::off)
545 "series_resistance"_a,
"series_inductance"_a,
551 std::shared_ptr<CPS::DP::Ph3::SSN::PiLine>,
553 py::multiple_inheritance())
554 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
555 "loglevel"_a = CPS::Logger::Level::off)
557 "series_resistance"_a,
"series_inductance"_a,
563 std::shared_ptr<CPS::DP::Ph3::SSN::ImpedanceLoad>,
565 py::multiple_inheritance())
566 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
567 "loglevel"_a = CPS::Logger::Level::off)
569 "active_power"_a,
"reactive_power"_a,
"nominal_voltage"_a,
570 "shunt_conductance"_a = 0.,
"shunt_susceptance"_a = 0.)
574 std::shared_ptr<CPS::DP::Ph3::SSN::Transformer>,
576 py::multiple_inheritance())
577 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
578 "loglevel"_a = CPS::Logger::Level::off)
580 "nom_voltage_primary"_a,
"nom_voltage_secondary"_a,
"rated_power"_a,
581 "ratio_abs"_a,
"ratio_phase"_a,
"resistance"_a,
"inductance"_a)
582 .def(
"set_magnetizing_branch",
584 "no_load_current"_a,
"no_load_loss"_a)
588 std::shared_ptr<CPS::DP::Ph3::CurrentSource>,
590 py::multiple_inheritance())
591 .def(py::init<std::string>())
592 .def(py::init<std::string, CPS::Logger::Level>())
594 "I_ref"_a,
"f_src"_a = 0.0)
601 py::class_<CPS::DP::Ph3::Resistor, std::shared_ptr<CPS::DP::Ph3::Resistor>,
603 py::multiple_inheritance())
604 .def(py::init<std::string>())
605 .def(py::init<std::string, CPS::Logger::Level>())
609 py::class_<CPS::DP::Ph3::Inductor, std::shared_ptr<CPS::DP::Ph3::Inductor>,
611 py::multiple_inheritance())
612 .def(py::init<std::string>())
613 .def(py::init<std::string, CPS::Logger::Level>())
617 py::class_<CPS::DP::Ph3::Capacitor, std::shared_ptr<CPS::DP::Ph3::Capacitor>,
619 py::multiple_inheritance())
620 .def(py::init<std::string>())
621 .def(py::init<std::string, CPS::Logger::Level>())
628 std::shared_ptr<CPS::DP::Ph3::SynchronGeneratorDQODE>,
630 py::multiple_inheritance())
631 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
632 "loglevel"_a = CPS::Logger::Level::off)
633 .def(
"set_parameters_fundamental_per_unit",
635 setParametersFundamentalPerUnit,
636 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
637 "nom_field_cur"_a,
"Rs"_a,
"Ll"_a,
"Lmd"_a,
"Lmq"_a,
"Rfd"_a,
638 "Llfd"_a,
"Rkd"_a,
"Llkd"_a,
"Rkq1"_a,
"Llkq1"_a,
"Rkq2"_a,
639 "Llkq2"_a,
"inertia"_a,
"init_active_power"_a,
640 "init_reactive_power"_a,
"init_terminal_volt"_a,
"init_volt_angle"_a,
647 std::shared_ptr<CPS::DP::Ph3::SynchronGeneratorDQTrapez>,
649 mDPPh3,
"SynchronGeneratorDQTrapez", py::multiple_inheritance())
650 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
651 "loglevel"_a = CPS::Logger::Level::off)
652 .def(
"set_machine_parameters_fundamental_per_unit",
654 setMachineParametersFundamentalPerUnit,
655 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
656 "nom_field_cur"_a,
"Rs"_a,
"Ll"_a,
"Lmd"_a,
"Lmq"_a,
"Rfd"_a,
657 "Llfd"_a,
"Rkd"_a,
"Llkd"_a,
"Rkq1"_a,
"Llkq1"_a,
"Rkq2"_a,
658 "Llkq2"_a,
"inertia"_a)
659 .def(
"set_parameters_fundamental_per_unit",
661 setParametersFundamentalPerUnit,
662 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
663 "nom_field_cur"_a,
"Rs"_a,
"Ll"_a,
"Lmd"_a,
"Lmq"_a,
"Rfd"_a,
664 "Llfd"_a,
"Rkd"_a,
"Llkd"_a,
"Rkq1"_a,
"Llkq1"_a,
"Rkq2"_a,
665 "Llkq2"_a,
"inertia"_a,
"init_active_power"_a,
666 "init_reactive_power"_a,
"init_terminal_volt"_a,
"init_volt_angle"_a,
671 std::shared_ptr<CPS::DP::Ph3::SynchronGenerator4OrderVBR>,
673 mDPPh3,
"SynchronGenerator4OrderVBR", py::multiple_inheritance())
674 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
675 "loglevel"_a = CPS::Logger::Level::off)
676 .def(
"set_parameters_operational_per_unit",
678 setParametersOperationalPerUnit,
679 "nom_power"_a,
"nom_volt"_a,
"nom_freq"_a,
"pole_number"_a,
680 "nom_field_cur"_a,
"Rs"_a,
"Ld"_a,
"Lq"_a,
"Ld_t"_a,
"Lq_t"_a,
681 "Ll"_a,
"Td0_t"_a,
"Tq0_t"_a,
"inertia"_a)
685 std::shared_ptr<CPS::DP::Ph3::SeriesResistor>,
687 py::multiple_inheritance())
688 .def(py::init<std::string>())
689 .def(py::init<std::string, CPS::Logger::Level>())
695 std::shared_ptr<CPS::DP::Ph3::SeriesSwitch>,
697 mDPPh3,
"SeriesSwitch", py::multiple_inheritance())
698 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
699 "loglevel"_a = CPS::Logger::Level::off)
701 "open_resistance"_a,
"closed_resistance"_a,
708 py::class_<CPS::DP::Ph3::Switch, std::shared_ptr<CPS::DP::Ph3::Switch>,
710 mDPPh3,
"Switch", py::multiple_inheritance())
711 .def(py::init<std::string, CPS::Logger::Level>(),
"name"_a,
712 "loglevel"_a = CPS::Logger::Level::off)
714 "open_resistance"_a,
"closed_resistance"_a,
722 std::shared_ptr<CPS::DP::Ph3::SSN::Full_Serial_RLC>,
724 py::multiple_inheritance())
725 .def(py::init<std::string>())
726 .def(py::init<std::string, CPS::Logger::Level>())
732 std::shared_ptr<CPS::DP::Ph3::AvVoltSourceInverterStateSpace>,
734 mDPPh3,
"AvVoltSourceInverterStateSpace", py::multiple_inheritance())
735 .def(py::init<std::string, CPS::Logger::Level, CPS::Bool>(),
"name"_a,
736 "loglevel"_a = CPS::Logger::Level::off,
738 "enable_neg_seq_control"_a =
false)
739 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
740 "uid"_a,
"name"_a,
"loglevel"_a = CPS::Logger::Level::off,
742 "enable_neg_seq_control"_a =
false)
743 .def(
"set_parameters",
745 "Cf"_a,
"Rf"_a,
"Rc"_a,
"omega_n"_a,
"Kp_pll"_a,
"Ki_pll"_a,
746 "omega_cutoff"_a,
"p_ref"_a,
"q_ref"_a,
"Kp_power_ctrl"_a,
747 "Ki_power_ctrl"_a,
"Kp_curr_ctrl"_a,
"Ki_curr_ctrl"_a,
748 "i_ref_n_d"_a = 0.0,
"i_ref_n_q"_a = 0.0)
755 .def_property_readonly(
"irc_n_d",
757 .def_property_readonly(
"irc_n_q",
759 .def_property_readonly(
"p_inst",
761 .def_property_readonly(
"q_inst",
763 .def_property_readonly(
"omega_pll",
767 std::shared_ptr<CPS::DP::Ph3::GenericTwoTerminalVTypeSSN>,
769 mDPPh3,
"GenericTwoTerminalVTypeSSN", py::multiple_inheritance())
770 .def(py::init<std::string>())
771 .def(py::init<std::string, CPS::Logger::Level>())
772 .def(
"set_parameters",
779 std::shared_ptr<CPS::DP::Ph3::GenericTwoTerminalITypeSSN>,
781 mDPPh3,
"GenericTwoTerminalITypeSSN", py::multiple_inheritance())
782 .def(py::init<std::string>())
783 .def(py::init<std::string, CPS::Logger::Level>())
784 .def(
"set_parameters",
void addDPComponents(py::module_ mDP)
void addDPPh1Components(py::module_ mDPPh1)
void addDPPh3Components(py::module_ mDPPh3)
void setParameters(Real capacitance)
Sets model specific parameters.
void setParameters(Real inductance)
Sets model specific parameters.
void setParameters(Real seriesResistance, Real seriesInductance, Real parallelCapacitance=0, Real parallelConductance=0) const
void setParameters(Real resistance)
Dynamic Phasor Three-Phase Switch.
void close()
Close switch.
void setParameters(Real openResistance, Real closedResistance, Bool closed=false)
void setParameters(Complex voltageRef, Real srcFreq=-1)
Sets model specific parameters.
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.
Common base for three-phase switches.
void setParameters(Matrix openResistance, Matrix closedResistance, Bool closed=false)
void setDamping(Real damping)
Averaged grid-following VSI SSN port of EMT::Ph3::AvVoltSourceInverterStateSpace: 8 real control stat...
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 setTransformerParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, Real ratedPower, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance)
Setter for parameters of transformer.
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 withControl(Bool controlOn)
void setFilterParameters(Real Lf, Real Cf, Real Rf, Real Rc)
Setter for parameters of filter.
Dynamic phasor ideal current source.
void setCurrentRef(Complex current)
Set the reference through the public attribute interface and mark it explicit.
void setParameters(Complex current)
Generic single-phase, two-terminal I-type SSN component.
Generic single-phase, two-terminal V-type SSN component.
void setParameters(const std::vector< Int > &carrierHarms, const std::vector< Int > &modulHarms, Real inputVoltage, Real ratio, Real phase)
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.
Series RLC one-port as a DP V-type SSN component.
void setParameters(Real resistance, Real inductance, Real capacitance)
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Voltage-Behind-Reactance (VBR) implementation of 3rd order synchronous generator model.
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...
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.
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 setInitialValues(Complex elecPower, Real mechPower)
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.
void setReferenceOmega(Attribute< Real >::Ptr refOmegaPtr, Attribute< Real >::Ptr refDeltaPtr)
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...
void setInitParameters(Real timestep)
Averaged grid-following VSI (SSN), optional dual-sequence current control.
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, Real iRefNd=0.0, Real iRefNq=0.0)
Ideal current source model.
void setCurrentRef(MatrixComp currentRef)
Set the reference through the public attribute interface and mark it explicit.
void setParameters(MatrixComp currentRef, Real srcFreq=0.0)
Setter for reference current per phase and offset from the carrier.
Generic three-phase, two-terminal I-type SSN component.
Generic three-phase, two-terminal V-type SSN component.
void setParameters(MatrixComp voltageRef, Real srcFreq=0.0)
Setter for reference voltage parameters.
Series RLC one-port as a three-phase DP V-type SSN component.
void setParameters(const Matrix &resistance, const Matrix &inductance, const Matrix &capacitance)
Balanced fixed-impedance load and bus shunt as one SSN MNA component.
void setParameters(Real activePower, Real reactivePower, Real nominalVoltage, Real shuntConductance=0., Real shuntSusceptance=0.)
void setParameters(const Matrix &seriesResistance, const Matrix &seriesInductance, const Matrix ¶llelCapacitance=Matrix::Zero(3, 3), const Matrix ¶llelConductance=Matrix::Zero(3, 3))
Dynamic phasor three-phase switch.
void closeSwitch() override
void openSwitch() override
Synchronous generator model in dq-reference frame.
Ideal Voltage source model.
void setParameters(MatrixComp voltageRef, Real srcFreq=0.0)
Setter for reference voltage per phase and offset from the carrier.
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, const Matrix &D1=Matrix())
std::shared_ptr< IdentifiedObject > Ptr
Interface to be used by synchronous generators.
void setComplexInitialVoltageScale(Real scale)
Complex singleVoltage(PhaseType phaseType=PhaseType::Single)
Base class for all components that are transmitting power.
void connect(typename SimNode< Complex >::List nodes)
void setInitialVoltage(MatrixComp voltage) const
py::cpp_function createAttributeGetter(const std::string name)
py::cpp_function createAttributeSetter(const std::string name)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
std::complex< Real > Complex
CPS::Matrix zeroMatrix(int dim)