23 const Int mOutputSize;
AttributePointer< Attribute< T > > Ptr
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override final
MatrixComp mStateUpdateInput
Reused post-step buffers for the trapezoidal state update.
virtual void updateStateSpaceModel()
Hook for variable/time-varying SSN components.
virtual MatrixComp calculateHistoryVector() const
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.
virtual void updateState(const MatrixComp &uOld, const MatrixComp &uNew)
MatrixComp mYHist
Complex history term.
virtual Attribute< MatrixComp >::Ptr inputAttribute() const =0
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.
MatrixComp mHistoryState
Reused workspaces for the per-step history calculation.
virtual void recomputeDiscreteModel(Real omega)
Discretize the augmented model and fold it into complex dA, dB, W.
void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override final
MatrixComp mW
Complex Norton matrix W = C dB + D + (2 / dt + j omega) D1.
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D, const Matrix &D1=Matrix())
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override final
virtual void updateHistoryVector(MatrixComp &history)
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).
std::vector< UInt > mRightVectorAffectedIndices
MNA rows that may receive this component's compact history stamp.
SSNComp(String uid, String name, Int inputSize, Int outputSize, Logger::Level logLevel=Logger::Level::off)
Matrix buildAugmentedB() const
Build B_aug = blkdiag(B, B).
const MatrixComp & getDiscreteB() const
Get the complex discrete input operator of the envelope model.
void mnaAddCompactRightSideVectorStamp(Matrix &rightVector) override final
virtual MatrixComp calculateSteadyStateOutputFromInput(const MatrixComp &x, const MatrixComp &u) const
virtual Attribute< MatrixComp >::Ptr outputAttribute() const =0
void mnaCompPreStep(Real time, Int timeStepCount) override final
Matrix mD1
Feedthrough from the envelope derivative of the input, for capacitive ports.
Bool mnaHasCompactRightSideVectorStamp() const override final
String uid()
Returns unique id.
spdlog::level::level_enum Level
MNASimPowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.