DPsim
Loading...
Searching...
No Matches
EMT_Ph3_SSN_Inductor.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
17
23
25 if (inductance.rows() != 3 || inductance.cols() != 3)
26 throw std::invalid_argument("Inductance matrix must have size 3 x 3.");
27
28 **mInductance = inductance;
29
30 Matrix inverseInductance = inductance.inverse();
31 Matrix identity3 = Matrix::Identity(3, 3);
32
33 // State choice:
34 // x = i_abc -> 3x1
35 // u = v_abc -> 3x1
36 // y = i_abc -> 3x1
37 Matrix aMatrix = Matrix::Zero(3, 3);
38 Matrix bMatrix = inverseInductance;
39 Matrix cMatrix = identity3;
40 Matrix dMatrix = Matrix::Zero(3, 3);
41
42 SSNComp::setParameters(aMatrix, bMatrix, cMatrix, dMatrix);
43}
const CPS::Attribute< Matrix >::Ptr mInductance
Inductance [H].
Inductor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void setParameters(const Matrix &inductance)
SimPowerComp< Real >::Ptr clone(String name) override final
Returns a modified copy of the component with the given suffix added to the name and without.
TwoTerminalVTypeSSNComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D)
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
Logger::Level mLogLevel
Component logger control for internal variables.
static std::shared_ptr< T > make(Args &&...args)
Definition PtrFactory.h:19
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:81
std::string String
Definition Definitions.h:65