summaryrefslogtreecommitdiffstats
path: root/Project/ControlElementSolver.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-05-10 18:27:30 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-05-10 18:27:30 -0300
commit4269e9370873ac31fe671c710536958ca4374aad (patch)
tree578197b1e1bfec7300306081d99769a4c9630c6e /Project/ControlElementSolver.cpp
parent2ef7d2bdf1ca4a6b9ee207e4a43f3116f55c0274 (diff)
downloadPSP.git-4269e9370873ac31fe671c710536958ca4374aad.tar.gz
PSP.git-4269e9370873ac31fe671c710536958ca4374aad.tar.xz
PSP.git-4269e9370873ac31fe671c710536958ca4374aad.zip
All element's solutions implemented
Initialization is missing
Diffstat (limited to 'Project/ControlElementSolver.cpp')
-rw-r--r--Project/ControlElementSolver.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/Project/ControlElementSolver.cpp b/Project/ControlElementSolver.cpp
index 42445f4..a1aee27 100644
--- a/Project/ControlElementSolver.cpp
+++ b/Project/ControlElementSolver.cpp
@@ -75,6 +75,11 @@ void ControlElementSolver::InitializeValues(double input, bool startAllZero)
TransferFunction* tf = *it;
tf->CalculateSpaceState(m_timeStep, m_integrationError);
}
+ auto rateLimiterList = m_ctrlContainer->GetRateLimiterList();
+ for(auto it = rateLimiterList.begin(), itEnd = rateLimiterList.end(); it != itEnd; ++it) {
+ RateLimiter* rl = *it;
+ rl->SetTimeStep(m_timeStep);
+ }
auto connectionLineList = m_ctrlContainer->GetConnectionLineList();
for(auto it = connectionLineList.begin(), itEnd = connectionLineList.end(); it != itEnd; ++it) {
ConnectionLine* cLine = *it;
@@ -84,6 +89,8 @@ void ControlElementSolver::InitializeValues(double input, bool startAllZero)
if(!startAllZero) {
// Calculate the steady-state results according to the input.
+ double minError = 1e-6;
+
}
}
@@ -123,9 +130,9 @@ void ControlElementSolver::SolveNextStep(double input)
ConnectionLine* currentLine = firstConn;
while(currentLine) {
- ConnectionLine* lastLine = currentLine;
+ //ConnectionLine* lastLine = currentLine;
currentLine = SolveNextElement(currentLine);
- if(!currentLine) m_solutions.push_back(lastLine->GetValue());
+ //if(!currentLine) m_solutions.push_back(lastLine->GetValue());
}
bool haveUnsolvedElement = true;
@@ -152,6 +159,13 @@ void ControlElementSolver::SolveNextStep(double input)
if(haveUnsolvedElement) break;
}
}
+
+ // Set the control system step output.
+ if(m_outputControl->GetChildList().size() == 1) {
+ ConnectionLine* cLine = static_cast<ConnectionLine*>(m_outputControl->GetChildList()[0]);
+ m_solutions.push_back(cLine->GetValue());
+ }
+ else m_solutions.push_back(0.0);
}
void ControlElementSolver::FillAllConnectedChildren(ConnectionLine* parent)