DPsim
Loading...
Searching...
No Matches
SignalComponents.cpp
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#include <DPsim.h>
10#include <dpsim-models/CSVReader.h>
11#include <dpsim-models/IdentifiedObject.h>
12#include <dpsim/RealTimeSimulation.h>
13#include <dpsim/Simulation.h>
14#include <dpsim/pybind/SignalComponents.h>
15#include <dpsim/pybind/Utils.h>
16
17namespace py = pybind11;
18using namespace pybind11::literals;
19
20void addSignalComponents(py::module_ mSignal) {
21
23 std::shared_ptr<CPS::TopologicalSignalComp>,
24 CPS::IdentifiedObject>(mSignal, "TopologicalSignalComp");
25 py::class_<CPS::SimSignalComp, std::shared_ptr<CPS::SimSignalComp>,
26 CPS::TopologicalSignalComp>(mSignal, "SimSignalComp");
27
29 std::shared_ptr<CPS::Signal::DecouplingLine>, CPS::SimSignalComp>(
30 mSignal, "DecouplingLine", py::multiple_inheritance())
31 .def(py::init<std::string>())
32 .def(py::init<std::string, CPS::Logger::Level>())
33 .def("set_parameters", &CPS::Signal::DecouplingLine::setParameters,
34 "node_1"_a, "node_2"_a, "resistance"_a, "inductance"_a,
35 "capacitance"_a)
36 .def("get_line_components",
37 &CPS::Signal::DecouplingLine::getLineComponents);
38
40 std::shared_ptr<CPS::Signal::DecouplingLineEMT>,
41 CPS::SimSignalComp>(mSignal, "DecouplingLineEMT",
42 py::multiple_inheritance())
43 .def(py::init<std::string>())
44 .def(py::init<std::string, CPS::Logger::Level>())
45 .def("set_parameters", &CPS::Signal::DecouplingLineEMT::setParameters,
46 "node_1"_a, "node_2"_a, "resistance"_a, "inductance"_a,
47 "capacitance"_a)
48 .def("get_line_components",
49 &CPS::Signal::DecouplingLineEMT::getLineComponents);
50
51 py::class_<CPS::Signal::Exciter, std::shared_ptr<CPS::Signal::Exciter>,
52 CPS::SimSignalComp>(mSignal, "Exciter", py::multiple_inheritance())
53 .def(py::init<std::string>())
54 .def(py::init<std::string, CPS::Logger::Level>())
55 .def("set_parameters", &CPS::Signal::Exciter::setParameters, "Ta"_a,
56 "Ka"_a, "Te"_a, "Ke"_a, "Tf"_a, "Kf"_a, "Tr"_a, "max_vr"_a = 1.0,
57 "min_vr"_a = -0.9);
58
60 std::shared_ptr<CPS::Signal::TurbineGovernorType1>,
61 CPS::SimSignalComp>(mSignal, "TurbineGovernorType1",
62 py::multiple_inheritance())
63 .def(py::init<std::string>())
64 .def(py::init<std::string, CPS::Logger::Level>())
66 "T3"_a, "T4"_a, "T5"_a, "Tc"_a, "Ts"_a, "R"_a, "Tmin"_a, "Tmax"_a,
67 "OmRef"_a);
68}
void setParameters(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf, Real Tr, Real maxVr=1.0, Real minVr=-0.9)
Initializes exciter parameters.
Definition Exciter.cpp:23
void setParameters(Real T3, Real T4, Real T5, Real Tc, Real Ts, Real R, Real Tmin, Real Tmax, Real OmRef)
Initializes exciter parameters.