6#include <dpsim-models/MNASimPowerComp.h>
7#include <dpsim-models/Solver/MNAInterface.h>
21 const Int mOutputSize;
34 MatrixComp mDiscreteB;
42 const Attribute<MatrixComp>::Ptr
mX;
44 SSNComp(String
uid, String name, Int inputSize, Int outputSize,
45 Logger::Level logLevel = Logger::Level::off);
55 virtual MatrixComp calculateHistoryVector()
const;
61 calculateSteadyStateOutputFromInput(
const MatrixComp &x,
62 const MatrixComp &u)
const;
64 virtual void updateState(
const MatrixComp &uOld,
const MatrixComp &uNew);
69 virtual Attribute<MatrixComp>::Ptr inputAttribute()
const = 0;
70 virtual Attribute<MatrixComp>::Ptr outputAttribute()
const = 0;
81 const Matrix &
getC()
const;
83 void setParameters(
const Matrix &A,
const Matrix &B,
const Matrix &C,
86 void mnaCompInitialize(Real omega, Real timeStep,
87 Attribute<Matrix>::Ptr leftVector)
override final;
89 void mnaCompAddPreStepDependencies(
90 AttributeBase::List &prevStepDependencies,
91 AttributeBase::List &attributeDependencies,
92 AttributeBase::List &modifiedAttributes)
override final;
94 void mnaCompPreStep(Real time, Int timeStepCount)
override final;
96 void mnaCompAddPostStepDependencies(
97 AttributeBase::List &prevStepDependencies,
98 AttributeBase::List &attributeDependencies,
99 AttributeBase::List &modifiedAttributes,
100 Attribute<Matrix>::Ptr &leftVector)
override final;
virtual void updateStateSpaceModel()
Hook for variable/time-varying SSN components.
Matrix mA
Continuous-time real physical model (user-provided).
const MatrixComp & getDiscreteA() const
Get the complex discrete state-transition operator of the envelope model.
UInt getStateCount() const
Get number of internal state variables of the SSN model.
MatrixComp mYHist
Complex history term.
Matrix buildAugmentedA(Real omega) const
Build A_aug = [[A, w I], [-w I, A]].
virtual MatrixComp calculateSteadyStateStateFromInput(const MatrixComp &u, Real omega) const
Steady-state envelope state X_ss = (j w I - A)^-1 B u.
virtual void recomputeDiscreteModel(Real omega)
Discretize the augmented model and fold it into complex dA, dB, W.
MatrixComp mW
Complex Norton matrix W = C dB + D.
const Attribute< MatrixComp >::Ptr mX
Complex envelope state X.
const Matrix & getC() const
Get the continuous-time output matrix of the SSN model.
MatrixComp mDiscreteA
Complex envelope discrete operators (folded from the augmented model).
Matrix buildAugmentedB() const
Build B_aug = blkdiag(B, B).
const MatrixComp & getDiscreteB() const
Get the complex discrete input operator of the envelope model.
String uid()
Returns unique id.
MNASimPowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)