diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-04-11 09:23:12 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 09:23:12 -0300 |
commit | af070d92462ac5586aa6a0a80c51a8fa72710600 (patch) | |
tree | 1e78bf3ced07950a572b1d94c4b029c540c73148 /Project/PowerFlow.cpp | |
parent | e5a5041915127e72820a0478724a20dc41f0327e (diff) | |
parent | f6cd17abe2e788c2b1a1983a4d7efbd3b49880ca (diff) | |
download | PSP.git-af070d92462ac5586aa6a0a80c51a8fa72710600.tar.gz PSP.git-af070d92462ac5586aa6a0a80c51a8fa72710600.tar.xz PSP.git-af070d92462ac5586aa6a0a80c51a8fa72710600.zip |
Merge pull request #45 from Thales1330/wip/import-ANAREDE-files
Wip import anarede files
Diffstat (limited to 'Project/PowerFlow.cpp')
-rw-r--r-- | Project/PowerFlow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp index 4a2b7c9..bafbbfb 100644 --- a/Project/PowerFlow.cpp +++ b/Project/PowerFlow.cpp @@ -26,6 +26,7 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, double initAngle, double accFactor) { + double radInitAngle = wxDegToRad(initAngle); // Calculate the Ybus. if(!GetYBus(m_yBus, systemPowerBase)) { m_errorMsg = _("No buses found on the system."); @@ -73,9 +74,10 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, // Fill the voltages array if(data.isVoltageControlled && busType[busNumber] != BUS_PQ) { - voltage.push_back(std::complex<double>(data.controlledVoltage, 0.0)); + voltage.push_back(std::complex<double>(data.controlledVoltage * std::cos(radInitAngle), + data.controlledVoltage * std::sin(radInitAngle))); } else { - voltage.push_back(std::complex<double>(1.0, 0.0)); + voltage.push_back(std::complex<double>(std::cos(radInitAngle), std::sin(radInitAngle))); } // Fill the power array |