summaryrefslogtreecommitdiffstats
path: root/Project
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-01-11 10:20:43 -0200
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-01-11 10:20:43 -0200
commitfc820e8a03cd670835ac7fc7434226fad1c8e444 (patch)
tree2d34ff1b868a453ececb488eee35c2d17221b17f /Project
parent2458c9d8a5763a10388550650d8b571a659b0094 (diff)
downloadPSP.git-fc820e8a03cd670835ac7fc7434226fad1c8e444.tar.gz
PSP.git-fc820e8a03cd670835ac7fc7434226fad1c8e444.tar.xz
PSP.git-fc820e8a03cd670835ac7fc7434226fad1c8e444.zip
ZIP load bugfix
Diffstat (limited to 'Project')
-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));
}
}
}