Skip to content

Commit

Permalink
remove virtual nodes of PiLine
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Moraga <[email protected]>
  • Loading branch information
martinmoraga committed Mar 8, 2023
1 parent 5962e0a commit a3b6f7a
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 110 deletions.
8 changes: 3 additions & 5 deletions dpsim-models/include/dpsim-models/DP/DP_Ph1_PiLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <dpsim-models/CompositePowerComp.h>
#include <dpsim-models/Solver/MNATearInterface.h>
#include <dpsim-models/Base/Base_Ph1_PiLine.h>
#include <dpsim-models/DP/DP_Ph1_ResIndSeries.h>
#include <dpsim-models/DP/DP_Ph1_Resistor.h>
#include <dpsim-models/DP/DP_Ph1_Inductor.h>
#include <dpsim-models/DP/DP_Ph1_Capacitor.h>

namespace CPS {
Expand All @@ -28,10 +28,8 @@ namespace Ph1 {
public Base::Ph1::PiLine,
public SharedFactory<PiLine> {
protected:
/// Series Inductance submodel
std::shared_ptr<Inductor> mSubSeriesInductor;
/// Series Resistor submodel
std::shared_ptr<Resistor> mSubSeriesResistor;
/// Series Resistor-Inductance submodel
std::shared_ptr<ResIndSeries> mSubSeriesElement;
/// Parallel Resistor submodel at Terminal 0
std::shared_ptr<Resistor> mSubParallelResistor0;
// Parallel Capacitor submodel at Terminal 0
Expand Down
8 changes: 7 additions & 1 deletion dpsim-models/include/dpsim-models/DP/DP_Ph1_ResIndSeries.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ namespace Ph1 {
/// \brief resistor inductor series element
class ResIndSeries:
public MNASimPowerComp<Complex>,
public MNATearInterface,
public SharedFactory<ResIndSeries> {
protected:
private:
/// Impedance
Complex mImpedance;
/// DC equivalent current source for harmonics [A]
MatrixComp mEquivCurrent;
/// Equivalent conductance for harmonics [S]
Expand Down Expand Up @@ -104,6 +107,9 @@ namespace Ph1 {
ResIndSeries& mResIndSeries;
std::vector< Attribute<Matrix>::Ptr > mLeftVectors;
};

// #### MNA Tear Section ####
void mnaTearApplyMatrixStamp(Matrix& tearMatrix) override;
};
}
}
Expand Down
8 changes: 3 additions & 5 deletions dpsim-models/include/dpsim-models/EMT/EMT_Ph3_PiLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <dpsim-models/CompositePowerComp.h>
#include <dpsim-models/Solver/MNAInterface.h>
#include <dpsim-models/Base/Base_Ph3_PiLine.h>
#include <dpsim-models/EMT/EMT_Ph3_ResIndSeries.h>
#include <dpsim-models/EMT/EMT_Ph3_Resistor.h>
#include <dpsim-models/EMT/EMT_Ph3_Inductor.h>
#include <dpsim-models/EMT/EMT_Ph3_Capacitor.h>

namespace CPS {
Expand All @@ -27,10 +27,8 @@ namespace Ph3 {
public Base::Ph3::PiLine,
public SharedFactory<PiLine> {
protected:
/// Series Inductance submodel
std::shared_ptr<Inductor> mSubSeriesInductor;
/// Series Resistor submodel
std::shared_ptr<Resistor> mSubSeriesResistor;
/// Series Resistor-Inductance submodel
std::shared_ptr<ResIndSeries> mSubSeriesElement;
/// Parallel Resistor submodel at Terminal 0
std::shared_ptr<Resistor> mSubParallelResistor0;
// Parallel Capacitor submodel at Terminal 0
Expand Down
2 changes: 1 addition & 1 deletion dpsim-models/include/dpsim-models/SP/SP_Ph1_Inductor.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace Ph1 {
/// Add MNA post step dependencies
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector);

void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
void mnaTearApplyMatrixStamp(Matrix& tearMatrix) override;
};
}
}
Expand Down
8 changes: 3 additions & 5 deletions dpsim-models/include/dpsim-models/SP/SP_Ph1_PiLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <dpsim-models/Solver/MNATearInterface.h>
#include <dpsim-models/Solver/PFSolverInterfaceBranch.h>
#include <dpsim-models/Base/Base_Ph1_PiLine.h>
#include <dpsim-models/SP/SP_Ph1_ResIndSeries.h>
#include <dpsim-models/SP/SP_Ph1_Resistor.h>
#include <dpsim-models/SP/SP_Ph1_Inductor.h>
#include <dpsim-models/SP/SP_Ph1_Capacitor.h>

namespace CPS {
Expand Down Expand Up @@ -71,10 +71,8 @@ namespace Ph1 {

// #### Admittance matrix stamp ####
MatrixComp mY_element;
/// Series Inductance submodel
std::shared_ptr<Inductor> mSubSeriesInductor;
/// Series Resistor submodel
std::shared_ptr<Resistor> mSubSeriesResistor;
/// Series Resistor-Inductance submodel
std::shared_ptr<ResIndSeries> mSubSeriesElement;
/// Parallel Resistor submodel at Terminal 0
std::shared_ptr<Resistor> mSubParallelResistor0;
// Parallel Capacitor submodel at Terminal 0
Expand Down
5 changes: 4 additions & 1 deletion dpsim-models/include/dpsim-models/SP/SP_Ph1_ResIndSeries.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
#pragma once

#include <dpsim-models/MNASimPowerComp.h>
#include <dpsim-models/Definitions.h>
#include <dpsim-models/Solver/MNATearInterface.h>

namespace CPS {
namespace SP {
namespace Ph1 {
/// Static phasor ResIndSeries model (only implemented for dynamic simulations!)
class ResIndSeries :
public MNASimPowerComp<Complex>,
public MNATearInterface,
public SharedFactory<ResIndSeries> {
private:
/// Impedance
Expand Down Expand Up @@ -55,6 +56,8 @@ namespace Ph1 {
/// add MNA pre and post step dependencies
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) override;

// #### MNA Tear Section ####
void mnaTearApplyMatrixStamp(Matrix& tearMatrix) override;
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion dpsim-models/include/dpsim-models/SP/SP_Ph1_Resistor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace Ph1 {
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) override;

// #### MNA Tear Section ####
void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
void mnaTearApplyMatrixStamp(Matrix& tearMatrix) override;

};
}
Expand Down
45 changes: 15 additions & 30 deletions dpsim-models/src/DP/DP_Ph1_PiLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ using namespace CPS;

DP::Ph1::PiLine::PiLine(String uid, String name, Logger::Level logLevel)
: Base::Ph1::PiLine(mAttributes), CompositePowerComp<Complex>(uid, name, true, true, logLevel) {
setVirtualNodeNumber(1);
setTerminalNumber(2);

mSLog->info("Create {} {}", this->type(), name);
Expand All @@ -35,23 +34,13 @@ void DP::Ph1::PiLine::initializeFromNodesAndTerminals(Real frequency) {
(**mIntfVoltage)(0,0) = initialSingleVoltage(1) - initialSingleVoltage(0);
(**mIntfCurrent)(0,0) = (**mIntfVoltage)(0,0) / impedance;

// Initialization of virtual node
mVirtualNodes[0]->setInitialVoltage( initialSingleVoltage(0) + (**mIntfCurrent)(0,0) * **mSeriesRes );

// Create series sub components
mSubSeriesResistor = std::make_shared<DP::Ph1::Resistor>(**mName + "_res", mLogLevel);
mSubSeriesResistor->setParameters(**mSeriesRes);
mSubSeriesResistor->connect({ mTerminals[0]->node(), mVirtualNodes[0] });
mSubSeriesResistor->initialize(mFrequencies);
mSubSeriesResistor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesResistor, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, false);

mSubSeriesInductor = std::make_shared<DP::Ph1::Inductor>(**mName + "_ind", mLogLevel);
mSubSeriesInductor->setParameters(**mSeriesInd);
mSubSeriesInductor->connect({ mVirtualNodes[0], mTerminals[1]->node() });
mSubSeriesInductor->initialize(mFrequencies);
mSubSeriesInductor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesInductor, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);
// Create series rl sub component
mSubSeriesElement = std::make_shared<DP::Ph1::ResIndSeries>(**mName + "_ResIndSeries", mLogLevel);
mSubSeriesElement->connect({ mTerminals[0]->node(), mTerminals[1]->node() });
mSubSeriesElement->setParameters(**mSeriesRes, **mSeriesInd);
mSubSeriesElement->initialize(mFrequencies);
mSubSeriesElement->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesElement, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);

// By default there is always a small conductance to ground to
// avoid problems with floating nodes.
Expand Down Expand Up @@ -96,13 +85,11 @@ void DP::Ph1::PiLine::initializeFromNodesAndTerminals(Real frequency) {
"\nCurrent: {:s}"
"\nTerminal 0 voltage: {:s}"
"\nTerminal 1 voltage: {:s}"
"\nVirtual Node 1 voltage: {:s}"
"\n--- Initialization from powerflow finished ---",
Logger::phasorToString((**mIntfVoltage)(0,0)),
Logger::phasorToString((**mIntfCurrent)(0,0)),
Logger::phasorToString(initialSingleVoltage(0)),
Logger::phasorToString(initialSingleVoltage(1)),
Logger::phasorToString(mVirtualNodes[0]->initialSingleVoltage()));
Logger::phasorToString(initialSingleVoltage(1)));
}

void DP::Ph1::PiLine::mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) {
Expand Down Expand Up @@ -139,7 +126,7 @@ void DP::Ph1::PiLine::mnaCompUpdateVoltage(const Matrix& leftVector) {
}

void DP::Ph1::PiLine::mnaCompUpdateCurrent(const Matrix& leftVector) {
(**mIntfCurrent)(0,0) = mSubSeriesInductor->intfCurrent()(0, 0);
(**mIntfCurrent)(0,0) = mSubSeriesElement->intfCurrent()(0, 0);
}

MNAInterface::List DP::Ph1::PiLine::mnaTearGroundComponents() {
Expand All @@ -157,21 +144,19 @@ MNAInterface::List DP::Ph1::PiLine::mnaTearGroundComponents() {
}

void DP::Ph1::PiLine::mnaTearInitialize(Real omega, Real timeStep) {
mSubSeriesResistor->mnaTearSetIdx(mTearIdx);
mSubSeriesResistor->mnaTearInitialize(omega, timeStep);
mSubSeriesInductor->mnaTearSetIdx(mTearIdx);
mSubSeriesInductor->mnaTearInitialize(omega, timeStep);
mSubSeriesElement->mnaTearSetIdx(mTearIdx);
mSubSeriesElement->mnaTearInitialize(omega, timeStep);
}

void DP::Ph1::PiLine::mnaTearApplyMatrixStamp(Matrix& tearMatrix) {
mSubSeriesResistor->mnaTearApplyMatrixStamp(tearMatrix);
mSubSeriesInductor->mnaTearApplyMatrixStamp(tearMatrix);
mSubSeriesElement->mnaTearApplyMatrixStamp(tearMatrix);
mSubSeriesElement->mnaTearApplyMatrixStamp(tearMatrix);
}

void DP::Ph1::PiLine::mnaTearApplyVoltageStamp(Matrix& voltageVector) {
mSubSeriesInductor->mnaTearApplyVoltageStamp(voltageVector);
mSubSeriesElement->mnaTearApplyVoltageStamp(voltageVector);
}

void DP::Ph1::PiLine::mnaTearPostStep(Complex voltage, Complex current) {
mSubSeriesInductor->mnaTearPostStep(voltage - current * **mSeriesRes, current);
mSubSeriesElement->mnaTearPostStep(voltage - current * **mSeriesRes, current);
}
7 changes: 6 additions & 1 deletion dpsim-models/src/DP/DP_Ph1_ResIndSeries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,9 @@ void DP::Ph1::ResIndSeries::mnaCompUpdateCurrentHarm() {
(**mIntfCurrent)(0,freq) = mEquivCond(freq,0) * (**mIntfVoltage)(0,freq) + mEquivCurrent(freq,0);
SPDLOG_LOGGER_DEBUG(mSLog, "Current {:s}", Logger::phasorToString((**mIntfCurrent)(0,freq)));
}
}
}

// #### Tear Methods ####
void DP::Ph1::ResIndSeries::mnaTearApplyMatrixStamp(Matrix& tearMatrix) {
Math::addToMatrixElement(tearMatrix, mTearIdx, mTearIdx, mImpedance);
}
37 changes: 9 additions & 28 deletions dpsim-models/src/EMT/EMT_Ph3_PiLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ using namespace CPS;
EMT::Ph3::PiLine::PiLine(String uid, String name, Logger::Level logLevel)
: Base::Ph3::PiLine(mAttributes), CompositePowerComp<Real>(uid, name, true, true, logLevel) {
mPhaseType = PhaseType::ABC;
setVirtualNodeNumber(1);
setTerminalNumber(2);

mSLog->info("Create {} {}", this->type(), name);
Expand Down Expand Up @@ -57,29 +56,13 @@ void EMT::Ph3::PiLine::initializeFromNodesAndTerminals(Real frequency) {
**mIntfCurrent = iInit.real();
**mIntfVoltage = vInitABC.real();

// Initialization of virtual node
// Initial voltage of phase B,C is set after A
MatrixComp vInitTerm0 = MatrixComp::Zero(3, 1);
vInitTerm0(0, 0) = RMS3PH_TO_PEAK1PH * initialSingleVoltage(0);
vInitTerm0(1, 0) = vInitTerm0(0, 0) * SHIFT_TO_PHASE_B;
vInitTerm0(2, 0) = vInitTerm0(0, 0) * SHIFT_TO_PHASE_C;

mVirtualNodes[0]->setInitialVoltage(PEAK1PH_TO_RMS3PH*(vInitTerm0 + **mSeriesRes * iInit));

// Create series sub components
mSubSeriesResistor = std::make_shared<EMT::Ph3::Resistor>(**mName + "_res", mLogLevel);
mSubSeriesResistor->setParameters(**mSeriesRes);
mSubSeriesResistor->connect({ mTerminals[0]->node(), mVirtualNodes[0] });
mSubSeriesResistor->initialize(mFrequencies);
mSubSeriesResistor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesResistor, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, false);

mSubSeriesInductor = std::make_shared<EMT::Ph3::Inductor>(**mName + "_ind", mLogLevel);
mSubSeriesInductor->setParameters(**mSeriesInd);
mSubSeriesInductor->connect({ mVirtualNodes[0], mTerminals[1]->node() });
mSubSeriesInductor->initialize(mFrequencies);
mSubSeriesInductor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesInductor, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);
// Create series rl sub component
mSubSeriesElement = std::make_shared<EMT::Ph3::ResIndSeries>(**mName + "_ResIndSeries", mLogLevel);
mSubSeriesElement->connect({ mTerminals[0]->node(), mTerminals[1]->node() });
mSubSeriesElement->setParameters(**mSeriesRes, **mSeriesInd);
mSubSeriesElement->initialize(mFrequencies);
mSubSeriesElement->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesElement, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);

// Create parallel sub components
mSubParallelResistor0 = std::make_shared<EMT::Ph3::Resistor>(**mName + "_con0", mLogLevel);
Expand Down Expand Up @@ -131,13 +114,11 @@ void EMT::Ph3::PiLine::initializeFromNodesAndTerminals(Real frequency) {
"\nCurrent: {:s}"
"\nTerminal 0 voltage: {:s}"
"\nTerminal 1 voltage: {:s}"
"\nVirtual Node 1 voltage: {:s}"
"\n--- Initialization from powerflow finished ---",
Logger::matrixToString(**mIntfVoltage),
Logger::matrixToString(**mIntfCurrent),
Logger::phasorToString(RMS3PH_TO_PEAK1PH * initialSingleVoltage(0)),
Logger::phasorToString(RMS3PH_TO_PEAK1PH * initialSingleVoltage(1)),
Logger::phasorToString(mVirtualNodes[0]->initialSingleVoltage()));
Logger::phasorToString(RMS3PH_TO_PEAK1PH * initialSingleVoltage(1)));
mSLog->flush();
}

