56 "\n--- Initialization from powerflow ---"
57 "\nDP convention: phase-peak complex envelopes"
62 "\nTerminal 0 PF voltage converted to phase peak: {:s}"
63 "\nTerminal 1 PF voltage converted to phase peak: {:s}"
64 "\n--- Initialization from powerflow finished ---",
81 conductance.real() = (**mResistance).inverse();
93 attributeDependencies.push_back(leftVector);
108 (**mIntfVoltage)(0, 0) =
111 (**mIntfVoltage)(1, 0) =
114 (**mIntfVoltage)(2, 0) =
119 (**mIntfVoltage)(0, 0) -=
122 (**mIntfVoltage)(1, 0) -=
125 (**mIntfVoltage)(2, 0) -=
129 SPDLOG_LOGGER_DEBUG(
mSLog,
"Voltage A: {} < {}",
137 SPDLOG_LOGGER_DEBUG(
mSLog,
"Current A: {} < {}",
147 conductance.real() = (**mResistance).inverse();
150 1.0 / conductance(0, 0).real());
153 1.0 / conductance(1, 1).real());
156 1.0 / conductance(2, 2).real());
AttributePointer< Attribute< T > > Ptr
const CPS::Attribute< Matrix >::Ptr mResistance
Resistance [ohm].
void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
void mnaCompUpdateCurrent(const Matrix &leftVector) override
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 initializeFromNodesAndTerminals(Real frequency) override
Initialize DP phase-peak envelopes from line-line RMS PF node voltages.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Resistor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
static String matrixCompToString(const MatrixComp &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 stampAdmittanceMatrix(const MatrixComp &admittanceMat, SparseMatrixRow &mat, UInt node1Index, UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded, const Logger::Log &mSLog, Int maxFreq=1, Int freqIdx=0)
static Complex complexFromVectorElement(const Matrix &mat, Matrix::Index row, Int maxFreq=1, Int freqIdx=0)
static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
UInt matrixNodeIndex(UInt nodeIndex)
const Attribute< MatrixVar< Complex > >::Ptr mIntfCurrent
const Attribute< MatrixVar< Complex > >::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< Resistor > 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::Matrix< Complex, rows, cols, Eigen::ColMajor > MatrixFixedSizeComp
Dense matrix for complex numbers with fixed dimension.
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).