9#include <dpsim-models/DP/DP_Ph1_Shunt.h>
18 SPDLOG_LOGGER_INFO(
mSLog,
"Create {} of type {}", this->
type(), name);
25 SPDLOG_LOGGER_INFO(
mSLog,
"Conductance={} [S] Susceptance={} [Ohm] ",
26 conductance, susceptance);
34 Real omega = 2. * PI * frequency;
36 (**mIntfVoltage)(0, 0) = initialSingleVoltage(0);
37 (**mIntfCurrent)(0, 0) = (**
mIntfVoltage)(0, 0) * admittance;
46 mSubResistor->initializeFromNodesAndTerminals(frequency);
48 MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT,
false);
59 MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT,
60 MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT,
true);
63 SPDLOG_LOGGER_INFO(
mSLog,
64 "\n--- Initialization from powerflow ---"
65 "\nVoltage across: {:s}"
67 "\nTerminal voltage: {:s}"
68 "\n--- Initialization from powerflow finished ---",
71 Logger::phasorToString(initialSingleVoltage(0)));
75 AttributeBase::List &prevStepDependencies,
76 AttributeBase::List &attributeDependencies,
77 AttributeBase::List &modifiedAttributes) {
86 AttributeBase::List &prevStepDependencies,
87 AttributeBase::List &attributeDependencies,
88 AttributeBase::List &modifiedAttributes,
89 Attribute<Matrix>::Ptr &leftVector) {
90 attributeDependencies.push_back(leftVector);
96 Attribute<Matrix>::Ptr &leftVector) {
102 (**mIntfVoltage)(0, 0) =
103 Math::complexFromVectorElement(leftVector, matrixNodeIndex(0));
107 (**mIntfCurrent)(0, 0) = 0;
110 (**mIntfCurrent)(0, 0) +=
mSubResistor->intfCurrent()(0, 0);
112 (**mIntfCurrent)(0, 0) +=
mSubCapacitor->intfCurrent()(0, 0);
void addMNASubComponent(typename SimPowerComp< Complex >::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 mnaCompUpdateCurrent(const Matrix &leftVector) final
Updates internal current variable of the component.
const Attribute< Real >::Ptr mConductance
Conductance [S].
void mnaParentPreStep(Real time, Int timeStepCount) final
MNA pre step operations.
const Attribute< Real >::Ptr mSusceptance
Susceptance [S].
void mnaCompUpdateVoltage(const Matrix &leftVector) final
Updates internal voltage variable of the component.
std::shared_ptr< Resistor > mSubResistor
Resistor between terminal and ground.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Shunt(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
std::shared_ptr< Capacitor > mSubCapacitor
Capacitor between terminal and ground.
void initializeParentFromNodesAndTerminals(Real frequency)
Initializes component from power flow data.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) final
MNA post-step operations.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) final
Add MNA pre step dependencies.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) final
add MNA post-step dependencies
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.
void mnaUpdateCurrent(const Matrix &leftVector) final
void mnaUpdateVoltage(const Matrix &leftVector) final
Attribute< Matrix >::Ptr mRightVector
const Attribute< MatrixVar< Complex > >::Ptr mIntfCurrent
SimTerminal< Complex >::List mTerminals
const Attribute< MatrixVar< Complex > >::Ptr mIntfVoltage
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.