Expand Down Expand Up @@ -178,5 +159,5 @@ void EMT::Ph3::PiLine::mnaCompUpdateVoltage(const Matrix& leftVector) {
}

void EMT::Ph3::PiLine::mnaCompUpdateCurrent(const Matrix& leftVector) {
**mIntfCurrent = mSubSeriesInductor->intfCurrent();
**mIntfCurrent = mSubSeriesElement->intfCurrent();
}
44 changes: 14 additions & 30 deletions dpsim-models/src/SP/SP_Ph1_PiLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ SP::Ph1::PiLine::PiLine(String uid, String name, Logger::Level logLevel)
mSLog->info("Create {} {}", this->type(), name);
mSLog->flush();

setVirtualNodeNumber(1);
setTerminalNumber(2);
**mIntfVoltage = MatrixComp::Zero(1, 1);
**mIntfCurrent = MatrixComp::Zero(1, 1);
Expand Down Expand Up @@ -157,23 +156,13 @@ void SP::Ph1::PiLine::initializeFromNodesAndTerminals(Real frequency) {
(**mIntfVoltage)(0, 0) = initialSingleVoltage(1) - initialSingleVoltage(0);
(**mIntfCurrent)(0, 0) = (**mIntfVoltage)(0, 0) / impedance;

// Initialization of virtual node
mVirtualNodes[0]->setInitialVoltage(initialSingleVoltage(0) + (**mIntfCurrent)(0, 0) * **mSeriesRes);

// Create series sub components
mSubSeriesResistor = std::make_shared<SP::Ph1::Resistor>(**mName + "_res", mLogLevel);
mSubSeriesResistor->setParameters(**mSeriesRes);
mSubSeriesResistor->connect({ mTerminals[0]->node(), mVirtualNodes[0] });
mSubSeriesResistor->initialize(mFrequencies);
mSubSeriesResistor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesResistor, MNA_SUBCOMP_TASK_ORDER::NO_TASK, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, false);

