summaryrefslogtreecommitdiffstats
path: root/Project/Electromechanical.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2018-12-29 13:38:13 -0200
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2018-12-29 13:38:13 -0200
commitaad89bf4d16d45c0790bd2fc010d9ec06cc35430 (patch)
tree7b552fe5dcec9c4ef4575e897b63e3e6cddf2c89 /Project/Electromechanical.cpp
parent2458c9d8a5763a10388550650d8b571a659b0094 (diff)
downloadPSP.git-aad89bf4d16d45c0790bd2fc010d9ec06cc35430.tar.gz
PSP.git-aad89bf4d16d45c0790bd2fc010d9ec06cc35430.tar.xz
PSP.git-aad89bf4d16d45c0790bd2fc010d9ec06cc35430.zip
wxWidgets update (3.1.2) and bugfixes
Diffstat (limited to 'Project/Electromechanical.cpp')
-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..66d5bb2 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) / (std::abs(v) * std::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) / (std::abs(v) * std::abs(v));
}
}
}