11 #include <dpsim-models/Base/Base_Ph1_Inductor.h>
12 #include <dpsim-models/MNASimPowerComp.h>
13 #include <dpsim-models/Solver/MNATearInterface.h>
37 void initVars(Real timeStep);
42 Logger::Level logLevel = Logger::Level::off);
44 Inductor(String name, Logger::Level logLevel = Logger::Level::off)
59 void mnaCompInitializeHarm(
60 Real omega, Real timeStep,
64 void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix,
65 Int freqIdx)
override;
68 void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector)
override;
71 void mnaCompUpdateVoltageHarm(
const Matrix &leftVector, Int freqIdx);
74 void mnaCompUpdateCurrentHarm();
82 AttributeBase::List &prevStepDependencies,
83 AttributeBase::List &attributeDependencies,
84 AttributeBase::List &modifiedAttributes)
override;
88 AttributeBase::List &attributeDependencies,
89 AttributeBase::List &modifiedAttributes,
93 void mnaTearInitialize(Real omega, Real timestep)
override;
94 void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix)
override;
95 void mnaTearApplyVoltageStamp(Matrix &voltageVector)
override;
96 void mnaTearPostStep(Complex voltage, Complex current)
override;
101 :
Task(**inductor.
mName +
".MnaPreStepHarm"), mInductor(inductor) {
103 mModifiedAttributes.push_back(inductor.
attribute(
"right_vector"));
104 mPrevStepDependencies.push_back(inductor.
attribute(
"v_intf"));
105 mPrevStepDependencies.push_back(inductor.
attribute(
"i_intf"));
107 void execute(Real time, Int timeStepCount);
117 :
Task(**inductor.
mName +
".MnaPostStepHarm"), mInductor(inductor),
118 mLeftVectors(leftVectors) {
119 for (UInt i = 0; i < mLeftVectors.size(); i++)
120 mAttributeDependencies.push_back(mLeftVectors[i]);
121 mModifiedAttributes.push_back(mInductor.
attribute(
"v_intf"));
122 mModifiedAttributes.push_back(mInductor.
attribute(
"i_intf"));
124 void execute(Real time, Int timeStepCount);
128 std::vector<Attribute<Matrix>::Ptr> mLeftVectors;
MatrixComp mEquivCond
Equivalent conductance for harmonics [S].
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system results.
Inductor(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and log level.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
SimPowerComp< Complex >::Ptr clone(String name) override
Return new instance with the same parameters.
MatrixComp mEquivCurrent
DC equivalent current source for harmonics [A].
void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes MNA specific variables.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system results.
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
MatrixComp mPrevCurrFac
Coefficient in front of previous current value for harmonics.
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes states from power flow data.
void initialize(Matrix frequencies) override
Initializes state variables considering the number of frequencies.
void mnaCompPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
Inductor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and log level.
const Attribute< String >::Ptr mName
Human readable name.
String uid()
Returns unique id.
AttributeBase::Ptr attribute(const String &name) const
Return pointer to an attribute.
Base class for all MNA components that are transmitting power.
Base class for all components that are transmitting power.
Tasks to be defined by every component.