DPsim
Loading...
Searching...
No Matches
EMT_Ph3_Shunt.h
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#pragma once
10
16
17namespace CPS {
18namespace EMT {
19namespace Ph3 {
20
21class Shunt : public CompositePowerComp<Real>, public SharedFactory<Shunt> {
22private:
24 Matrix mConductance;
26 Matrix mSusceptance;
27
29 std::shared_ptr<Capacitor> mSubCapacitor;
31 std::shared_ptr<Inductor> mSubInductor;
33 std::shared_ptr<Resistor> mSubResistor;
34 Bool mUseSubcomponents = true;
35 Matrix mCapEquivalentConductance = Matrix::Zero(3, 3);
36 Matrix mIndEquivalentConductance = Matrix::Zero(3, 3);
37 Matrix mCapEquivalentCurrent = Matrix::Zero(3, 1);
38 Matrix mIndEquivalentCurrent = Matrix::Zero(3, 1);
39 Matrix mCapBranchCurrent = Matrix::Zero(3, 1);
40 Matrix mIndBranchCurrent = Matrix::Zero(3, 1);
41
42public:
44 Shunt(String uid, String name, Logger::Level logLevel = Logger::Level::off);
45
47 Shunt(String name, Logger::Level logLevel = Logger::Level::off)
48 : Shunt(name, name, logLevel) {}
49
50 Shunt(String uid, String name, Bool useSubcomponents,
51 Logger::Level logLevel = Logger::Level::off);
52 Shunt(String name, Bool useSubcomponents,
53 Logger::Level logLevel = Logger::Level::off)
54 : Shunt(name, name, useSubcomponents, logLevel) {}
55
56 // #### General ####
58 void setParameters(Real conductance, Real susceptance);
59 void setParameters(Matrix conductance, Matrix susceptance);
60
61 // #### MNA section ####
63 void initializeParentFromNodesAndTerminals(Real frequency) final;
64 void mnaParentInitialize(Real omega, Real timeStep,
65 Attribute<Matrix>::Ptr leftVector) override;
66 void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override;
67 void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override;
70 AttributeBase::List &prevStepDependencies,
71 AttributeBase::List &attributeDependencies,
72 AttributeBase::List &modifiedAttributes) final;
74 void mnaParentPreStep(Real time, Int timeStepCount) final;
76 void mnaCompUpdateCurrent(const Matrix &leftVector) final;
78 void mnaCompUpdateVoltage(const Matrix &leftVector) final;
80 void mnaParentPostStep(Real time, Int timeStepCount,
81 Attribute<Matrix>::Ptr &leftVector) final;
83 void
85 AttributeBase::List &attributeDependencies,
86 AttributeBase::List &modifiedAttributes,
87 Attribute<Matrix>::Ptr &leftVector) final;
88};
89} // namespace Ph3
90} // namespace EMT
91} // namespace CPS
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:249
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) final
MNA post-step operations.
void mnaCompUpdateVoltage(const Matrix &leftVector) final
Updates internal voltage variable of the component.
void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
void mnaParentPreStep(Real time, Int timeStepCount) final
MNA pre step operations.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) final
Add MNA pre step dependencies.
Shunt(String name, Bool useSubcomponents, Logger::Level logLevel=Logger::Level::off)
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) final
add MNA post-step dependencies
void mnaParentInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override
void initializeParentFromNodesAndTerminals(Real frequency) final
Initializes component from power flow data.
Shunt(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Shunt(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void mnaCompUpdateCurrent(const Matrix &leftVector) final
Updates internal current variable of the component.
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
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
int Int
Definition Definitions.h:59
bool Bool
Definition Definitions.h:62
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).
Definition Definitions.h:72