Commit 0ea5575e authored by Jan Dinkelbach's avatar Jan Dinkelbach Committed by Markus Mirz
Browse files

refactor task definition of RLC in sp1ph

parent cf76f9a1
......@@ -13,56 +13,56 @@
#include <cps/Base/Base_Ph1_Capacitor.h>
namespace CPS {
namespace SP {
namespace Ph1 {
class Capacitor :
public Base::Ph1::Capacitor,
public MNAInterface,
public SimPowerComp<Complex>,
public SharedFactory<Capacitor> {
protected:
/// Equivalent conductance [S]
Complex mSusceptance;
namespace SP {
namespace Ph1 {
class Capacitor :
public Base::Ph1::Capacitor,
public MNAInterface,
public SimPowerComp<Complex>,
public SharedFactory<Capacitor> {
protected:
/// Equivalent conductance [S]
Complex mSusceptance;
public:
/// Defines UID, name and logging level
Capacitor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name, component parameters and logging level
Capacitor(String name, Logger::Level logLevel = Logger::Level::off)
: Capacitor(name, name, logLevel) { }
public:
/// Defines UID, name and logging level
Capacitor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name, component parameters and logging level
Capacitor(String name, Logger::Level logLevel = Logger::Level::off)
: Capacitor(name, name, logLevel) { }
SimPowerComp<Complex>::Ptr clone(String name);
SimPowerComp<Complex>::Ptr clone(String name);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
/// Update interface voltage from MNA system result
void mnaUpdateVoltage(const Matrix& leftVector);
/// Update interface current from MNA system result
void mnaUpdateCurrent(const Matrix& leftVector);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
/// Update interface voltage from MNA system result
void mnaUpdateVoltage(const Matrix& leftVector);
/// Update interface current from MNA system result
void mnaUpdateCurrent(const Matrix& leftVector);
/// MNA post step operations
void mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector);
/// Add MNA post step dependencies
void mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector);
class MnaPostStep : public CPS::Task {
public:
MnaPostStep(Capacitor& capacitor, Attribute<Matrix>::Ptr leftVector)
: Task(capacitor.mName + ".MnaPostStep"), mCapacitor(capacitor), mLeftVector(leftVector) {
mAttributeDependencies.push_back(mLeftVector);
mModifiedAttributes.push_back(mCapacitor.attribute("v_intf"));
mModifiedAttributes.push_back(mCapacitor.attribute("i_intf"));
}
void execute(Real time, Int timeStepCount);
private:
Capacitor& mCapacitor;
Attribute<Matrix>::Ptr mLeftVector;
};
};
}
}
class MnaPostStep : public Task {
public:
MnaPostStep(Capacitor& capacitor, Attribute<Matrix>::Ptr leftVector)
: Task(capacitor.mName + ".MnaPostStep"), mCapacitor(capacitor), mLeftVector(leftVector) {
mCapacitor.mnaAddPostStepDependencies(mPrevStepDependencies, mAttributeDependencies, mModifiedAttributes, mLeftVector);
}
void execute(Real time, Int timeStepCount) { mCapacitor.mnaPostStep(time, timeStepCount, mLeftVector); };
private:
Capacitor& mCapacitor;
Attribute<Matrix>::Ptr mLeftVector;
};
};
}
}
}
......@@ -14,68 +14,59 @@
#include <cps/Base/Base_Ph1_Inductor.h>
namespace CPS {
namespace SP {
namespace Ph1 {
/// \brief Inductor
///
/// The inductor is represented by a DC equivalent circuit which corresponds to
/// one iteration of the trapezoidal integration method.
/// The equivalent DC circuit is a resistance in parallel with a current source.
/// The resistance is constant for a defined time step and system
/// frequency and the current source changes for each iteration.
class Inductor :
public Base::Ph1::Inductor,
public MNATearInterface,
public SimPowerComp<Complex>,
public SharedFactory<Inductor> {
protected:
/// susceptance [S]
Complex mSusceptance;
namespace SP {
namespace Ph1 {
/// Static phasor inductor model
class Inductor :
public Base::Ph1::Inductor,
public MNATearInterface,
public SimPowerComp<Complex>,
public SharedFactory<Inductor> {
protected:
/// susceptance [S]
Complex mSusceptance;
public:
/// Defines UID, name, component parameters and logging level
Inductor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name, component parameters and logging level
Inductor(String name, Logger::Level logLevel = Logger::Level::off)
: Inductor(name, name, logLevel) { }
public:
/// Defines UID, name and log level
Inductor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name and log level
Inductor(String name, Logger::Level logLevel = Logger::Level::off)
: Inductor(name, name, logLevel) { }
SimPowerComp<Complex>::Ptr clone(String name);
SimPowerComp<Complex>::Ptr clone(String name);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
/// Upgrade values in the source vector and maybe system matrix before MNA solution
void mnaStep(Matrix& systemMatrix, Matrix& rightVector, Matrix& leftVector, Real time);
/// Upgrade internal variables after MNA solution
void mnaMnaPostStep(Matrix& rightVector, Matrix& leftVector, Real time);
/// Update interface voltage from MNA system result
void mnaUpdateVoltage(const Matrix& leftVector);
/// Update interface current from MNA system result
void mnaUpdateCurrent(const Matrix& leftVector);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
/// Update interface voltage from MNA system results
void mnaUpdateVoltage(const Matrix& leftVector);
/// Update interface current from MNA system results
void mnaUpdateCurrent(const Matrix& leftVector);
/// MNA post step operations
void mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector);
/// Add MNA post step dependencies
void mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector);
class MnaPostStep : public Task {
public:
MnaPostStep(Inductor& inductor, Attribute<Matrix>::Ptr leftVector) :
Task(inductor.mName + ".MnaPostStep"),
mInductor(inductor), mLeftVector(leftVector) {
mInductor.mnaAddPostStepDependencies(mPrevStepDependencies, mAttributeDependencies, mModifiedAttributes, mLeftVector);
}
void execute(Real time, Int timeStepCount) { mInductor.mnaPostStep(time, timeStepCount, mLeftVector); };
private:
Inductor& mInductor;
Attribute<Matrix>::Ptr mLeftVector;
};
class MnaPostStep : public Task {
public:
MnaPostStep(Inductor& inductor, Attribute<Matrix>::Ptr leftVector) :
Task(inductor.mName + ".MnaPostStep"), mInductor(inductor), mLeftVector(leftVector) {
mAttributeDependencies.push_back(mLeftVector);
mModifiedAttributes.push_back(mInductor.attribute("v_intf"));
mModifiedAttributes.push_back(mInductor.attribute("i_intf"));
}
void execute(Real time, Int timeStepCount);
private:
Inductor& mInductor;
Attribute<Matrix>::Ptr mLeftVector;
};
void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
};
}
}
void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
};
}
}
}
......@@ -16,85 +16,85 @@
#include <cps/Base/Base_Ph1_Resistor.h>
namespace CPS {
namespace SP {
namespace Ph1 {
///
class Resistor :
public Base::Ph1::Resistor,
public MNATearInterface,
public SimPowerComp<Complex>,
public SharedFactory<Resistor>,
public PFSolverInterfaceBranch {
namespace SP {
namespace Ph1 {
/// Static phasor resistor model
class Resistor :
public Base::Ph1::Resistor,
public MNATearInterface,
public SimPowerComp<Complex>,
public SharedFactory<Resistor>,
public PFSolverInterfaceBranch {
private:
/// base apparent power[VA]
Real mBaseApparentPower;
/// base impedance [ohm]
Real mBaseImpedance;
/// base admittance [S]
Real mBaseAdmittance;
/// base voltage [V]
Real mBaseVoltage;
/// base current [A]
Real mBaseCurrent;
private:
/// base apparent power[VA]
Real mBaseApparentPower;
/// base impedance [ohm]
Real mBaseImpedance;
/// base admittance [S]
Real mBaseAdmittance;
/// base voltage [V]
Real mBaseVoltage;
/// base current [A]
Real mBaseCurrent;
/// resistance [pu]
Real mResistancePerUnit;
/// conductance [pu]
Real mConductancePerUnit;
/// resistance [pu]
Real mResistancePerUnit;
/// conductance [pu]
Real mConductancePerUnit;
public:
/// Defines UID, name and logging level
Resistor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name and logging level
Resistor(String name, Logger::Level logLevel = Logger::Level::off)
: Resistor(name, name, logLevel) { }
public:
/// Defines UID, name and logging level
Resistor(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Defines name and logging level
Resistor(String name, Logger::Level logLevel = Logger::Level::off)
: Resistor(name, name, logLevel) { }
SimPowerComp<Complex>::Ptr clone(String name);
SimPowerComp<Complex>::Ptr clone(String name);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### General ####
/// Initializes component from power flow data
void initializeFromNodesAndTerminals(Real frequency);
// #### Powerflow section ####
/// Set base voltage
void setBaseVoltage(Real baseVoltage);
/// Initializes component from power flow data
void calculatePerUnitParameters(Real baseApparentPower);
/// Stamps admittance matrix
void pfApplyAdmittanceMatrixStamp(SparseMatrixCompRow & Y);
// #### Powerflow section ####
/// Set base voltage
void setBaseVoltage(Real baseVoltage);
/// Initializes component from power flow data
void calculatePerUnitParameters(Real baseApparentPower);
/// Stamps admittance matrix
void pfApplyAdmittanceMatrixStamp(SparseMatrixCompRow & Y);
// #### MNA section ####
///
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
///
void mnaUpdateVoltage(const Matrix& leftVector);
///
void mnaUpdateCurrent(const Matrix& leftVector);
// #### MNA section ####
///
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
/// Stamps system matrix
void mnaApplySystemMatrixStamp(Matrix& systemMatrix);
/// Update interface voltage from MNA system result
void mnaUpdateVoltage(const Matrix& leftVector);
/// Update interface current from MNA system result
void mnaUpdateCurrent(const Matrix& leftVector);
/// MNA pre and post step operations
void mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector);
/// add MNA pre and post step dependencies
void mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector);
class MnaPostStep : public Task {
public:
MnaPostStep(Resistor& resistor, Attribute<Matrix>::Ptr leftSideVector) :
Task(resistor.mName + ".MnaPostStep"), mResistor(resistor), mLeftVector(leftSideVector)
{
mAttributeDependencies.push_back(mLeftVector);
mModifiedAttributes.push_back(mResistor.attribute("v_intf"));
mModifiedAttributes.push_back(mResistor.attribute("i_intf"));
}
class MnaPostStep : public Task {
public:
MnaPostStep(Resistor& resistor, Attribute<Matrix>::Ptr leftSideVector) :
Task(resistor.mName + ".MnaPostStep"),
mResistor(resistor), mLeftVector(leftSideVector) {
mResistor.mnaAddPostStepDependencies(mPrevStepDependencies, mAttributeDependencies, mModifiedAttributes, mLeftVector);
}
void execute(Real time, Int timeStepCount) { mResistor.mnaPostStep(time, timeStepCount, mLeftVector); };
private:
Resistor& mResistor;
Attribute<Matrix>::Ptr mLeftVector;
};
// #### MNA Tear Section ####
void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
void execute(Real time, Int timeStepCount);
private:
Resistor& mResistor;
Attribute<Matrix>::Ptr mLeftVector;
};
// #### MNA Tear Section ####
void mnaTearApplyMatrixStamp(Matrix& tearMatrix);
};
}
}
};
}
}
}
......@@ -53,6 +53,13 @@ void DP::Ph1::Resistor::mnaInitialize(Real omega, Real timeStep, Attribute<Matri
updateMatrixNodeIndices();
mMnaTasks.push_back(std::make_shared<MnaPostStep>(*this, leftVector));
mSLog->info(
"\n--- MNA initialization ---"
"\nInitial voltage {:s}"
"\nInitial current {:s}"
"\n--- MNA initialization finished ---",
Logger::phasorToString(mIntfVoltage(0, 0)),
Logger::phasorToString(mIntfCurrent(0, 0)));
}
void DP::Ph1::Resistor::mnaInitializeHarm(Real omega, Real timeStep, std::vector<Attribute<Matrix>::Ptr> leftVectors) {
......
......@@ -32,6 +32,10 @@ void SP::Ph1::Capacitor::initializeFromNodesAndTerminals(Real frequency) {
mIntfVoltage(0, 0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent = mSusceptance * mIntfVoltage;
mSLog->info("\nCapacitance [F]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::realToString(mCapacitance),
Logger::complexToString(1./mSusceptance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......@@ -45,6 +49,7 @@ void SP::Ph1::Capacitor::initializeFromNodesAndTerminals(Real frequency) {
Logger::phasorToString(initialSingleVoltage(1)));
}
// #### MNA section ####
void SP::Ph1::Capacitor::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
updateMatrixNodeIndices();
......@@ -89,9 +94,15 @@ void SP::Ph1::Capacitor::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
}
}
void SP::Ph1::Capacitor::MnaPostStep::execute(Real time, Int timeStepCount) {
mCapacitor.mnaUpdateVoltage(*mLeftVector);
mCapacitor.mnaUpdateCurrent(*mLeftVector);
void SP::Ph1::Capacitor::mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) {
attributeDependencies.push_back(leftVector);
modifiedAttributes.push_back(this->attribute("v_intf"));
modifiedAttributes.push_back(this->attribute("i_intf"));
}
void SP::Ph1::Capacitor::mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector) {
this->mnaUpdateVoltage(*leftVector);
this->mnaUpdateCurrent(*leftVector);
}
void SP::Ph1::Capacitor::mnaUpdateVoltage(const Matrix& leftVector) {
......
......@@ -31,7 +31,11 @@ void SP::Ph1::Inductor::initializeFromNodesAndTerminals(Real frequency) {
mSusceptance = Complex(0, -1 / omega / mInductance);
mIntfVoltage(0, 0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent = mSusceptance * mIntfVoltage;
mSLog->info("--- Initialize according to power flow ---");
mSLog->info("\nInductance [H]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::realToString(mInductance),
Logger::complexToString(1./mSusceptance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......@@ -45,6 +49,8 @@ void SP::Ph1::Inductor::initializeFromNodesAndTerminals(Real frequency) {
Logger::phasorToString(initialSingleVoltage(1)));
}
// #### MNA section ####
void SP::Ph1::Inductor::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
updateMatrixNodeIndices();
mMnaTasks.push_back(std::make_shared<MnaPostStep>(*this, leftVector));
......@@ -87,9 +93,15 @@ void SP::Ph1::Inductor::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
}
}
void SP::Ph1::Inductor::MnaPostStep::execute(Real time, Int timeStepCount) {
mInductor.mnaUpdateVoltage(*mLeftVector);
mInductor.mnaUpdateCurrent(*mLeftVector);
void SP::Ph1::Inductor::mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) {
attributeDependencies.push_back(leftVector);
modifiedAttributes.push_back(this->attribute("v_intf"));
modifiedAttributes.push_back(this->attribute("i_intf"));
}
void SP::Ph1::Inductor::mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector) {
this->mnaUpdateVoltage(*leftVector);
this->mnaUpdateCurrent(*leftVector);
}
void SP::Ph1::Inductor::mnaUpdateVoltage(const Matrix& leftVector) {
......
......@@ -27,6 +27,29 @@ SimPowerComp<Complex>::Ptr SP::Ph1::Resistor::clone(String name) {
return copy;
}
void SP::Ph1::Resistor::initializeFromNodesAndTerminals(Real frequency) {
mConductance = 1 / mResistance;
mIntfVoltage(0, 0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent = mConductance*mIntfVoltage;
mSLog->info("\nResistance [Ohm]: {:s}",
Logger::realToString(mResistance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
"\nCurrent: {:s}"
"\nTerminal 0 voltage: {:s}"
"\nTerminal 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)));
}
// #### Powerflow section ####
void SP::Ph1::Resistor::setBaseVoltage(Real baseVoltage){
mBaseVoltage = baseVoltage;
}
......@@ -62,31 +85,13 @@ void SP::Ph1::Resistor::pfApplyAdmittanceMatrixStamp(SparseMatrixCompRow & Y) {
mSLog->info("#### Y matrix stamping: {}", Y_element);
}
void SP::Ph1::Resistor::initializeFromNodesAndTerminals(Real frequency) {
mConductance = 1 / mResistance;
mIntfVoltage(0, 0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent = mConductance*mIntfVoltage;
mSLog->info("\nResistance [Ohm]: {:s}",
Logger::realToString(mResistance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
"\nCurrent: {:s}"
"\nTerminal 0 voltage: {:s}"
"\nTerminal 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)));
}
// #### MNA section ####
void SP::Ph1::Resistor::mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector) {
MNAInterface::mnaInitialize(omega, timeStep);
updateMatrixNodeIndices();
mMnaTasks.push_back(std::make_shared<MnaPostStep>(*this, leftVector));
mMnaTasks.push_back(std::make_shared<MnaPostStep>(*this, leftVector));
mSLog->info(
"\n--- MNA initialization ---"
"\nInitial voltage {:s}"
......@@ -123,30 +128,35 @@ void SP::Ph1::Resistor::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
}
}
void SP::Ph1::Resistor::MnaPostStep::execute(Real time, Int timeStepCount) {
mResistor.mnaUpdateVoltage(*mLeftVector);
mResistor.mnaUpdateCurrent(*mLeftVector);
void SP::Ph1::Resistor::mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute<Matrix>::Ptr &leftVector) {
attributeDependencies.push_back(leftVector);
modifiedAttributes.push_back(this->attribute("v_intf"));
modifiedAttributes.push_back(this->attribute("i_intf"));
}
void SP::Ph1::Resistor::mnaPostStep(Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector) {
this->mnaUpdateVoltage(*leftVector);
this->mnaUpdateCurrent(*leftVector);
}
void SP::Ph1::Resistor::mnaUpdateVoltage(const Matrix& leftVector) {
// Voltage across component is defined as V1 - V0
mIntfVoltage = MatrixComp::Zero(1, 1);
if (terminalNotGrounded(1)) {
mIntfVoltage(0, 0) = Math::complexFromVectorElement(leftVector, matrixNodeIndex(1));
}
if (terminalNotGrounded(0)) {
mIntfVoltage(0, 0) = mIntfVoltage(0, 0) - Math::complexFromVectorElement(leftVector, matrixNodeIndex(0));
}
// v1 - v0
for (UInt freq = 0; freq < mNumFreqs; freq++) {
mIntfVoltage(0,freq) = 0;
if (terminalNotGrounded(1))
mIntfVoltage(0,freq) = Math::complexFromVectorElement(leftVector, matrixNodeIndex(1), mNumFreqs, freq);
if (terminalNotGrounded(0))
mIntfVoltage(0,freq) = mIntfVoltage(0,freq) - Math::complexFromVectorElement(leftVector, matrixNodeIndex(0), mNumFreqs, freq);
//mLog.debug() << "Voltage A: " << std::abs(mIntfVoltage(0, 0))
// << "<" << std::arg(mIntfVoltage(0, 0)) << std::endl;
SPDLOG_LOGGER_DEBUG(mSLog, "Voltage {:s}", Logger::phasorToString(mIntfVoltage(0,freq)));
}
}
void SP::Ph1::Resistor::mnaUpdateCurrent(const Matrix& leftVector) {
mIntfCurrent = mIntfVoltage / mResistance;
//mLog.debug() << "Current A: " << std::abs(mIntfCurrent(0, 0))
// << "<" << std::arg(mIntfCurrent(0, 0)) << std::endl;
for (UInt freq = 0; freq < mNumFreqs; freq++) {
mIntfCurrent(0,freq) = mIntfVoltage(0,freq) / mResistance;
SPDLOG_LOGGER_DEBUG(mSLog, "Current {:s}", Logger::phasorToString(mIntfCurrent(0,freq)));
}