summaryrefslogtreecommitdiffstats
path: root/Project/Workspace.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-07-25 01:11:17 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-07-25 01:11:17 -0300
commitc7ef9a883031c68506357f9ef1b1a0b79c79f4da (patch)
tree06646fb4511030daa7fb6426dfab9dc2413a7253 /Project/Workspace.cpp
parent4f434e4a1cccce69e4b680e4734df52244d3a30b (diff)
downloadPSP.git-c7ef9a883031c68506357f9ef1b1a0b79c79f4da.tar.gz
PSP.git-c7ef9a883031c68506357f9ef1b1a0b79c79f4da.tar.xz
PSP.git-c7ef9a883031c68506357f9ef1b1a0b79c79f4da.zip
Motor integration with PF
Newton bug fixed Newton inertia implemented Gauss-Newton implemented
Diffstat (limited to 'Project/Workspace.cpp')
-rw-r--r--Project/Workspace.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp
index b057bdc..82989b5 100644
--- a/Project/Workspace.cpp
+++ b/Project/Workspace.cpp
@@ -1135,6 +1135,7 @@ bool Workspace::RunPowerFlow()
basePower *= 1e3;
PowerFlow pf(GetElementList());
bool result = false;
+ wxStopWatch sw;
switch(simProp.powerFlowMethod) {
case GAUSS_SEIDEL: {
result = pf.RunGaussSeidel(basePower, simProp.powerFlowMaxIterations, simProp.powerFlowTolerance,
@@ -1142,16 +1143,21 @@ bool Workspace::RunPowerFlow()
} break;
case NEWTON_RAPHSON: {
result = pf.RunNewtonRaphson(basePower, simProp.powerFlowMaxIterations, simProp.powerFlowTolerance,
- simProp.initAngle);
+ simProp.initAngle, simProp.newtonInertia);
} break;
case GAUSS_NEWTON: {
- result = pf.RunGaussNewton(basePower, simProp.powerFlowMaxIterations, simProp.powerFlowTolerance,
- simProp.initAngle, simProp.accFator, simProp.gaussTolerance);
+ result =
+ pf.RunGaussNewton(basePower, simProp.powerFlowMaxIterations, simProp.powerFlowTolerance,
+ simProp.initAngle, simProp.accFator, simProp.gaussTolerance, simProp.newtonInertia);
} break;
}
+ sw.Pause();
if(!result) {
wxMessageDialog msgDialog(this, pf.GetErrorMessage(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
msgDialog.ShowModal();
+ } else {
+ m_statusBar->SetStatusText(
+ wxString::Format(_("Power flow converge with %d iterations (%ld ms)"), pf.GetIterations(), sw.Time()));
}
UpdateTextElements();