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
80
83
98
99 Matrix getParkTransformMatrix(Real electricalAngle) const;
100 Matrix getInverseParkTransformMatrix(Real electricalAngle) const;
101 Matrix buildSpeedMatrix(Real electricalSpeed) const;
102
104
105 void evaluateStateDerivative(const Matrix &x, const Matrix &u,
106 Matrix &stateDerivative) const;
107 void evaluateOutput(const Matrix &x, const Matrix &u, Matrix &output) const;
108
109 void calculateNumericalJacobians(const Matrix &x, const Matrix &u, Matrix &A,
110 Matrix &B, Matrix &C, Matrix &D) const;
111
112 void buildStateSpaceModel(const Matrix &x, const Matrix &u, Matrix &A,
113 Matrix &B, Matrix &C, Matrix &D, Matrix &E,
114 Matrix &F) const;
115
117
118 std::vector<String> getLocalStateNames() const override;
119 void updateLogAttributes(const Matrix &u) const override;
120
121public:
123 Logger::Level logLevel = Logger::Level::off);
124
126 Logger::Level logLevel = Logger::Level::off)
127 : SSN_InductionMotor(name, name, logLevel) {}
128
139 void setParameters(Real nominalFrequency, Int polePairs,
140 Real statorResistance, Real rotorResistance,
141 Real statorInductance, Real rotorInductance,
142 Real mutualInductance, Real rotorInertia,
143 Real mechanicalDamping, Real mechanicalTorque,
144 Real initialElectricalAngle = 0.0,
145 Bool autoInitializeMechanicalTorque = true);
146
147 void setMechanicalTorque(Real mechanicalTorque);
148
150 Real absoluteStep);
151
152 void initializeFromNodesAndTerminals(Real frequency) override;
153
154 Matrix getState() const;
158 std::vector<String> getStateNames() const { return getLocalStateNames(); }
159};
160
161} // namespace Ph3
162} // namespace EMT
163} // 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
Matrix buildSpeedMatrix(Real electricalSpeed) 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)
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
Matrix getInverseParkTransformMatrix(Real electricalAngle) const
Matrix getParkTransformMatrix(Real electricalAngle) const
static Ptr make(String name, Logger::Level logLevel=Logger::Level::off)
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:81
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61
bool Bool
Definition Definitions.h:64