Commit 67acf3c7 authored by Jan Dinkelbach's avatar Jan Dinkelbach Committed by Markus Mirz
Browse files

extend logging of parameters of RLC in dp1ph and emt3ph

parent 8620d8d1
......@@ -56,13 +56,13 @@ namespace CPS {
// #### to string methods ####
static String matrixToString(const Matrix& mat) {
std::stringstream ss;
ss << std::scientific << mat;
ss << std::scientific << "\n" << mat;
return ss.str();
}
static String matrixCompToString(const MatrixComp& mat) {
std::stringstream ss;
ss << std::scientific << mat;
ss << std::scientific << "\n" << mat;
return ss.str();
}
......@@ -92,6 +92,12 @@ namespace CPS {
return ss.str();
}
static String realToString(const Real& num) {
std::stringstream ss;
ss << std::defaultfloat << num;
return ss.str();
}
static String getCSVColumnNames(std::vector<String> names);
static String getCSVLineFromData(Real time, Real data);
static String getCSVLineFromData(Real time, const Matrix& data);
......
......@@ -42,6 +42,10 @@ void DP::Ph1::Capacitor::initializeFromNodesAndTerminals(Real frequency) {
mIntfVoltage(0,0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent(0,0) = mIntfVoltage(0,0) / impedance;
mSLog->info("\nCapacitance [F]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::realToString(mCapacitance),
Logger::complexToString(impedance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......
......@@ -41,6 +41,10 @@ void DP::Ph1::Inductor::initializeFromNodesAndTerminals(Real frequency) {
mIntfVoltage(0,0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent(0,0) = mIntfVoltage(0,0) / impedance;
mSLog->info("\nInductance [H]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::realToString(mInductance),
Logger::complexToString(impedance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......
......@@ -31,6 +31,10 @@ void DP::Ph1::Resistor::initializeFromNodesAndTerminals(Real frequency) {
mIntfVoltage(0,0) = initialSingleVoltage(1) - initialSingleVoltage(0);
mIntfCurrent(0,0) = mIntfVoltage(0,0) / impedance;
mSLog->info("\nResistance [Ohm]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::realToString(mResistance),
Logger::complexToString(impedance));
mSLog->info("\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
"\nCurrent: {:s}"
......
......@@ -43,7 +43,10 @@ void EMT::Ph3::Capacitor::initializeFromNodesAndTerminals(Real frequency) {
mIntfVoltage = vInitABC.real();
mIntfCurrent = (admittance * vInitABC).real();
mSLog->info("\nCapacitance [F]: {:s}"
"\nAdmittance [S]: {:s}",
Logger::matrixToString(mCapacitance),
Logger::matrixCompToString(admittance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......@@ -117,11 +120,11 @@ void EMT::Ph3::Capacitor::mnaApplySystemMatrixStamp(Matrix& systemMatrix) {
Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1, 2), matrixNodeIndex(0, 0), -mEquivCond(2, 0));
Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1, 2), matrixNodeIndex(0, 1), -mEquivCond(2, 1));
Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1, 2), matrixNodeIndex(0, 2), -mEquivCond(2, 2));
mSLog->info(
}
mSLog->info(
"\nEquivalent Conductance: {:s}",
Logger::matrixToString(mEquivCond));
}
}
void EMT::Ph3::Capacitor::mnaApplyRightSideVectorStamp(Matrix& rightVector) {
......
......@@ -44,7 +44,10 @@ void EMT::Ph3::Inductor::initializeFromNodesAndTerminals(Real frequency) {
MatrixComp admittance = impedance.inverse();
mIntfCurrent = (admittance * vInitABC).real();
mSLog->info("\nInductance [H]: {:s}"
"\nImpedance [Ohm]: {:s}",
Logger::matrixToString(mInductance),
Logger::matrixCompToString(impedance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......
......@@ -37,6 +37,10 @@ void EMT::Ph3::Resistor::initializeFromNodesAndTerminals(Real frequency) {
mConductance = mResistance.inverse();
mIntfCurrent = (mConductance * vInitABC).real();
mSLog->info("\nResistance [Ohm]: {:s}"
"\nConductance [S]: {:s}",
Logger::matrixToString(mResistance),
Logger::matrixToString(mConductance));
mSLog->info(
"\n--- Initialization from powerflow ---"
"\nVoltage across: {:s}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment