DPsim
Loading...
Searching...
No Matches
TopologicalTerminal.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
10
11using namespace CPS;
12
18
20
22
24
28 mPower = MatrixComp::Zero(3, 1);
29 else
30 mPower = MatrixComp::Zero(1, 1);
31}
32
34
36
40
44
46 return topologicalNodes()->matrixNodeIndices();
47}
48
51 return mPower(1, 0);
52 else if (mPhaseType == PhaseType::C)
53 return mPower(2, 0);
54 else // mPhaseType == PhaseType::Single || mPhaseType == PhaseType::A
55 return mPower(0, 0);
56}
57
60 return topologicalNodes()->initialVoltage().block(0, 0, 1, 1);
61 else if (mPhaseType == PhaseType::B)
62 return topologicalNodes()->initialVoltage().block(1, 0, 1, 1);
63 else if (mPhaseType == PhaseType::C)
64 return topologicalNodes()->initialVoltage().block(2, 0, 1, 1);
65 else
66 return topologicalNodes()->initialVoltage();
67}
String uid()
Returns unique id.
String type()
Get component type (cross-platform)
virtual TopologicalNode::Ptr topologicalNodes()=0
Returns reference to TopologicalNode.
std::vector< UInt > matrixNodeIndices()
void setPhaseType(PhaseType type)
MatrixComp power() const
Returns Power as complex matrix, where the size depends on the number of phases.
TopologicalTerminal(String uid, String name, PhaseType phase=PhaseType::Single)
PhaseType mPhaseType
Determines the connection between Component and Node.
MatrixComp mPower
Power through the Terminal.
Complex singlePower()
Returns single complex number for power.
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
std::complex< Real > Complex
Definition Definitions.h:63
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.
Definition Definitions.h:84
unsigned int UInt
Definition Definitions.h:60