diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-07-14 13:08:48 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-07-14 13:08:48 -0300 |
commit | 2458c9d8a5763a10388550650d8b571a659b0094 (patch) | |
tree | d2874fe7e0f15f0b5181f9159cd3b6a0a48af56f /Project/ElectricCalculation.cpp | |
parent | f4de628c999810808d961899299686a9f0c50b5b (diff) | |
parent | 73e934c17098281ffccd214f7517cd0f6ce03ab6 (diff) | |
download | PSP.git-2458c9d8a5763a10388550650d8b571a659b0094.tar.gz PSP.git-2458c9d8a5763a10388550650d8b571a659b0094.tar.xz PSP.git-2458c9d8a5763a10388550650d8b571a659b0094.zip |
Merge branch 'wip/induction-motor' of https://github.com/Thales1330/PSP into wip/induction-motor
Diffstat (limited to 'Project/ElectricCalculation.cpp')
-rw-r--r-- | Project/ElectricCalculation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp index 36e7a9a..af3173b 100644 --- a/Project/ElectricCalculation.cpp +++ b/Project/ElectricCalculation.cpp @@ -74,7 +74,8 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > double systemPowerBase, YBusSequence sequence, bool includeSyncMachines, - bool allLoadsAsImpedances) + bool allLoadsAsImpedances, + bool usePowerFlowVoltagesOnImpedances) { if(m_busList.size() == 0) return false; @@ -106,7 +107,7 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); if(data.loadType == CONST_IMPEDANCE || allLoadsAsImpedances) { std::complex<double> yLoad = std::complex<double>(data.activePower, -data.reactivePower); - if(allLoadsAsImpedances) { + if(allLoadsAsImpedances && usePowerFlowVoltagesOnImpedances) { std::complex<double> v = static_cast<Bus*>(load->GetParentList()[0])->GetElectricalData().voltage; yLoad /= (std::abs(v) * std::abs(v)); } |