11 #include <dpsim-models/Base/Base_Ph1_Capacitor.h>
12 #include <dpsim-models/MNASimPowerComp.h>
38 Logger::Level logLevel = Logger::Level::off);
40 Capacitor(String name, Logger::Level logLevel = Logger::Level::off)
55 void mnaCompInitializeHarm(
56 Real omega, Real timeStep,
60 void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix,
61 Int freqIdx)
override;
64 void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector)
override;
67 void mnaCompUpdateVoltageHarm(
const Matrix &leftVector, Int freqIdx);
68 void mnaCompApplyRightSideVectorStampHarm(Matrix &sourceVector,
69 Int freqIdx)
override;
72 void mnaCompUpdateCurrentHarm();
80 AttributeBase::List &prevStepDependencies,
81 AttributeBase::List &attributeDependencies,
82 AttributeBase::List &modifiedAttributes)
override;
86 AttributeBase::List &attributeDependencies,
87 AttributeBase::List &modifiedAttributes,
93 :
Task(**capacitor.
mName +
".MnaPreStepHarm"), mCapacitor(capacitor) {
95 mModifiedAttributes.push_back(capacitor.
attribute(
"right_vector"));
96 mPrevStepDependencies.push_back(capacitor.
attribute(
"i_intf"));
97 mPrevStepDependencies.push_back(capacitor.
attribute(
"v_intf"));
99 void execute(Real time, Int timeStepCount);
109 :
Task(**capacitor.
mName +
".MnaPostStepHarm"), mCapacitor(capacitor),
110 mLeftVectors(leftVectors) {
111 for (UInt i = 0; i < mLeftVectors.size(); i++)
112 mAttributeDependencies.push_back(mLeftVectors[i]);
113 mModifiedAttributes.push_back(mCapacitor.
attribute(
"v_intf"));
114 mModifiedAttributes.push_back(mCapacitor.
attribute(
"i_intf"));
116 void execute(Real time, Int timeStepCount);
120 std::vector<Attribute<Matrix>::Ptr> mLeftVectors;
Capacitor(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
Capacitor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
void mnaCompPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
MatrixComp mPrevVoltCoeff
Coefficient in front of previous voltage value for harmonics.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void initialize(Matrix frequencies) override
Initialize components with correct network frequencies.
MatrixComp mEquivCurrent
DC equivalent current source for harmonics [A].
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes internal variables of the component.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system result.
MatrixComp mEquivCond
Equivalent conductance for harmonics [S].
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system result.
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
SimPowerComp< Complex >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
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.