DPsim
Loading...
Searching...
No Matches
EMT_Ph3_SSN_InductionMotor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include <memory>
7
9
10namespace CPS {
11namespace EMT {
12namespace Ph3 {
13
27public:
28 using Ptr = std::shared_ptr<SSN_InductionMotor>;
29
31 Logger::Level logLevel = Logger::Level::off) {
32 return std::make_shared<SSN_InductionMotor>(uid, name, logLevel);
33 }
34
35 static Ptr make(String name, Logger::Level logLevel = Logger::Level::off) {
36 return std::make_shared<SSN_InductionMotor>(name, name, logLevel);
37 }
38
48
49protected:
50 static constexpr Int mElectricalStateSize = 4;
51 static constexpr Int mStateSize = StateCount;
52 static constexpr Int mInputSize = 3;
53 static constexpr Int mOutputSize = 3;
54
56
59
62
63 //rotor inductance
65 //mutual inductance
67 //stator inductance
69
72
76
81
84
96
111
114 getInverseParkTransformMatrix(Real electricalAngle) const;
116
117 void evaluateStateDerivative(const Matrix &x, const Matrix &u,
118 Matrix &stateDerivative) const;
119 void evaluateOutput(const Matrix &x, const Matrix &u, Matrix &output) const;
120
121 void calculateNumericalJacobians(const Matrix &x, const Matrix &u, Matrix &A,
122 Matrix &B, Matrix &C, Matrix &D) const;
123
124 void buildStateSpaceModel(const Matrix &x, const Matrix &u, Matrix &A,
125 Matrix &B, Matrix &C, Matrix &D, Matrix &E,
126 Matrix &F) const;
127
129
130 std::vector<String> getLocalStateNames() const override;
131 void updateLogAttributes(const Matrix &u) const override;
132
133public:
135 Logger::Level logLevel = Logger::Level::off);
136
138 Logger::Level logLevel = Logger::Level::off)
139 : SSN_InductionMotor(name, name, logLevel) {}
140
151 void setParameters(Real nominalFrequency, Int polePairs,
152 Real statorResistance, Real rotorResistance,
153 Real statorInductance, Real rotorInductance,
154 Real mutualInductance, Real rotorInertia,
155 Real mechanicalDamping, Real mechanicalTorque,
156 Real initialElectricalAngle = 0.0,
157 Bool autoInitializeMechanicalTorque = true);
158
159 void setMechanicalTorque(Real mechanicalTorque);
160
162 Real absoluteStep);
163
164 void initializeFromNodesAndTerminals(Real frequency) override;
165
166 Matrix getState() const;
170 std::vector<String> getStateNames() const { return getLocalStateNames(); }
171};
172
173} // namespace Ph3
174} // namespace EMT
175} // namespace CPS
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:249
void evaluateOutput(const Matrix &x, const Matrix &u, Matrix &output) const
std::vector< String > getStateNames() const
std::vector< String > getLocalStateNames() const override
void initializeFromNodesAndTerminals(Real frequency) override
Initializes Component variables according to power flow data stored in Nodes.
void evaluateStateDerivative(const Matrix &x, const Matrix &u, Matrix &stateDerivative) const
void setParameters(Real nominalFrequency, Int polePairs, Real statorResistance, Real rotorResistance, Real statorInductance, Real rotorInductance, Real mutualInductance, Real rotorInertia, Real mechanicalDamping, Real mechanicalTorque, Real initialElectricalAngle=0.0, Bool autoInitializeMechanicalTorque=true)
Configure the sixth-order machine.
SSN_InductionMotor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void updateLogAttributes(const Matrix &u) const override
Update derived attributes used for logging/inspection.
static Ptr make(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Matrix mJacobianPerturbation
Pre-sized scratch storage for the per-step finite-difference Jacobian.
SSN_InductionMotor(String name, Logger::Level logLevel=Logger::Level::off)
std::shared_ptr< SSN_InductionMotor > Ptr
void buildStateSpaceModel(const Matrix &x, const Matrix &u, Matrix &A, Matrix &B, Matrix &C, Matrix &D, Matrix &E, Matrix &F) const
MatrixFixedSize< 3, 2 > getInverseParkTransformMatrix(Real electricalAngle) const
static Ptr make(String name, Logger::Level logLevel=Logger::Level::off)
MatrixFixedSize< 2, 3 > getParkTransformMatrix(Real electricalAngle) const
void setNumericalLinearizationParameters(Real relativeStep, Real absoluteStep)
void calculateNumericalJacobians(const Matrix &x, const Matrix &u, Matrix &A, Matrix &B, Matrix &C, Matrix &D) const
TwoTerminalVTypeVariableSSNComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
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
Eigen::Matrix< Real, rows, cols, Eigen::ColMajor > MatrixFixedSize
Dense matrix for real numbers with fixed dimension.
Definition Definitions.h:99
double Real
Definition Definitions.h:60
int Int
Definition Definitions.h:59
bool Bool
Definition Definitions.h:62