30 Real omega = 2 *
PI * frequency;
31 MatrixComp admittance = MatrixComp::Zero(3, 3);
50 SPDLOG_LOGGER_INFO(
mSLog,
51 "\nCapacitance [F]: {:s}"
52 "\nAdmittance [S]: {:s}",
57 "\n--- Initialization from powerflow ---"
58 "\nVoltage across: {:s}"
60 "\nTerminal 0 voltage: {:s}"
61 "\nTerminal 1 voltage: {:s}"
62 "\n--- Initialization from powerflow finished ---",
83 SPDLOG_LOGGER_INFO(
mSLog,
"\nEquivalent Conductance: {:s}",
106 SPDLOG_LOGGER_DEBUG(
mSLog,
"\nEquivalent Current: {:s}",
129 attributeDependencies.push_back(leftVector);
144 (**mIntfVoltage)(0, 0) =
146 (**mIntfVoltage)(1, 0) =
148 (**mIntfVoltage)(2, 0) =
152 (**mIntfVoltage)(0, 0) =
155 (**mIntfVoltage)(1, 0) =
158 (**mIntfVoltage)(2, 0) =
166 SPDLOG_LOGGER_DEBUG(
mSLog,
"\nCurrent: {:s}",
AttributePointer< Attribute< T > > Ptr
const CPS::Attribute< Matrix >::Ptr mCapacitance
Capacitance [F].
Capacitor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system result.
void mnaCompPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system result.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes internal variables of the component.
SimPowerComp< Real >::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.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
Matrix mEquivCurrent
DC equivalent current source [A].
Matrix mEquivCond
Equivalent conductance [S].
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
static String matrixCompToString(const MatrixComp &mat)
static String matrixToString(const Matrix &mat)
static String phasorToString(const Complex &num)
MNASimPowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
Attribute< Matrix >::Ptr mRightVector
static void stampConductanceMatrix(const Matrix &conductanceMat, SparseMatrixRow &mat, UInt node1Index, UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded, const Logger::Log &mSLog)
static Real realFromVectorElement(const Matrix &mat, Matrix::Index row)
static void setVectorElement(Matrix &mat, Matrix::Index row, Complex value, Int maxFreq=1, Int freqIdx=0, Matrix::Index colOffset=0)
UInt matrixNodeIndex(UInt nodeIndex)
const Attribute< MatrixVar< Real > >::Ptr mIntfCurrent
const Attribute< MatrixVar< Real > >::Ptr mIntfVoltage
std::shared_ptr< SimPowerComp< VarType > > Ptr
Bool terminalNotGrounded(UInt index)
Complex initialSingleVoltage(UInt index)
void updateMatrixNodeIndices()
void setTerminalNumber(UInt num)
Logger::Level mLogLevel
Component logger control for internal variables.
Logger::Log mSLog
Component logger.
static std::shared_ptr< Capacitor > make(Args &&...args)
#define RMS3PH_TO_PEAK1PH
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
std::complex< Real > Complex
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).