DPsim
Loading...
Searching...
No Matches
Base_Ph3_Switch.h
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#pragma once
10
11#include <dpsim-models/AttributeList.h>
12#include <dpsim-models/Definitions.h>
13namespace CPS {
14namespace Base {
15namespace Ph3 {
17class Switch {
18public:
20 const CPS::Attribute<Matrix>::Ptr mOpenResistance;
22 const CPS::Attribute<Matrix>::Ptr mClosedResistance;
24 const CPS::Attribute<Bool>::Ptr mSwitchClosed;
25
26 explicit Switch(CPS::AttributeList::Ptr attributeList)
27 : mOpenResistance(attributeList->create<Matrix>("R_open")),
28 mClosedResistance(attributeList->create<Matrix>("R_closed")),
29 mSwitchClosed(attributeList->create<Bool>("is_closed")){};
30
32 void setParameters(Matrix openResistance, Matrix closedResistance,
33 Bool closed = false) {
34 **mOpenResistance = openResistance;
35 **mClosedResistance = closedResistance;
36 **mSwitchClosed = closed;
37 }
38 void closeSwitch() { **mSwitchClosed = true; }
39 void openSwitch() { **mSwitchClosed = false; }
40};
41} // namespace Ph3
42} // namespace Base
43} // namespace CPS
const CPS::Attribute< Matrix >::Ptr mClosedResistance
Resistance if switch is closed [ohm].
const CPS::Attribute< Bool >::Ptr mSwitchClosed
Defines if Switch is open or closed.
const CPS::Attribute< Matrix >::Ptr mOpenResistance
Resistance if switch is open [ohm].