DPsim
Loading...
Searching...
No Matches
TopologicalNode.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
14
16
18 **mInitialVoltage = voltage;
19}
20
23 (**mInitialVoltage)(0, 0) = voltage;
24 } else {
25 (**mInitialVoltage)(0, 0) = voltage;
26 (**mInitialVoltage)(1, 0) = SHIFT_TO_PHASE_B * voltage;
27 (**mInitialVoltage)(2, 0) = SHIFT_TO_PHASE_C * voltage;
28 }
29}
30
31void TopologicalNode::setInitialVoltage(Complex voltage, Int phaseIndex) const {
32 (**mInitialVoltage)(phaseIndex, 0) = voltage;
33}
34
36
38 const std::vector<Complex> &initialVoltage)
40 mInitialVoltage(mAttributes->create<MatrixComp>("voltage_init")) {
41
44 //mMatrixNodeIndex = matrixNodeIndex;
45 **mInitialVoltage = MatrixComp::Zero(3, 1);
48 } else {
49 //mMatrixNodeIndex = { matrixNodeIndex[0] };
50 **mInitialVoltage = MatrixComp::Zero(1, 1);
52 }
53}
54
57 return (**mInitialVoltage)(1, 0);
58 else if (phaseType == PhaseType::C)
59 return (**mInitialVoltage)(2, 0);
60 else // phaseType == PhaseType::Single || mPhaseType == PhaseType::A
61 return (**mInitialVoltage)(0, 0);
62}
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
void setInitialVoltage(MatrixComp voltage) const
const Attribute< MatrixComp >::Ptr mInitialVoltage
PhaseType phaseType() const
Complex initialSingleVoltage(PhaseType phaseType=PhaseType::Single)
MatrixComp initialVoltage() const
#define SHIFT_TO_PHASE_C
Definition Definitions.h:47
#define SHIFT_TO_PHASE_B
Definition Definitions.h:46
std::string String
Definition Definitions.h:65
int Int
Definition Definitions.h:61
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
bool Bool
Definition Definitions.h:64