131 Int freqIdx)
override;
141 Real mZeroCrossingTolerance = 1e-6;
142 Real mExponentialSwitchingTime = 0.01;
143 Real mTimeStep = 0.0;
146 Real mShiftOmega = 0.0;
148 Bool mPoleClosedPrev =
false;
149 Real mEffectiveResistancePrev = 0.0;
151 Real mPreviousInstantaneousCurrent = 0.0;
152 Real mPreviousCurrentTime = 0.0;
153 Bool mPreviousCurrentValid =
false;
155 Bool mResetZeroCrossingHistory =
false;
156 Bool mExponentialTransitionStarted =
false;
158 void setPoleClosed(
Bool closed);
160 void resetZeroCrossingTime();
162 void synchronizeEffectiveResistance(
Bool closed);
164 void resetExponentialTransition();
165 void validateExponentialResistanceParameters()
const;
166 Real exponentialResistance(
Real alpha)
const;
167 void updateExponentialTransition(
Real time);
169 Complex currentConductance()
const;
171 Real reconstructInstantaneousCurrent(
Real time)
const;
173 Bool currentCrossedZero(
Real previousCurrent,
Real current)
const;
175 Real interpolateZeroCrossingTime(
Real previousCurrent,
Real current,
176 Real previousTime,
Real currentTime)
const;
178 void updateZeroCrossingState(
Real time);
AttributePointer< Attribute< T > > Ptr
Dynamic Phasor Three-Phase Switch.
SimPowerComp< Complex >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
const Attribute< Real >::Ptr mInstantCurrent
Reconstructed physical instantaneous current [A].
void setSwitchingMode(SwitchingMode mode)
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
const Attribute< Bool >::Ptr mPoleClosed
void closeSwitch() override
Bool mnaIsClosed() override
Check if switch is closed.
void setExponentialSwitchingTime(Real switchingTime)
Switch(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
@ ExponentialZCSEmulation
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
Bool hasParameterChanged() override
Returns true if one of the element paramters has changed.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
const Attribute< Real >::Ptr mEffectiveResistance
Effective resistance currently stamped into the MNA matrix [ohm].
Switch(String uid, String name, Logger::Level loglevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
const Attribute< Real >::Ptr mZeroCrossingTime
const Attribute< Bool >::Ptr mExponentialTransitionActive
Exponential-transition diagnostics.
const Attribute< Bool >::Ptr mOpeningRequested
Real exponentialSwitchingTime() const
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system result.
const Attribute< Bool >::Ptr mExponentialTransitionClosing
True while the active exponential transition is a closing transition.
void setZeroCrossingTolerance(Real tolerance)
const Attribute< Real >::Ptr mExponentialTransitionEndTime
void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx) override
Stamps system matrix considering the defined switch position.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
void openSwitch() override
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system result.
const Attribute< Real >::Ptr mExponentialProgress
const Attribute< Real >::Ptr mExponentialTransitionStartTime
SwitchingMode switchingMode() const
Bool supportsPrecomputedSystemMatrices() const override
String uid()
Returns unique id.
spdlog::level::level_enum Level
MNASimPowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
MNA interface to be used by switching devices.
MNA interface to be used by elements that require recomputing of the system matrix.
std::shared_ptr< SimPowerComp< VarType > > Ptr
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
std::complex< Real > Complex
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).