From aad89bf4d16d45c0790bd2fc010d9ec06cc35430 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 29 Dec 2018 13:38:13 -0200 Subject: wxWidgets update (3.1.2) and bugfixes --- Project/Electromechanical.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Project/Electromechanical.cpp') diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index 4ebb3b3..66d5bb2 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -235,7 +235,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); } // Insert load (only disconnected load) @@ -245,7 +245,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); } } } -- cgit