mSubSeriesInductor = std::make_shared<SP::Ph1::Inductor>(**mName + "_ind", mLogLevel);
mSubSeriesInductor->setParameters(**mSeriesInd);
mSubSeriesInductor->connect({ mVirtualNodes[0], mTerminals[1]->node() });
mSubSeriesInductor->initialize(mFrequencies);
mSubSeriesInductor->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesInductor, MNA_SUBCOMP_TASK_ORDER::NO_TASK, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);
// Create series rl sub component
mSubSeriesElement = std::make_shared<SP::Ph1::ResIndSeries>(**mName + "_ResIndSeries", mLogLevel);
mSubSeriesElement->connect({ mTerminals[0]->node(), mTerminals[1]->node() });
mSubSeriesElement->setParameters(**mSeriesRes, **mSeriesInd);
mSubSeriesElement->initialize(mFrequencies);
mSubSeriesElement->initializeFromNodesAndTerminals(frequency);
addMNASubComponent(mSubSeriesElement, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT, true);

// Create parallel sub components
if (**mParallelCond >= 0) {
Expand Down Expand Up @@ -214,13 +203,11 @@ void SP::Ph1::PiLine::initializeFromNodesAndTerminals(Real frequency) {
"\nCurrent: {:s}"
"\nTerminal 0 voltage: {:s}"
"\nTerminal 1 voltage: {:s}"
"\nVirtual Node 1 voltage: {:s}"
"\n--- Initialization from powerflow finished ---",
Logger::phasorToString((**mIntfVoltage)(0, 0)),
Logger::phasorToString((**mIntfCurrent)(0, 0)),
Logger::phasorToString(initialSingleVoltage(0)),
Logger::phasorToString(initialSingleVoltage(1)),
Logger::phasorToString(mVirtualNodes[0]->initialSingleVoltage()));
Logger::phasorToString(initialSingleVoltage(1)));
}

