diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-11-01 19:36:24 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-11-01 19:36:24 -0200 |
commit | b306118b2683cf6f264b5f1617c3e0e62a6c9042 (patch) | |
tree | 2059f3a6647d5021a0eaa7f1b08635cbcd83def0 /Project/PowerFlow.cpp | |
parent | 7d4df7195202eaea0e84f227e96f19dec4144081 (diff) | |
download | PSP.git-b306118b2683cf6f264b5f1617c3e0e62a6c9042.tar.gz PSP.git-b306118b2683cf6f264b5f1617c3e0e62a6c9042.tar.xz PSP.git-b306118b2683cf6f264b5f1617c3e0e62a6c9042.zip |
Power flow (gs) under implementation
Diffstat (limited to 'Project/PowerFlow.cpp')
-rw-r--r-- | Project/PowerFlow.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp new file mode 100644 index 0000000..22aa027 --- /dev/null +++ b/Project/PowerFlow.cpp @@ -0,0 +1,27 @@ +#include "PowerFlow.h" + +PowerFlow::PowerFlow(std::vector<Element*> elementList) : ElectricCalculation() +{ + GetElementsFromList(elementList); +} + +PowerFlow::~PowerFlow() +{ +} + +bool PowerFlow::RunGaussSeidel() +{ + GetYBus(m_yBus, 100e6); + + wxString str = ""; + for(int i=0; i<(int)m_yBus.size(); i++) { + for(int j=0; j<(int)m_yBus[i].size(); j++) { + str += wxString::Format("%.2f + j%.2f\t", m_yBus[i][j].real(), m_yBus[i][j].imag()); + } + str += "\n"; + } + + wxLogMessage(str); + + return true; +} |