nlp_solver.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
35 
36 
37 
39 
40 
41 
42 //
43 // PUBLIC MEMBER FUNCTIONS:
44 //
45 
46 NLPsolver::NLPsolver( UserInteraction* _userInteraction ) : AlgorithmicBase( _userInteraction )
47 {
48  // setup options and loggings for stand-alone instances
49  if ( _userInteraction == 0 )
50  {
51  setupOptions( );
52  setupLogging( );
53  }
54 
55  numberOfSteps = 0;
56 }
57 
58 
60 {
62 }
63 
64 
66 
67 }
68 
69 
71 {
72  if ( this != &rhs )
73  {
75 
77  }
78 
79  return *this;
80 }
81 
83  ){
85 }
86 
87 
88 
90 {
92 }
93 
94 
96 {
98 }
99 
100 
102 {
104 }
105 
106 
107 returnValue NLPsolver::step( const DVector &x0_, const DVector &p_ )
108 {
110 }
111 
112 
113 
115  DVector lastX,
116  DVector lastXA,
117  DVector lastP,
118  DVector lastU,
119  DVector lastW )
120 {
122 }
123 
124 
126 
128 }
129 
130 
132 
134 }
135 
136 
138 
140 }
141 
142 
144 
146 }
147 
149 
151 }
152 
153 
155 
157 }
158 
159 
161 
163 }
164 
165 
167 
169 }
170 
171 
173 
175 }
176 
177 
179  ) const
180 {
182 }
183 
184 
186  ) const
187 {
189 }
190 
192  ) const
193 {
195 }
196 
197 
199  ) const
200 {
202 }
203 
204 
206  ) const
207 {
209 }
210 
211 
212 
213 //
214 // PROTECTED MEMBER FUNCTIONS:
215 //
216 
218 {
243 
244  return SUCCESSFUL_RETURN;
245 }
246 
247 
249 {
250 // LogRecord tmp( LOG_AT_EACH_ITERATION,stdout,PS_DEFAULT,BT_FALSE );
251 
252 // addLogRecord( tmp );
253 
254  return SUCCESSFUL_RETURN;
255 }
256 
257 
259 
260 // end of file.
int numberOfSteps
Definition: nlp_solver.hpp:185
const int defaultDiscretizationType
const int defaultPrintlevel
Implements a very rudimentary block sparse matrix class.
const double defaultKKTtoleranceSafeguard
virtual returnValue getAlgebraicStates(VariablesGrid &xa_) const
Definition: nlp_solver.cpp:137
virtual returnValue getSensitivitiesP(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:191
virtual returnValue feedbackStep(const DVector &x0_, const DVector &p_=emptyConstVector)
Definition: nlp_solver.cpp:89
virtual returnValue performCurrentStep()
Definition: nlp_solver.cpp:95
const int defaultObjectiveSensitivity
Provides a time grid consisting of vector-valued optimization variables at each grid point...
virtual returnValue getSensitivitiesX(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:178
Allows to pass back messages to the calling function.
virtual returnValue prepareNextStep()
Definition: nlp_solver.cpp:101
virtual returnValue setReference(const VariablesGrid &ref)
Definition: nlp_solver.cpp:125
virtual returnValue solve(const DVector &x0_=emptyConstVector, const DVector &p_=emptyConstVector)
Definition: nlp_solver.cpp:82
AlgorithmicBase & operator=(const AlgorithmicBase &rhs)
virtual returnValue getSensitivitiesXA(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:185
NLPsolver & operator=(const NLPsolver &rhs)
Definition: nlp_solver.cpp:70
Base class for all algorithmic modules within the ACADO Toolkit providing some basic functionality...
virtual double getObjectiveValue() const
Definition: nlp_solver.cpp:172
const int defaultDynamicSensitivity
const double defaultMinLinesearchParameter
#define CLOSE_NAMESPACE_ACADO
const int defaultHotstartQP
virtual returnValue getDisturbances(VariablesGrid &w_) const
Definition: nlp_solver.cpp:166
virtual returnValue setupOptions()
Definition: nlp_solver.cpp:217
const int defaultTerminateAtConvergence
virtual returnValue getControls(VariablesGrid &u_) const
Definition: nlp_solver.cpp:154
virtual returnValue shiftVariables(double timeShift, DVector lastX=emptyVector, DVector lastXA=emptyVector, DVector lastP=emptyVector, DVector lastU=emptyVector, DVector lastW=emptyVector)
Definition: nlp_solver.cpp:114
const int defaultHessianApproximation
virtual returnValue setupLogging()
Definition: nlp_solver.cpp:248
const double defaultHessianProjectionFactor
virtual returnValue getParameters(VariablesGrid &p_) const
Definition: nlp_solver.cpp:143
const double defaultInfeasibleQPrelaxation
const double defaultLinesearchTolerance
Encapsulates all user interaction for setting options, logging data and plotting results.
NLPsolver(UserInteraction *_userInteraction=0)
Definition: nlp_solver.cpp:46
void rhs(const real_t *x, real_t *f)
const int defaultprintSCPmethodProfile
Base class for different algorithms for solving nonlinear programming (NLP) problems.
Definition: nlp_solver.hpp:59
const int defaultDynamicHessianApproximation
virtual returnValue getSensitivitiesW(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:205
const double defaultLevenbergMarguardt
const int defaultGlobalizationStrategy
virtual returnValue getSensitivitiesU(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:198
virtual returnValue step(const DVector &x0_=emptyConstVector, const DVector &p_=emptyConstVector)
Definition: nlp_solver.cpp:107
virtual returnValue getDifferentialStates(VariablesGrid &xd_) const
Definition: nlp_solver.cpp:131
const int defaultConstraintSensitivity
virtual returnValue getFirstControl(DVector &u0_) const
Definition: nlp_solver.cpp:160
#define BEGIN_NAMESPACE_ACADO
const int defaultSparseQPsolution
const double defaultKKTtolerance
const int defaultPrintCopyright
virtual ~NLPsolver()
Definition: nlp_solver.cpp:65
returnValue addOption(OptionsName name, int value)
const int defaultUseRealtimeIterations
BEGIN_NAMESPACE_ACADO const int defaultMaxNumIterations
const int defaultInfeasibleQPhandling
const int defaultMaxNumQPiterations
#define ACADOERROR(retval)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:54