void SP::Ph1::PiLine::mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) {
Expand All @@ -243,7 +230,7 @@ void SP::Ph1::PiLine::mnaCompUpdateVoltage(const Matrix& leftVector) {
}

void SP::Ph1::PiLine::mnaCompUpdateCurrent(const Matrix& leftVector) {
(**mIntfCurrent)(0, 0) = mSubSeriesInductor->intfCurrent()(0, 0);
(**mIntfCurrent)(0, 0) = mSubSeriesElement->intfCurrent()(0, 0);
}

MNAInterface::List SP::Ph1::PiLine::mnaTearGroundComponents() {
Expand All @@ -261,21 +248,18 @@ MNAInterface::List SP::Ph1::PiLine::mnaTearGroundComponents() {
}

void SP::Ph1::PiLine::mnaTearInitialize(Real omega, Real timeStep) {
mSubSeriesResistor->mnaTearSetIdx(mTearIdx);
mSubSeriesResistor->mnaTearInitialize(omega, timeStep);
mSubSeriesInductor->mnaTearSetIdx(mTearIdx);
mSubSeriesInductor->mnaTearInitialize(omega, timeStep);
mSubSeriesElement->mnaTearSetIdx(mTearIdx);
mSubSeriesElement->mnaTearInitialize(omega, timeStep);
}

void SP::Ph1::PiLine::mnaTearApplyMatrixStamp(Matrix& tearMatrix) {
mSubSeriesResistor->mnaTearApplyMatrixStamp(tearMatrix);
mSubSeriesInductor->mnaTearApplyMatrixStamp(tearMatrix);
mSubSeriesElement->mnaTearApplyMatrixStamp(tearMatrix);
}

void SP::Ph1::PiLine::mnaTearApplyVoltageStamp(Matrix& voltageVector) {
mSubSeriesInductor->mnaTearApplyVoltageStamp(voltageVector);
mSubSeriesElement->mnaTearApplyVoltageStamp(voltageVector);
}

void SP::Ph1::PiLine::mnaTearPostStep(Complex voltage, Complex current) {
mSubSeriesInductor->mnaTearPostStep(voltage - current * **mSeriesRes, current);
mSubSeriesElement->mnaTearPostStep(voltage - current * **mSeriesRes, current);
}
Loading

0 comments on commit a3b6f7a

Please sign in to comment.