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>
30#include <dpsim/Simulation.h>
32#include <dpsim/pybind/Utils.h>
33
34#ifdef WITH_JSON
35#include <nlohmann/json.hpp>
36using json = nlohmann::json;
37#endif
38
40
41namespace py = pybind11;
42using namespace pybind11::literals;
43
44namespace {
45
46void addEMTDCComponents(py::module_ mEMTDC) {
48 std::shared_ptr<CPS::EMT::DC::VoltageSource>,
49 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "VoltageSource",
50 py::multiple_inheritance())
51 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
52 "loglevel"_a = CPS::Logger::Level::off)
53 .def("set_parameters", &CPS::EMT::DC::VoltageSource::setParameters,
54 "voltage"_a)
56 .def_property_readonly("V_ref",
58
60 std::shared_ptr<CPS::EMT::DC::CurrentSource>,
61 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "CurrentSource",
62 py::multiple_inheritance())
63 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
64 "loglevel"_a = CPS::Logger::Level::off)
65 .def("set_parameters", &CPS::EMT::DC::CurrentSource::setParameters,
66 "current"_a)
68 .def_property_readonly("I_ref",
70
71 py::class_<CPS::EMT::DC::Resistor, std::shared_ptr<CPS::EMT::DC::Resistor>,
72 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Resistor",
73 py::multiple_inheritance())
74 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
75 "loglevel"_a = CPS::Logger::Level::off)
76 .def("set_parameters", &CPS::EMT::DC::Resistor::setParameters,
77 "resistance"_a)
78 .def("connect", &CPS::EMT::DC::Resistor::connect)
79 .def_property_readonly("R", createAttributeGetter<CPS::Real>("R"));
80
81 py::class_<CPS::EMT::DC::Capacitor, std::shared_ptr<CPS::EMT::DC::Capacitor>,
82 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Capacitor",
83 py::multiple_inheritance())
84 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
85 "loglevel"_a = CPS::Logger::Level::off)
86 .def("set_parameters", &CPS::EMT::DC::Capacitor::setParameters,
87 "capacitance"_a)
88 .def("connect", &CPS::EMT::DC::Capacitor::connect)
89 .def_property_readonly("C", createAttributeGetter<CPS::Real>("C"))
90 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
91
92 py::class_<CPS::EMT::DC::Inductor, std::shared_ptr<CPS::EMT::DC::Inductor>,
93 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "Inductor",
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::Inductor::setParameters,
98 "inductance"_a, "initial_current"_a = 0.0)
99 .def("connect", &CPS::EMT::DC::Inductor::connect)
100 .def_property_readonly("L", createAttributeGetter<CPS::Real>("L"))
101 .def_property_readonly("initial_current",
103 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
104
105 py::class_<CPS::EMT::DC::PiLine, std::shared_ptr<CPS::EMT::DC::PiLine>,
106 CPS::SimPowerComp<CPS::Real>>(mEMTDC, "PiLine",
107 py::multiple_inheritance())
108 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
109 "loglevel"_a = CPS::Logger::Level::off)
110 .def("set_parameters", &CPS::EMT::DC::PiLine::setParameters,
111 "series_resistance"_a, "series_inductance"_a,
112 "parallel_capacitance"_a = 0.0, "parallel_conductance"_a = 0.0,
113 "initial_current"_a = 0.0)
114 .def("connect", &CPS::EMT::DC::PiLine::connect)
115 .def_property_readonly("series_resistance",
117 .def_property_readonly("series_inductance",
119 .def_property_readonly("parallel_capacitance",
121 .def_property_readonly("parallel_conductance",
123 .def_property_readonly("initial_current",
125}
126
127} // namespace
128
129void addEMTComponents(py::module_ mEMT) {
130 py::class_<CPS::EMT::SimNode, std::shared_ptr<CPS::EMT::SimNode>,
131 CPS::TopologicalNode>(mEMT, "SimNode", py::module_local())
132 .def(py::init<std::string>())
133 .def(py::init<std::string, CPS::PhaseType>())
134 .def(py::init<std::string, CPS::PhaseType,
135 const std::vector<CPS::Complex>>())
136 .def("set_initial_voltage",
137 py::overload_cast<CPS::MatrixComp>(
139 .def("set_initial_voltage",
140 py::overload_cast<CPS::Complex>(
142 .def("set_initial_voltage",
143 py::overload_cast<CPS::Complex, int>(
145 .def("set_complex_initial_voltage_scale",
147 .def_readonly_static("gnd", &CPS::EMT::SimNode::GND);
148
149 py::module_ mEMTDC =
150 mEMT.def_submodule("dc", "scalar electromagnetic-transient DC models");
151 addEMTDCComponents(mEMTDC);
152
153 py::module mEMTPh1 = mEMT.def_submodule(
154 "ph1", "single phase electromagnetic-transient models");
155 addEMTPh1Components(mEMTPh1);
156 py::module mEMTPh3 =
157 mEMT.def_submodule("ph3", "three phase electromagnetic-transient models");
158 addEMTPh3Components(mEMTPh3);
159}
160
161void addEMTPh1Components(py::module_ mEMTPh1) {
163 std::shared_ptr<CPS::EMT::Ph1::CurrentSource>,
164 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "CurrentSource",
165 py::multiple_inheritance())
166 .def(py::init<std::string>())
167 .def(py::init<std::string, CPS::Logger::Level>())
168 .def("set_parameters", &CPS::EMT::Ph1::CurrentSource::setParameters,
169 "I_ref"_a, "f_src"_a = -1)
171 .def_property("I_ref", createAttributeGetter<CPS::Complex>("I_ref"),
173 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
175
177 std::shared_ptr<CPS::EMT::Ph1::VoltageSource>,
178 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "VoltageSource",
179 py::multiple_inheritance())
180 .def(py::init<std::string>())
181 .def(py::init<std::string, CPS::Logger::Level>())
182 .def("set_parameters", &CPS::EMT::Ph1::VoltageSource::setParameters,
183 "V_ref"_a, "f_src"_a = -1)
185 .def_property("V_ref", createAttributeGetter<CPS::Complex>("V_ref"),
187 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
189
190 py::class_<CPS::EMT::Ph1::Resistor, std::shared_ptr<CPS::EMT::Ph1::Resistor>,
191 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Resistor",
192 py::multiple_inheritance())
193 .def(py::init<std::string>())
194 .def(py::init<std::string, CPS::Logger::Level>())
195 .def("set_parameters", &CPS::EMT::Ph1::Resistor::setParameters, "R"_a)
196 .def("connect", &CPS::EMT::Ph1::Resistor::connect)
197 .def_property("R", createAttributeGetter<CPS::Real>("R"),
199
200 py::class_<CPS::EMT::Ph1::Capacitor,
201 std::shared_ptr<CPS::EMT::Ph1::Capacitor>,
202 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Capacitor",
203 py::multiple_inheritance())
204 .def(py::init<std::string>())
205 .def(py::init<std::string, CPS::Logger::Level>())
206 .def("set_parameters", &CPS::EMT::Ph1::Capacitor::setParameters, "C"_a)
207 .def("connect", &CPS::EMT::Ph1::Capacitor::connect)
208 .def_property("C", createAttributeGetter<CPS::Real>("C"),
210
211 py::class_<CPS::EMT::Ph1::Inductor, std::shared_ptr<CPS::EMT::Ph1::Inductor>,
212 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Inductor",
213 py::multiple_inheritance())
214 .def(py::init<std::string>())
215 .def(py::init<std::string, CPS::Logger::Level>())
216 .def("set_parameters", &CPS::EMT::Ph1::Inductor::setParameters, "L"_a)
217 .def("connect", &CPS::EMT::Ph1::Inductor::connect)
218 .def_property("L", createAttributeGetter<CPS::Real>("L"),
220
221 py::class_<CPS::EMT::Ph1::Switch, std::shared_ptr<CPS::EMT::Ph1::Switch>,
223 mEMTPh1, "Switch", py::multiple_inheritance())
224 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
225 "loglevel"_a = CPS::Logger::Level::off)
226 .def("set_parameters", &CPS::EMT::Ph1::Switch::setParameters,
227 "open_resistance"_a, "closed_resistance"_a,
228 "closed"_a = false) // cppcheck-suppress assignBoolToPointer
229 .def("open", &CPS::EMT::Ph1::Switch::open)
230 .def("close", &CPS::EMT::Ph1::Switch::close)
231 .def("connect", &CPS::EMT::Ph1::Switch::connect);
232
234 std::shared_ptr<CPS::EMT::Ph1::SSN::Full_Serial_RLC>,
235 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "Full_Serial_RLC",
236 py::multiple_inheritance())
237 .def(py::init<std::string>())
238 .def(py::init<std::string, CPS::Logger::Level>())
239 .def("set_parameters",
241 "C"_a)
243 .def_property("R", createAttributeGetter<CPS::Real>("R"),
245 .def_property("L", createAttributeGetter<CPS::Real>("L"),
247 .def_property("C", createAttributeGetter<CPS::Real>("C"),
249
250 py::class_<CPS::EMT::Ph1::SSNTypeI2T,
251 std::shared_ptr<CPS::EMT::Ph1::SSNTypeI2T>,
252 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "SSNTypeI2T",
253 py::multiple_inheritance())
254 .def(py::init<std::string>())
255 .def(py::init<std::string, CPS::Logger::Level>())
256 .def("set_parameters", &CPS::EMT::Ph1::SSNTypeI2T::setParameters, "A"_a,
257 "B"_a, "C"_a, "D"_a)
258 .def("manual_init", &CPS::EMT::Ph1::SSNTypeI2T::manualInit,
259 "initialState"_a, "initialInput"_a, "initialOldInput"_a,
260 "initCurr"_a, "initVol"_a)
261 .def("connect", &CPS::EMT::Ph1::SSNTypeI2T::connect)
262 .def_property("mA", createAttributeGetter<CPS::Matrix>("mA"),
264 .def_property("mB", createAttributeGetter<CPS::Matrix>("mB"),
266 .def_property("mC", createAttributeGetter<CPS::Matrix>("mC"),
268 .def_property("mD", createAttributeGetter<CPS::Matrix>("mD"),
270 .def_property("mdA", createAttributeGetter<CPS::Matrix>("mdA"),
272 .def_property("mdB", createAttributeGetter<CPS::Matrix>("mdB"),
274 .def_property("mdC", createAttributeGetter<CPS::Matrix>("mdC"),
276
277 py::class_<CPS::EMT::Ph1::SSNTypeV2T,
278 std::shared_ptr<CPS::EMT::Ph1::SSNTypeV2T>,
279 CPS::SimPowerComp<CPS::Real>>(mEMTPh1, "SSNTypeV2T",
280 py::multiple_inheritance())
281 .def(py::init<std::string>())
282 .def(py::init<std::string, CPS::Logger::Level>())
283 .def("set_parameters", &CPS::EMT::Ph1::SSNTypeV2T::setParameters, "A"_a,
284 "B"_a, "C"_a, "D"_a)
285 .def("manual_init", &CPS::EMT::Ph1::SSNTypeV2T::manualInit,
286 "initialState"_a, "initialInput"_a, "initialOldInput"_a,
287 "initCurr"_a, "initVol"_a)
288 .def("connect", &CPS::EMT::Ph1::SSNTypeV2T::connect)
289 .def_property("mA", createAttributeGetter<CPS::Matrix>("mA"),
291 .def_property("mB", createAttributeGetter<CPS::Matrix>("mB"),
293 .def_property("mC", createAttributeGetter<CPS::Matrix>("mC"),
295 .def_property("mD", createAttributeGetter<CPS::Matrix>("mD"),
297 .def_property("mdA", createAttributeGetter<CPS::Matrix>("mdA"),
299 .def_property("mdB", createAttributeGetter<CPS::Matrix>("mdB"),
301 .def_property("mdC", createAttributeGetter<CPS::Matrix>("mdC"),
303}
304
305void addEMTPh3Components(py::module_ mEMTPh3) {
307 std::shared_ptr<CPS::EMT::Ph3::VoltageSource>,
308 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "VoltageSource",
309 py::multiple_inheritance())
310 .def(py::init<std::string>())
311 .def(py::init<std::string, CPS::Logger::Level>())
312 .def("set_parameters",
313 py::overload_cast<CPS::MatrixComp, CPS::Real>(
315 "V_ref"_a, "f_src"_a = 50)
317 .def_property("V_ref", createAttributeGetter<CPS::MatrixComp>("V_ref"),
319 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
321
323 std::shared_ptr<CPS::EMT::Ph3::VoltageSourceNorton>,
324 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "VoltageSourceNorton",
325 py::multiple_inheritance())
326 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
327 "loglevel"_a = CPS::Logger::Level::off)
329 "V_ref"_a, "f_src"_a, "resistance"_a)
331 .def_property("V_ref", createAttributeGetter<CPS::Complex>("V_ref"),
333 .def_property_readonly("resistance",
335
337 std::shared_ptr<CPS::EMT::Ph3::ControlledVoltageSource>,
338 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "ControlledVoltageSource",
339 py::multiple_inheritance())
340 .def(py::init<std::string>())
341 .def(py::init<std::string, CPS::Logger::Level>())
342 .def("set_parameters",
343 py::overload_cast<CPS::Matrix>(
345 "V_ref"_a)
347 .def("initialize_from_nodes_and_terminals",
349 initializeFromNodesAndTerminals,
350 "frequency"_a)
351 .def_property("V_ref", createAttributeGetter<CPS::Matrix>("V_ref"),
353
355 std::shared_ptr<CPS::EMT::Ph3::ControlledCurrentSource>,
356 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "ControlledCurrentSource",
357 py::multiple_inheritance())
358 .def(py::init<std::string>())
359 .def(py::init<std::string, CPS::Logger::Level>())
360 .def("set_parameters",
363 .def("initialize_from_nodes_and_terminals",
365 initializeFromNodesAndTerminals,
366 "frequency"_a)
367 .def_property("I_ref", createAttributeGetter<CPS::Matrix>("I_ref"),
369
371 std::shared_ptr<CPS::EMT::Ph3::CurrentSource>,
372 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "CurrentSource",
373 py::multiple_inheritance())
374 .def(py::init<std::string>())
375 .def(py::init<std::string, CPS::Logger::Level>())
376 .def("set_parameters",
377 py::overload_cast<CPS::MatrixComp, CPS::Real>(
379 "I_ref"_a, "f_src"_a = 50)
381 .def_property("I_ref", createAttributeGetter<CPS::MatrixComp>("I_ref"),
383 .def_property("f_src", createAttributeGetter<CPS::Real>("f_src"),
385
386 py::class_<CPS::EMT::Ph3::Resistor, std::shared_ptr<CPS::EMT::Ph3::Resistor>,
387 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Resistor",
388 py::multiple_inheritance())
389 .def(py::init<std::string>())
390 .def(py::init<std::string, CPS::Logger::Level>())
391 .def("set_parameters", &CPS::EMT::Ph3::Resistor::setParameters, "R"_a)
392 .def("connect", &CPS::EMT::Ph3::Resistor::connect);
393
394 py::class_<CPS::EMT::Ph3::Capacitor,
395 std::shared_ptr<CPS::EMT::Ph3::Capacitor>,
396 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Capacitor",
397 py::multiple_inheritance())
398 .def(py::init<std::string>())
399 .def(py::init<std::string, CPS::Logger::Level>())
400 .def("set_parameters", &CPS::EMT::Ph3::Capacitor::setParameters, "C"_a)
401 .def("connect", &CPS::EMT::Ph3::Capacitor::connect);
402
403 py::class_<CPS::EMT::Ph3::Inductor, std::shared_ptr<CPS::EMT::Ph3::Inductor>,
404 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Inductor",
405 py::multiple_inheritance())
406 .def(py::init<std::string>())
407 .def(py::init<std::string, CPS::Logger::Level>())
408 .def("set_parameters", &CPS::EMT::Ph3::Inductor::setParameters, "L"_a)
409 .def("connect", &CPS::EMT::Ph3::Inductor::connect);
410
412 std::shared_ptr<CPS::EMT::Ph3::NetworkInjection>,
413 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "NetworkInjection",
414 py::multiple_inheritance())
415 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
416 "loglevel"_a = CPS::Logger::Level::off)
417 .def("set_parameters",
418 py::overload_cast<CPS::MatrixComp, CPS::Real>(
420 "V_ref"_a, "f_src"_a = 50)
422
423 py::class_<CPS::EMT::Ph3::PiLine, std::shared_ptr<CPS::EMT::Ph3::PiLine>,
424 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "PiLine",
425 py::multiple_inheritance())
426 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
427 "loglevel"_a = CPS::Logger::Level::off)
428 .def("set_parameters", &CPS::EMT::Ph3::PiLine::setParameters,
429 "series_resistance"_a, "series_inductance"_a,
430 "parallel_capacitance"_a = zeroMatrix(3),
431 "parallel_conductance"_a = zeroMatrix(3))
432 .def("connect", &CPS::EMT::Ph3::PiLine::connect);
433
435 std::shared_ptr<CPS::EMT::Ph3::SSN::PiLine>,
436 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_PiLine",
437 py::multiple_inheritance())
438 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
439 "loglevel"_a = CPS::Logger::Level::off)
440 .def("set_parameters", &CPS::EMT::Ph3::SSN::PiLine::setParameters,
441 "series_resistance"_a, "series_inductance"_a,
442 "parallel_capacitance"_a = zeroMatrix(3),
443 "parallel_conductance"_a = zeroMatrix(3))
444 .def("connect", &CPS::EMT::Ph3::SSN::PiLine::connect);
445
447 std::shared_ptr<CPS::EMT::Ph3::SSN::ImpedanceLoad>,
448 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_ImpedanceLoad",
449 py::multiple_inheritance())
450 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
451 "loglevel"_a = CPS::Logger::Level::off)
453 "active_power"_a, "reactive_power"_a, "nominal_voltage"_a,
454 "shunt_conductance"_a = 0., "shunt_susceptance"_a = 0.)
456
458 std::shared_ptr<CPS::EMT::Ph3::SSN::Transformer>,
459 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_Transformer",
460 py::multiple_inheritance())
461 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
462 "loglevel"_a = CPS::Logger::Level::off)
464 "nom_voltage_primary"_a, "nom_voltage_secondary"_a, "rated_power"_a,
465 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
466 .def("set_magnetizing_branch",
468 "no_load_current"_a, "no_load_loss"_a)
470
471 py::class_<CPS::EMT::Ph3::RxLine, std::shared_ptr<CPS::EMT::Ph3::RxLine>,
472 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "RxLine",
473 py::multiple_inheritance())
474 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
475 "loglevel"_a = CPS::Logger::Level::off)
476 .def("set_parameters", &CPS::Base::Ph3::PiLine::setParameters,
477 "series_resistance"_a, "series_inductance"_a,
478 "parallel_capacitance"_a = zeroMatrix(3),
479 "parallel_conductance"_a = zeroMatrix(3))
480 .def("connect", &CPS::EMT::Ph3::RxLine::connect);
481
483 std::shared_ptr<CPS::EMT::Ph3::HalfDecouplingLine>,
484 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "HalfDecouplingLine",
485 py::multiple_inheritance())
486 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
487 "loglevel"_a = CPS::Logger::Level::off)
489 "resistance"_a, "inductance"_a, "capacitance"_a)
490 .def("set_coupling_source",
492 "receiving_volt"_a, "receiving_cur"_a)
493 .def_property_readonly("sending_volt",
494 [](const CPS::EMT::Ph3::HalfDecouplingLine &line) {
495 return line.mSendingVolt;
496 })
497 .def_property_readonly("sending_cur",
498 [](const CPS::EMT::Ph3::HalfDecouplingLine &line) {
499 return line.mSendingCur;
500 })
502
503 py::class_<CPS::EMT::Ph3::RXLoad, std::shared_ptr<CPS::EMT::Ph3::RXLoad>,
504 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "RXLoad",
505 py::multiple_inheritance())
506 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
507 "loglevel"_a = CPS::Logger::Level::off)
508 .def("set_parameters", &CPS::EMT::Ph3::RXLoad::setParameters,
509 "active_power"_a, "reactive_power"_a, "volt"_a,
510 // cppcheck-suppress assignBoolToPointer
511 "reactance_in_series"_a = false)
512 .def("connect", &CPS::EMT::Ph3::RXLoad::connect);
513
514 py::class_<CPS::EMT::Ph3::PQLoad, std::shared_ptr<CPS::EMT::Ph3::PQLoad>,
516 mEMTPh3, "PQLoad", py::multiple_inheritance())
517 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
518 "loglevel"_a = CPS::Logger::Level::off)
519 .def("set_parameters", &CPS::EMT::Ph3::PQLoad::setParameters,
520 "active_power"_a, "reactive_power"_a, "nominal_voltage"_a,
521 "minimum_voltage_per_unit"_a = 0.1)
522 .def("connect", &CPS::EMT::Ph3::PQLoad::connect)
523 .def_property("P", createAttributeGetter<CPS::Real>("P"),
525 .def_property("Q", createAttributeGetter<CPS::Real>("Q"),
527 .def_property("V_nom", createAttributeGetter<CPS::Real>("V_nom"),
529 .def_property("V_min_pu", createAttributeGetter<CPS::Real>("V_min_pu"),
531 .def_property_readonly("p_inst",
533 .def_property_readonly("q_inst",
535
536 py::class_<CPS::EMT::Ph3::Shunt, std::shared_ptr<CPS::EMT::Ph3::Shunt>,
537 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Shunt",
538 py::multiple_inheritance())
539 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
540 "loglevel"_a = CPS::Logger::Level::off)
541 .def("set_parameters",
542 static_cast<void (CPS::EMT::Ph3::Shunt::*)(CPS::Real, CPS::Real)>(
544 "G"_a, "B"_a)
545 .def(
546 "set_parameters",
547 static_cast<void (CPS::EMT::Ph3::Shunt::*)(CPS::Matrix, CPS::Matrix)>(
549 "G"_a, "B"_a)
550 .def("connect", &CPS::EMT::Ph3::Shunt::connect);
551
552 py::class_<CPS::EMT::Ph3::Switch, std::shared_ptr<CPS::EMT::Ph3::Switch>,
554 mEMTPh3, "Switch", py::multiple_inheritance())
555 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
556 "loglevel"_a = CPS::Logger::Level::off)
557 .def("set_parameters", &CPS::EMT::Ph3::Switch::setParameters,
558 "open_resistance"_a, "closed_resistance"_a,
559 // cppcheck-suppress assignBoolToPointer
560 "closed"_a = false)
563 .def("connect", &CPS::EMT::Ph3::Switch::connect);
564
566 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorIdeal>,
567 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorIdeal",
568 py::multiple_inheritance())
569 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
570 "loglevel"_a = CPS::Logger::Level::off)
572 .def(
573 "initialize_from_nodes_and_terminals",
574 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorIdeal> generator,
575 CPS::Real frequency) {
576 generator->initializeFromNodesAndTerminals(frequency);
577 },
578 "frequency"_a)
579 .def_property_readonly(
580 "internal_voltage_reference",
581 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorIdeal> generator) {
582 const auto components = generator->subComponents();
583 if (components.empty())
584 throw std::runtime_error(
585 "Ideal synchronous generator has no internal voltage source");
586 const auto voltageSource =
587 std::dynamic_pointer_cast<CPS::EMT::Ph3::VoltageSource>(
588 components.front());
589 if (!voltageSource)
590 throw std::runtime_error("Ideal synchronous generator internal "
591 "component is not a voltage source");
592 return voltageSource->mVoltageRef->get();
593 });
594
596 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez>,
597 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorDQTrapez",
598 py::multiple_inheritance())
599 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
600 "loglevel"_a = CPS::Logger::Level::off)
601 .def("set_parameters_operational_per_unit",
603 setParametersOperationalPerUnit,
604 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
605 "nom_field_cur"_a, "Rs"_a, "Ld"_a, "Lq"_a, "Ld_t"_a, "Lq_t"_a,
606 "Ld_s"_a, "Lq_s"_a, "Ll"_a, "Td0_t"_a, "Tq0_t"_a, "Td0_s"_a,
607 "Tq0_s"_a, "inertia"_a)
608 .def("set_parameters_fundamental_per_unit",
610 setParametersFundamentalPerUnit,
611 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
612 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
613 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
614 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
615 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
616 "init_mech_power"_a)
617#ifdef WITH_JSON
618 .def("apply_parameters_from_json",
619 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQTrapez> syngen,
620 const CPS::String json) {
621 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
622 json::parse(json), syngen);
623 })
624#endif
625 .def("set_initial_values",
627 "init_active_power"_a, "init_reactive_power"_a,
628 "init_terminal_volt"_a, "init_volt_angle"_a, "init_mech_power"_a);
629
631 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorTrStab>,
632 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorTrStab",
633 py::multiple_inheritance())
634 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
635 "loglevel"_a = CPS::Logger::Level::off)
636 .def("set_standard_parameters_pu",
638 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "Xpd"_a, "inertia"_a,
639 "Rs"_a = 0.0, "D"_a = 0.0)
640 .def("set_initial_values",
642 "electrical_power"_a, "mechanical_power"_a)
644
646 std::shared_ptr<CPS::EMT::Ph3::VSIVoltageControlVCO>,
647 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "VSIVoltageControlVCO",
648 py::multiple_inheritance())
649 .def(py::init<std::string>())
650 .def(py::init<std::string, CPS::Logger::Level>())
651 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
652 "uid"_a, "name"_a, "log_level"_a = CPS::Logger::Level::off,
653 py::arg("with_trafo") = false)
654 .def("set_parameters",
656 "vd_ref"_a, "vq_ref"_a)
657 .def("set_controller_parameters",
659 "kp_voltage_ctrl"_a, "ki_voltage_ctrl"_a, "kp_curr_ctrl"_a,
660 "ki_curr_ctrl"_a, "omega_nominal"_a)
661 .def("set_transformer_parameters",
663 "nom_voltage_end1"_a, "nom_voltage_end2"_a, "rated_power"_a,
664 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a,
665 "omega"_a)
666 .def("set_filter_parameters",
668 "cf"_a, "rf"_a, "rc"_a)
669 .def("set_initial_state_values",
671 "phi_d_init"_a, "phi_q_init"_a, "gamma_d_init"_a, "gamma_q_init"_a)
673 "control_on"_a)
675
677 std::shared_ptr<CPS::EMT::Ph3::ReducedOrderSynchronGeneratorVBR>,
679 mEMTPh3, "ReducedOrderSynchronGeneratorVBR", py::multiple_inheritance());
680
682 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator3OrderVBR>,
684 mEMTPh3, "SynchronGenerator3OrderVBR", py::multiple_inheritance())
685 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
686 "loglevel"_a = CPS::Logger::Level::off)
687 .def("set_operational_parameters_per_unit",
688 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
690 CPS::Real>(
692 setOperationalParametersPerUnit),
693 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
694 "Lq"_a, "L0"_a, "Ld_t"_a, "Td0_t"_a)
696
698 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator4OrderVBR>,
700 mEMTPh3, "SynchronGenerator4OrderVBR", py::multiple_inheritance())
701 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
702 "loglevel"_a = CPS::Logger::Level::off)
703 .def("set_operational_parameters_per_unit",
704 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
708 setOperationalParametersPerUnit),
709 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
710 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a)
711 .def("set_damping",
714
716 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator5OrderVBR>,
718 mEMTPh3, "SynchronGenerator5OrderVBR", py::multiple_inheritance())
719 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
720 "loglevel"_a = CPS::Logger::Level::off)
721 .def("set_operational_parameters_per_unit",
722 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
727 setOperationalParametersPerUnit),
728 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
729 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
730 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
732
734 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6aOrderVBR>,
736 mEMTPh3, "SynchronGenerator6aOrderVBR", py::multiple_inheritance())
737 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
738 "loglevel"_a = CPS::Logger::Level::off)
739 .def("set_operational_parameters_per_unit",
740 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
745 setOperationalParametersPerUnit),
746 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
747 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
748 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a)
750
752 std::shared_ptr<CPS::EMT::Ph3::SynchronGenerator6bOrderVBR>,
754 mEMTPh3, "SynchronGenerator6bOrderVBR", py::multiple_inheritance())
755 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
756 "loglevel"_a = CPS::Logger::Level::off)
757 .def("set_operational_parameters_per_unit",
758 py::overload_cast<CPS::Real, CPS::Real, CPS::Real, CPS::Real,
763 setOperationalParametersPerUnit),
764 "nom_power"_a, "nom_voltage"_a, "nom_frequency"_a, "H"_a, "Ld"_a,
765 "Lq"_a, "L0"_a, "Ld_t"_a, "Lq_t"_a, "Td0_t"_a, "Tq0_t"_a, "Ld_s"_a,
766 "Lq_s"_a, "Td0_s"_a, "Tq0_s"_a, "Taa"_a = 0)
768
769#ifdef WITH_SUNDIALS
770
772 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE>,
773 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SynchronGeneratorDQODE",
774 py::multiple_inheritance())
775 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
776 "loglevel"_a = CPS::Logger::Level::off)
777 .def("set_parameters_operational_per_unit",
779 setParametersOperationalPerUnit,
780 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
781 "nom_field_cur"_a, "Rs"_a, "Ld"_a, "Lq"_a, "Ld_t"_a, "Lq_t"_a,
782 "Ld_s"_a, "Lq_s"_a, "Ll"_a, "Td0_t"_a, "Tq0_t"_a, "Td0_s"_a,
783 "Tq0_s"_a, "inertia"_a)
784 .def("set_parameters_fundamental_per_unit",
786 setParametersFundamentalPerUnit,
787 "nom_power"_a, "nom_volt"_a, "nom_freq"_a, "pole_number"_a,
788 "nom_field_cur"_a, "Rs"_a, "Ll"_a, "Lmd"_a, "Lmq"_a, "Rfd"_a,
789 "Llfd"_a, "Rkd"_a, "Llkd"_a, "Rkq1"_a, "Llkq1"_a, "Rkq2"_a,
790 "Llkq2"_a, "inertia"_a, "init_active_power"_a,
791 "init_reactive_power"_a, "init_terminal_volt"_a, "init_volt_angle"_a,
792 "init_mech_power"_a)
793#ifdef WITH_JSON
794 .def("apply_parameters_from_json",
795 [](std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQODE> syngen,
796 const CPS::String json) {
797 DPsim::Utils::applySynchronousGeneratorParametersFromJson(
798 json::parse(json), syngen);
799 })
800#endif
801 .def("set_initial_values",
803 "init_active_power"_a, "init_reactive_power"_a,
804 "init_terminal_volt"_a, "init_volt_angle"_a, "init_mech_power"_a);
805
806#endif
807
809 std::shared_ptr<CPS::EMT::Ph3::AvVoltageSourceInverterDQ>,
810 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "AvVoltageSourceInverterDQ",
811 py::multiple_inheritance())
812 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
813 "loglevel"_a = CPS::Logger::Level::off)
814 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
815 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
816 // cppcheck-suppress assignBoolToPointer
817 "with_trafo"_a = false)
818 .def("set_parameters",
820 "sys_omega"_a, "sys_volt_nom"_a, "p_ref"_a, "q_ref"_a)
821 .def("set_filter_parameters",
823 "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a)
824 .def("set_controller_parameters",
826 "Kp_pll"_a, "Ki_pll"_a, "Kp_power_ctrl"_a, "Ki_power_ctrl"_a,
827 "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a, "omega_cutoff"_a)
828 .def("set_transformer_parameters",
830 "nom_voltage_primary"_a, "nom_voltage_secondary"_a, "rated_power"_a,
831 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a,
832 "omega"_a)
833 .def("set_initial_state_values",
835 "p_init"_a, "q_init"_a, "phi_d_init"_a, "phi_q_init"_a,
836 "gamma_d_init"_a, "gamma_q_init"_a)
837 .def("with_control",
840
842 std::shared_ptr<CPS::EMT::Ph3::Transformer>,
843 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Transformer",
844 py::multiple_inheritance())
845 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
846 "loglevel"_a = CPS::Logger::Level::off)
847 .def(py::init<std::string, std::string, CPS::Logger::Level, CPS::Bool>(),
848 "uid"_a, "name"_a, "loglevel"_a = CPS::Logger::Level::off,
849 // cppcheck-suppress assignBoolToPointer
850 "with_resistive_losses"_a = false)
851 .def("set_parameters", &CPS::EMT::Ph3::Transformer::setParameters,
852 "nom_voltage_primary"_a, "nom_voltage_secondary"_a, "rated_power"_a,
853 "ratio_abs"_a, "ratio_phase"_a, "resistance"_a, "inductance"_a)
854 .def("set_reference_winding",
856 "reference_winding"_a)
857 .def("set_tap_ratio", &CPS::EMT::Ph3::Transformer::setTapRatio,
858 "tap_ratio"_a)
859 .def_property("tap_ratio", &CPS::EMT::Ph3::Transformer::tapRatio,
861 .def("set_magnetizing_branch",
863 "no_load_current"_a, "no_load_loss"_a)
864 .def("connect", &CPS::EMT::Ph3::Transformer::connect);
865
867 std::shared_ptr<CPS::EMT::Ph3::SeriesResistor>,
868 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SeriesResistor",
869 py::multiple_inheritance())
870 .def(py::init<std::string>())
871 .def(py::init<std::string, CPS::Logger::Level>())
872 .def("set_parameters", &CPS::EMT::Ph3::SeriesResistor::setParameters,
873 "R"_a)
875
877 std::shared_ptr<CPS::EMT::Ph3::SeriesSwitch>,
879 mEMTPh3, "SeriesSwitch", py::multiple_inheritance())
880 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
881 "loglevel"_a = CPS::Logger::Level::off)
882 .def("set_parameters", &CPS::EMT::Ph3::SeriesSwitch::setParameters,
883 "open_resistance"_a, "closed_resistance"_a,
884 // cppcheck-suppress assignBoolToPointer
885 "closed"_a = false)
888 .def("connect", &CPS::EMT::Ph3::SeriesSwitch::connect);
889
891 std::shared_ptr<CPS::EMT::Ph3::SSN::Full_Serial_RLC>,
892 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "Full_Serial_RLC",
893 py::multiple_inheritance())
894 .def(py::init<std::string>())
895 .def(py::init<std::string, CPS::Logger::Level>())
896 .def("set_parameters",
898 "C"_a)
900 .def_property("R", createAttributeGetter<CPS::Matrix>("R"),
902 .def_property("L", createAttributeGetter<CPS::Matrix>("L"),
904 .def_property("C", createAttributeGetter<CPS::Matrix>("C"),
906
908 std::shared_ptr<CPS::EMT::Ph3::GenericTwoTerminalVTypeSSN>,
910 mEMTPh3, "GenericTwoTerminalVTypeSSN", py::multiple_inheritance())
911 .def(py::init<std::string>())
912 .def(py::init<std::string, CPS::Logger::Level>())
913 .def("set_parameters",
915 "B"_a, "C"_a, "D"_a, "D1"_a = CPS::Matrix())
917 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
918
920 std::shared_ptr<CPS::EMT::Ph3::GenericTwoTerminalITypeSSN>,
922 mEMTPh3, "GenericTwoTerminalITypeSSN", py::multiple_inheritance())
923 .def(py::init<std::string>())
924 .def(py::init<std::string, CPS::Logger::Level>())
925 .def("set_parameters",
927 "B"_a, "C"_a, "D"_a, "D1"_a = CPS::Matrix())
929 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
930
932 std::shared_ptr<CPS::EMT::Ph3::PiecewiseLinearInductor>,
933 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "PiecewiseLinearInductor",
934 py::multiple_inheritance())
935 .def(py::init<std::string>())
936 .def(py::init<std::string, CPS::Logger::Level>())
937 .def("set_parameters",
939 "flux_breakpoints"_a, "current_breakpoints"_a)
941 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
942
943 // -----------------------------------------------------------------------
944 // Grid-following converter models
945 // -----------------------------------------------------------------------
946
947 py::class_<CPS::EMT::Ph3::GFL, std::shared_ptr<CPS::EMT::Ph3::GFL>,
948 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "GFL",
949 py::multiple_inheritance())
950 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
951 "loglevel"_a = CPS::Logger::Level::off)
952 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
953 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
954 .def("set_parameters", &CPS::EMT::Ph3::GFL::setParameters, "sys_omega"_a,
955 "sys_volt_nom"_a, "p_ref"_a, "q_ref"_a)
956 .def("set_controller_parameters",
957 &CPS::EMT::Ph3::GFL::setControllerParameters, "kp_pll"_a, "ki_pll"_a,
958 "kp_power_ctrl"_a, "ki_power_ctrl"_a, "kp_curr_ctrl"_a,
959 "ki_curr_ctrl"_a, "omega_cutoff"_a)
960 .def("set_filter_parameters", &CPS::EMT::Ph3::GFL::setFilterParameters,
961 "lf"_a, "cf"_a, "rf"_a)
962 .def("set_initial_state_values",
963 &CPS::EMT::Ph3::GFL::setInitialStateValues, "p_init"_a, "q_init"_a,
964 "phi_d_init"_a, "phi_q_init"_a, "gamma_d_init"_a, "gamma_q_init"_a)
965 .def("with_control", &CPS::EMT::Ph3::GFL::withControl, "control_on"_a)
966 .def("connect", &CPS::EMT::Ph3::GFL::connect)
967 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
968 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
969 .def_property_readonly("igrid_d",
971 .def_property_readonly("igrid_q",
973 .def_property_readonly("p_inst",
975 .def_property_readonly("q_inst",
977 .def_property_readonly("omega_pll",
979 .def_property_readonly("vs_ref",
981 .def_property_readonly("vs", createAttributeGetter<CPS::Matrix>("vs"))
982 .def_property_readonly("pll_output",
984 .def_property_readonly(
985 "powerctrl_inputs",
986 createAttributeGetter<CPS::Matrix>("powerctrl_inputs"))
987 .def_property_readonly(
988 "powerctrl_states",
989 createAttributeGetter<CPS::Matrix>("powerctrl_states"))
990 .def_property_readonly(
991 "powerctrl_outputs",
992 createAttributeGetter<CPS::Matrix>("powerctrl_outputs"));
993
995 std::shared_ptr<CPS::EMT::Ph3::SSN_InductionMotor>,
996 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_InductionMotor",
997 py::multiple_inheritance())
998 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
999 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
1001 "nominal_frequency"_a, "pole_pairs"_a, "stator_resistance"_a,
1002 "rotor_resistance"_a, "stator_inductance"_a, "rotor_inductance"_a,
1003 "mutual_inductance"_a, "rotor_inertia"_a, "mechanical_damping"_a,
1004 "mechanical_torque"_a, "initial_electrical_angle"_a = 0.0,
1005 py::arg_v("auto_initialize_mechanical_torque", true, "True"))
1006 .def("set_mechanical_torque",
1010 .def("get_state_derivative",
1012 .def_property_readonly("slip", createAttributeGetter<CPS::Real>("slip"))
1013 .def_property_readonly(
1014 "mechanical_speed",
1015 createAttributeGetter<CPS::Real>("mechanical_speed"))
1016 .def_property_readonly(
1017 "electrical_power",
1018 createAttributeGetter<CPS::Real>("electrical_power"))
1019 .def_property_readonly("reactive_power",
1020 createAttributeGetter<CPS::Real>("reactive_power"))
1021 .def_property_readonly(
1022 "electrical_torque",
1023 createAttributeGetter<CPS::Real>("electrical_torque"))
1024 .def_property_readonly(
1025 "mechanical_load_torque",
1026 createAttributeGetter<CPS::Real>("mechanical_load_torque"));
1027
1028 py::class_<CPS::EMT::Ph3::SSN_GFL, std::shared_ptr<CPS::EMT::Ph3::SSN_GFL>,
1029 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_GFL",
1030 py::multiple_inheritance())
1031 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
1032 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
1033 .def("set_parameters", &CPS::EMT::Ph3::SSN_GFL::setParameters, "lf"_a,
1034 "cf"_a, "rf"_a, "rc"_a, "omega_n"_a, "kp_pll"_a, "ki_pll"_a,
1035 "omega_cutoff"_a, "p_ref"_a, "q_ref"_a, "kp_power_ctrl"_a,
1036 "ki_power_ctrl"_a, "kp_curr_ctrl"_a, "ki_curr_ctrl"_a)
1037 .def("connect", &CPS::EMT::Ph3::SSN_GFL::connect)
1038 .def("get_state_names", &CPS::EMT::Ph3::SSN_GFL::getLocalStateNames)
1039 .def("get_state", &CPS::EMT::Ph3::SSN_GFL::getState)
1040 .def("get_state_derivative", &CPS::EMT::Ph3::SSN_GFL::getStateDerivative)
1041 .def("get_interface_voltage",
1043 .def("get_interface_current",
1045 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
1046 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
1047 .def_property_readonly("irc_d", createAttributeGetter<CPS::Real>("irc_d"))
1048 .def_property_readonly("irc_q", createAttributeGetter<CPS::Real>("irc_q"))
1049 .def_property_readonly("p_inst",
1051 .def_property_readonly("q_inst",
1053 .def_property_readonly("omega_pll",
1055
1057 std::shared_ptr<CPS::EMT::Ph3::SSN_GFL_Split>,
1058 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_GFL_Split",
1059 py::multiple_inheritance())
1060 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
1061 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
1062 .def("set_parameters", &CPS::EMT::Ph3::SSN_GFL_Split::setParameters,
1063 "lf"_a, "cf"_a, "rf"_a, "rc"_a, "omega_n"_a, "kp_pll"_a, "ki_pll"_a,
1064 "omega_cutoff"_a, "p_ref"_a, "q_ref"_a, "kp_power_ctrl"_a,
1065 "ki_power_ctrl"_a, "kp_curr_ctrl"_a, "ki_curr_ctrl"_a)
1067
1068 // Combined controller + network state.
1069 .def("get_state", &CPS::EMT::Ph3::SSN_GFL_Split::getState)
1070 .def("get_state_derivative",
1072
1073 // Split state access.
1074 .def("get_controller_state",
1076 .def("get_network_state", &CPS::EMT::Ph3::SSN_GFL_Split::getNetworkState)
1077 .def("get_network_state_names",
1079
1080 // Electrical interface / delayed forcing.
1081 .def("get_interface_voltage",
1083 .def("get_interface_current",
1085 .def("get_converter_voltage_reference",
1087 .def("get_delayed_converter_voltage",
1089
1090 // Controller affine model.
1091 .def("get_controller_A", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerA)
1092 .def("get_controller_B", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerB)
1093 .def("get_controller_C", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerC)
1094 .def("get_controller_D", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerD)
1095 .def("get_controller_E", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerE)
1096 .def("get_controller_F", &CPS::EMT::Ph3::SSN_GFL_Split::getControllerF)
1097
1098 // Fixed electrical SSN plant.
1099 .def("get_network_A", &CPS::EMT::Ph3::SSN_GFL_Split::getNetworkA)
1100 .def("get_network_B", &CPS::EMT::Ph3::SSN_GFL_Split::getNetworkB)
1101 .def("get_network_C", &CPS::EMT::Ph3::SSN_GFL_Split::getNetworkC)
1102 .def("get_network_D", &CPS::EMT::Ph3::SSN_GFL_Split::getNetworkD)
1103 .def("get_equivalent_conductance",
1105
1106 // Logged scalar quantities.
1107 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
1108 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
1109 .def_property_readonly("irc_d", createAttributeGetter<CPS::Real>("irc_d"))
1110 .def_property_readonly("irc_q", createAttributeGetter<CPS::Real>("irc_q"))
1111 .def_property_readonly("p_inst",
1113 .def_property_readonly("q_inst",
1115 .def_property_readonly("omega_pll",
1117 .def_property_readonly("vinv_ref_a",
1119 .def_property_readonly("vinv_ref_b",
1121 .def_property_readonly("vinv_ref_c",
1122 createAttributeGetter<CPS::Real>("vinv_ref_c"));
1123
1125 std::shared_ptr<CPS::EMT::Ph3::AvVoltSourceInverterStateSpace>,
1127 mEMTPh3, "AvVoltSourceInverterStateSpace", py::multiple_inheritance())
1128 .def(py::init<std::string, CPS::Logger::Level>(), "name"_a,
1129 "loglevel"_a = CPS::Logger::Level::off)
1130 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
1131 "name"_a, "loglevel"_a = CPS::Logger::Level::off)
1132 .def("set_parameters",
1134 "Lf"_a, "Cf"_a, "Rf"_a, "Rc"_a, "omega_n"_a, "Kp_pll"_a, "Ki_pll"_a,
1135 "omega_cutoff"_a, "p_ref"_a, "q_ref"_a, "Kp_power_ctrl"_a,
1136 "Ki_power_ctrl"_a, "Kp_curr_ctrl"_a, "Ki_curr_ctrl"_a)
1138 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"))
1139 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
1140 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
1141 .def_property_readonly("irc_d", createAttributeGetter<CPS::Real>("irc_d"))
1142 .def_property_readonly("irc_q", createAttributeGetter<CPS::Real>("irc_q"))
1143 .def_property_readonly("p_inst",
1145 .def_property_readonly("q_inst",
1147 .def_property_readonly("omega_pll",
1149
1150 py::class_<CPS::EMT::Ph3::SSN_GFM, std::shared_ptr<CPS::EMT::Ph3::SSN_GFM>,
1151 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_GFM",
1152 py::multiple_inheritance())
1153 .def(py::init<std::string, std::string, CPS::Logger::Level>(), "uid"_a,
1154 "name"_a, "log_level"_a = CPS::Logger::Level::off)
1155 .def("set_parameters", &CPS::EMT::Ph3::SSN_GFM::setParameters, "lf"_a,
1156 "cf"_a, "rf"_a, "rc"_a, "nominal_voltage"_a, "omega_nominal"_a,
1157 "p_ref"_a, "q_ref"_a, "virtual_inertia"_a, "damping_coefficient"_a,
1158 "voltage_droop_gain"_a, "reactive_integral_gain"_a, "kp_voltage"_a,
1159 "ki_voltage"_a, "kp_current"_a, "ki_current"_a,
1160 "active_damping_gain"_a, "power_filter_cutoff"_a,
1161 "delay_bandwidth"_a)
1162 .def("set_numerical_linearization_parameters",
1164 "relative_step"_a = 1e-6, "absolute_step"_a = 1e-8)
1165 .def("set_virtual_impedance",
1166 &CPS::EMT::Ph3::SSN_GFM::setVirtualImpedance, "virtual_resistance"_a,
1167 "virtual_reactance"_a = 0.0)
1168 .def("set_grid_current_feedforward",
1170 .def("set_reactive_power_droop",
1172 "cutoff"_a)
1173 .def("connect", &CPS::EMT::Ph3::SSN_GFM::connect)
1174 .def("get_state_names", &CPS::EMT::Ph3::SSN_GFM::getLocalStateNames)
1175 .def("get_state", &CPS::EMT::Ph3::SSN_GFM::getState)
1176 .def("get_state_derivative", &CPS::EMT::Ph3::SSN_GFM::getStateDerivative)
1177 .def("get_interface_voltage",
1179 .def("get_interface_current",
1181 .def_property_readonly("p_inst",
1183 .def_property_readonly("q_inst",
1185 .def_property_readonly("omega_gfm",
1187 .def_property_readonly("theta_gfm",
1189 .def_property_readonly(
1190 "voltage_magnitude_gfm",
1191 createAttributeGetter<CPS::Real>("voltage_magnitude_gfm"))
1192 .def_property_readonly("vc_d", createAttributeGetter<CPS::Real>("vc_d"))
1193 .def_property_readonly("vc_q", createAttributeGetter<CPS::Real>("vc_q"))
1194 .def_property_readonly("i_grid_d",
1196 .def_property_readonly("i_grid_q",
1198 .def_property_readonly("if_d", createAttributeGetter<CPS::Real>("if_d"))
1199 .def_property_readonly("if_q", createAttributeGetter<CPS::Real>("if_q"))
1200 .def_property_readonly("v_ref_d",
1202 .def_property_readonly("v_ref_q",
1204
1206 std::shared_ptr<CPS::EMT::Ph3::SSN::Capacitor>,
1207 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_Capacitor",
1208 py::multiple_inheritance())
1209 .def(py::init<std::string>())
1210 .def(py::init<std::string, CPS::Logger::Level>())
1211 .def("set_parameters", &CPS::EMT::Ph3::SSN::Capacitor::setParameters,
1212 "C"_a)
1214 .def_property("C", createAttributeGetter<CPS::Matrix>("C"),
1216
1218 std::shared_ptr<CPS::EMT::Ph3::SSN::Inductor>,
1219 CPS::SimPowerComp<CPS::Real>>(mEMTPh3, "SSN_Inductor",
1220 py::multiple_inheritance())
1221 .def(py::init<std::string>())
1222 .def(py::init<std::string, CPS::Logger::Level>())
1223 .def("set_parameters", &CPS::EMT::Ph3::SSN::Inductor::setParameters,
1224 "L"_a)
1226 .def_property("L", createAttributeGetter<CPS::Matrix>("L"),
1228
1230 std::shared_ptr<CPS::EMT::Ph3::GenericFourTerminalVTypeSSN>,
1232 mEMTPh3, "GenericFourTerminalVTypeSSN", py::multiple_inheritance())
1233 .def(py::init<std::string>())
1234 .def(py::init<std::string, CPS::Logger::Level>())
1235 .def("set_parameters",
1237 "B"_a, "C"_a, "D"_a, "D1"_a = CPS::Matrix())
1239 .def_property_readonly("x", createAttributeGetter<CPS::Matrix>("x"));
1240}
PYBIND11_DECLARE_HOLDER_TYPE(T, CPS::AttributePointer< T >)
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.
Common base for three-phase switches.
void setParameters(Matrix openResistance, Matrix closedResistance, Bool closed=false)
void setTapRatio(Real tapRatio)
Set a positive tap multiplier applied to the nominal complex ratio.
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 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.
void setTransformerParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, Real ratedPower, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance, Real omega)
Setter for parameters of transformer.
void setParameters(Matrix currentRef)
Setter for reference current.
Ideal current source model.
void setParameters(MatrixComp currentRef, Real srcFreq=50.0)
Setter for reference current.
void setInitialStateValues(Real pInit, Real qInit, Real phiDInit, Real phiQInit, Real gammaDInit, Real gammaQInit)
void setFilterParameters(Real lf, Real cf, Real rf)
Filter parameters. No Rc exists in this model.
void setControllerParameters(Real kpPLL, Real kiPLL, Real kpPowerCtrl, Real kiPowerCtrl, Real kpCurrCtrl, Real kiCurrCtrl, Real omegaCutoff)
Controller parameters.
void setParameters(Real sysOmega, Real sysVoltNom, Real pRef, Real qRef)
General operating parameters.
void withControl(Bool controlOn)
Concrete generic three-phase, two-terminal I-type SSN component.
Concrete generic three-phase, two-terminal V-type SSN component.
One end of a Bergeron travelling-wave line. Two of these replace a single Signal::DecouplingLineEMT_P...
const Attribute< Matrix >::Ptr mSendingVolt
This end's voltage one travel time ago, for the other half to read.
void setParameters(Matrix resistance, Matrix inductance, Matrix capacitance)
Line data. Give the parameters of the whole line, not of this half.
const Attribute< Matrix >::Ptr mSendingCur
This end's current one travel time ago, for the other half to read.
void setCouplingSource(Attribute< Matrix >::Ptr receivingVolt, Attribute< Matrix >::Ptr receivingCur)
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage parameters.
void setParameters(Real activePower, Real reactivePower, Real nominalVoltage, Real minimumVoltagePerUnit=0.1)
Sets total three-phase P/Q, nominal line-to-line voltage and voltage floor.
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)
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 &inductance)
void setParameters(const Matrix &seriesResistance, const Matrix &seriesInductance, const Matrix &parallelCapacitance=Matrix::Zero(3, 3), const Matrix &parallelConductance=Matrix::Zero(3, 3))
void setParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, Real ratedPower, Real ratioAbs, Real ratioPhase, Matrix resistance, Matrix inductance)
void setMagnetizingBranch(Real noLoadCurrent, Real noLoadLoss)
Partitioned three-phase grid-following inverter.
Matrix getState() const
Combined state in the same logical order as the former monolithic GFL: 8 controller states followed b...
Matrix getEquivalentConductance() const
Constant SSN Norton conductance G = mW.
std::vector< String > getLocalStateNames() const override final
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)
Configure the filter, PLL, power controller and current controller.
Matrix getInterfaceVoltage() const
std::vector< String > getLocalStateNames() const override final
Matrix getInterfaceCurrent() const
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)
Configure the GFL filter, PLL, power loop and current loop.
Matrix getStateDerivative() const
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...
Induction machine model formulated as a variable V-type SSN component.
void setParameters(Real nominalFrequency, Int polePairs, Real statorResistance, Real rotorResistance, Real statorInductance, Real rotorInductance, Real mutualInductance, Real rotorInertia, Real mechanicalDamping, Real mechanicalTorque, Real initialElectricalAngle=0.0, Bool autoInitializeMechanicalTorque=true)
Configure the sixth-order machine.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
void closeSwitch() override
void openSwitch() override
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.
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)
Transformer that includes an inductance and resistance.
void setMagnetizingBranch(Real noLoadCurrent, Real noLoadLoss)
Sets the magnetizing branch from the no-load test quantities.
void setReferenceWinding(WindingReference referenceWinding)
Selects the winding the nameplate impedance is referred to.
void setParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, 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 setTransformerParameters(Real nomVoltagePrimary, Real nomVoltageSecondary, Real ratedPower, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance, Real omega)
Setter for parameters of transformer.
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.
Ideal Voltage source model.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage and frequency with a sine wave generator.
Voltage source with Norton equivalent model.
void setParameters(Complex voltageRef, Real srcFreq, Real resistance)
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, const Matrix &D1=Matrix())
Interface to be used by synchronous generators.
void setComplexInitialVoltageScale(Real scale)
Definition SimNode.h:74
static Ptr GND
Definition SimNode.h:37
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
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:79
std::string String
Definition Definitions.h:63
double Real
Definition Definitions.h:60
CPS::Matrix zeroMatrix(int dim)
Definition Utils.cpp:11