summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Project/Electromechanical.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp
index 4ebb3b3..0504bab 100644
--- a/Project/Electromechanical.cpp
+++ b/Project/Electromechanical.cpp
@@ -235,7 +235,7 @@ void Electromechanical::SetEvent(double currentTime)
Bus* parentBus = static_cast<Bus*>(load->GetParentList()[0]);
int n = parentBus->GetElectricalData().number;
std::complex<double> v = parentBus->GetElectricalData().voltage;
- m_yBus[n][n] -= std::complex<double>(data.activePower, -data.reactivePower) / (v * v);
+ m_yBus[n][n] -= std::complex<double>(data.activePower, -data.reactivePower) / (abs(v) * abs(v));
}
// Insert load (only disconnected load)
@@ -245,7 +245,7 @@ void Electromechanical::SetEvent(double currentTime)
Bus* parentBus = static_cast<Bus*>(load->GetParentList()[0]);
int n = parentBus->GetElectricalData().number;
std::complex<double> v = parentBus->GetElectricalData().voltage;
- m_yBus[n][n] += std::complex<double>(data.activePower, -data.reactivePower) / (v * v);
+ m_yBus[n][n] += std::complex<double>(data.activePower, -data.reactivePower) / (abs(v) * abs(v));
}
}
}