24 SPDLOG_LOGGER_INFO(
mSLog,
"Create {} {}", this->
type(), name);
28 std::make_shared<EMT::Ph3::VoltageSource>(**
mName +
"_vs",
mLogLevel);
32 SPDLOG_LOGGER_INFO(
mSLog,
"Electrical subcomponents: ");
34 SPDLOG_LOGGER_INFO(
mSLog,
"- {}", subcomp->name());
36 mSubVoltageSource->mVoltageRef->setReference(
mVoltageRef);
37 mSubVoltageSource->mSrcFreq->setReference(
mSrcFreq);
50 mSubVoltageSource->setParameters(voltageRef, srcFreq);
52 SPDLOG_LOGGER_INFO(
mSLog,
53 "\nVoltage Ref={:s} [V]"
54 "\nFrequency={:s} [Hz]",
65 mSubVoltageSource->setParameters(voltageRef, freqStart, rocof, timeStart,
66 duration, smoothRamp);
70 "\nVoltage Ref={:s} [V]"
71 "\nInitial frequency={:s} [Hz]"
72 "\nRamp ROCOF={:s} [Hz/s]"
73 "\nRamp duration={:s} [s]"
74 "\nRamp nadir={:s} [Hz]",
81 Real modulationFrequency,
82 Real modulationAmplitude,
87 mSubVoltageSource->setParameters(voltageRef, modulationFrequency,
88 modulationAmplitude, baseFrequency, zigzag);
90 SPDLOG_LOGGER_INFO(
mSLog,
91 "\nVoltage Ref={:s} [V]"
92 "\nFrequency={:s} [Hz]",
106 SPDLOG_LOGGER_DEBUG(
mSLog,
"Right Side Vector: {:s}",
129 attributeDependencies.push_back(leftVector);
141 const Matrix &leftVector) {
146 const Matrix &leftVector) {
AttributePointer< Attribute< T > > Ptr
void addMNASubComponent(typename SimPowerComp< Real >::Ptr subc, MNA_SUBCOMP_TASK_ORDER preStepOrder, MNA_SUBCOMP_TASK_ORDER postStepOrder, Bool contributeToRightVector)
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
void setParameters(MatrixComp voltageRef, Real srcFreq=50.0)
Setter for reference voltage parameters.
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates voltage across component.
void mnaParentAddPostStepDependencies(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
Returns current through the component.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
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 mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
const CPS::Attribute< MatrixComp >::Ptr mVoltageRef
const CPS::Attribute< Real >::Ptr mSrcFreq
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
NetworkInjection(String uid, String name, Logger::Level loglevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
const Attribute< String >::Ptr mName
Human readable name.
String uid()
Returns unique id.
String type()
Get component type (cross-platform)
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
static String matrixCompToString(const MatrixComp &mat)
static String matrixToString(const Matrix &mat)
static String realToString(const Real &num)
Attribute< Matrix >::Ptr mRightVector
const Attribute< MatrixVar< Real > >::Ptr mIntfCurrent
SimNode< Real >::Ptr node(UInt index)
void setVirtualNodeNumber(UInt num)
const Attribute< MatrixVar< Real > >::Ptr mIntfVoltage
std::shared_ptr< SimPowerComp< VarType > > Ptr
std::vector< std::shared_ptr< SimPowerComp< Real > > > mSubComponents
void setTerminalNumber(UInt num)
Logger::Level mLogLevel
Component logger control for internal variables.
bool mParametersSet
Flag indicating that parameters are set via setParameters() function.
Logger::Log mSLog
Component logger.
static std::shared_ptr< NetworkInjection > make(Args &&...args)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.