38 mDelay = (inductance.array() * capacitance.array()).sqrt().maxCoeff();
86 throw SystemError(
"Timestep too large for decoupling");
99 MatrixComp curNear = initAdmittance * voltNear - seriesAdmittance * voltFar;
101 SPDLOG_LOGGER_INFO(
mSLog,
"initial voltage: v_k {}", voltNear);
102 SPDLOG_LOGGER_INFO(
mSLog,
"initial current: i_k {}", curNear);
126 if (timeStepCount == 0) {
143 -
mSubRes->intfCurrent().transpose() + (**mSrcCtrledCurrent).transpose();
155 step(time, timeStepCount);
168 const Matrix &leftVector) {
169 (**mIntfVoltage)(0, 0) =
171 (**mIntfVoltage)(1, 0) =
173 (**mIntfVoltage)(2, 0) =
178 const Matrix &leftVector) {
198 attributeDependencies.push_back(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)
const Attribute< Matrix >::Ptr mSrcCtrledCurrent
History current fed into the controlled current source.
Real mDelay
Travel time of the whole line.
std::shared_ptr< EMT::Ph3::ControlledCurrentSource > mSubCtrledCurrentSource
Controlled current source carrying the history term.
Matrix mSurgeImpedance
Surge impedance, sqrt(L/C)
const Attribute< Matrix >::Ptr mReceivingCur
Far-end current one travel time ago, supplied by the other half.
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
Updates internal current variable of the component.
void createSubComponents() override
Creates the terminating resistor and the history current source.
void mnaParentInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Sizes the ring buffers and seeds them from the steady state.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
const Attribute< Matrix >::Ptr mReceivingVolt
Far-end voltage one travel time ago, supplied by the other half.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
const Attribute< Matrix >::Ptr mSendingVolt
This end's voltage one travel time ago, for the other half to read.
void setParameters(Matrix resistance, Matrix inductance, Matrix capacitance)
Line data. Give the parameters of the whole line, not of this half.
std::shared_ptr< EMT::Ph3::Resistor > mSubRes
Terminating impedance calculated from line parameters.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates internal voltage variable of the component.
HalfDecouplingLine(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
void initializeParentFromNodesAndTerminals(Real frequency) override
Seeds the interface quantities and the sending attributes.
const Attribute< Matrix >::Ptr mSrcRes
Terminating resistance.
Matrix mVoltBuf
Ring buffers for the values of previous timesteps, one row per stored step.
Matrix interpolate(Matrix &data)
Reads a ring buffer one travel time back.
const Attribute< Matrix >::Ptr mSendingCur
This end's current one travel time ago, for the other half to read.
void step(Real time, Int timeStepCount)
Updates the history current from the exchanged quantities.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void setCouplingSource(Attribute< Matrix >::Ptr receivingVolt, Attribute< Matrix >::Ptr receivingCur)
void postStep()
Records this end's quantities and publishes them one travel time delayed.
const Attribute< String >::Ptr mName
Human readable name.
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
Attribute< Matrix >::Ptr mRightVector
static Real realFromVectorElement(const Matrix &mat, Matrix::Index row)
UInt matrixNodeIndex(UInt nodeIndex)
const Attribute< MatrixVar< Real > >::Ptr mIntfCurrent
SimTerminal< Real >::List mTerminals
void setVirtualNodeNumber(UInt num)
const Attribute< MatrixVar< Real > >::Ptr mIntfVoltage
MatrixComp initialVoltage(UInt index)
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< Resistor > make(Args &&...args)
struct dps_magma_data data
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.