nlp_solver.hpp
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 
33 #ifndef ACADO_TOOLKIT_NLP_SOLVER_HPP
34 #define ACADO_TOOLKIT_NLP_SOLVER_HPP
35 
36 
39 
42 
43 
44 
46 
47 
48 
59 class NLPsolver : public AlgorithmicBase
60 {
61 
62  //
63  // PUBLIC MEMBER FUNCTIONS:
64  //
65  public:
66 
68  NLPsolver( UserInteraction* _userInteraction = 0
69  );
70 
72  NLPsolver( const NLPsolver& rhs );
73 
75  virtual ~NLPsolver( );
76 
78  NLPsolver& operator=( const NLPsolver& rhs );
79 
80  virtual NLPsolver* clone( ) const = 0;
81 
82 
84  virtual returnValue init(VariablesGrid *xd,
85  VariablesGrid *xa,
86  VariablesGrid *p,
87  VariablesGrid *u,
88  VariablesGrid *w ) = 0;
89 
90 
92  virtual returnValue solve( const DVector &x0_ = emptyConstVector,
93  const DVector &p_ = emptyConstVector
94  );
95 
97  virtual returnValue step( const DVector &x0_ = emptyConstVector,
98  const DVector &p_ = emptyConstVector
99  );
100 
102  virtual returnValue feedbackStep( const DVector &x0_,
103  const DVector &p_ = emptyConstVector
104  );
105 
107  virtual returnValue performCurrentStep( );
108 
110  virtual returnValue prepareNextStep( );
111 
113  virtual returnValue shiftVariables( double timeShift,
114  DVector lastX = emptyVector,
115  DVector lastXA = emptyVector,
116  DVector lastP = emptyVector,
117  DVector lastU = emptyVector,
118  DVector lastW = emptyVector );
119 
120 
126  virtual returnValue getVarianceCovariance( DMatrix &var ) = 0;
127 
128 
136  virtual returnValue setReference( const VariablesGrid &ref );
137 
138 // virtual returnValue enableNeedToReevaluate( ) = 0;
139 
140 
141  inline int getNumberOfSteps( ) const;
142 
144 
145 
146 
147  virtual returnValue getDifferentialStates( VariablesGrid &xd_ ) const;
148  virtual returnValue getAlgebraicStates ( VariablesGrid &xa_ ) const;
149  virtual returnValue getParameters ( VariablesGrid &p_ ) const;
150  virtual returnValue getParameters ( DVector &p_ ) const;
151  virtual returnValue getControls ( VariablesGrid &u_ ) const;
152  virtual returnValue getFirstControl ( DVector &u0_ ) const;
153  virtual returnValue getDisturbances ( VariablesGrid &w_ ) const;
154  virtual double getObjectiveValue ( ) const;
155 
157  ) const;
158 
160  ) const;
161 
163  ) const;
164 
166  ) const;
167 
169  ) const;
170 
171 
172  //
173  // PROTECTED MEMBER FUNCTIONS:
174  //
175  protected:
176  virtual returnValue setupOptions( );
177  virtual returnValue setupLogging( );
178 
179 
180  //
181  // DATA MEMBERS:
182  //
183  protected:
184 
186 };
187 
188 
190 
191 
192 
193 #include <acado/nlp_solver/nlp_solver.ipp>
194 
195 
196 #endif // ACADO_TOOLKIT_NLP_SOLVER_HPP
197 
198 /*
199  * end of file
200  */
int numberOfSteps
Definition: nlp_solver.hpp:185
Implements a very rudimentary block sparse matrix class.
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
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
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
virtual returnValue init(VariablesGrid *xd, VariablesGrid *xa, VariablesGrid *p, VariablesGrid *u, VariablesGrid *w)=0
#define CLOSE_NAMESPACE_ACADO
virtual returnValue getDisturbances(VariablesGrid &w_) const
Definition: nlp_solver.cpp:166
virtual returnValue setupOptions()
Definition: nlp_solver.cpp:217
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
static const DVector emptyConstVector
Definition: vector.hpp:336
virtual returnValue setupLogging()
Definition: nlp_solver.cpp:248
virtual NLPsolver * clone() const =0
virtual returnValue getParameters(VariablesGrid &p_) const
Definition: nlp_solver.cpp:143
int getNumberOfSteps() const
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)
Base class for different algorithms for solving nonlinear programming (NLP) problems.
Definition: nlp_solver.hpp:59
virtual returnValue getSensitivitiesW(BlockMatrix &_sens) const
Definition: nlp_solver.cpp:205
virtual returnValue getVarianceCovariance(DMatrix &var)=0
returnValue resetNumberOfSteps()
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
static DVector emptyVector
Definition: vector.hpp:335
virtual returnValue getFirstControl(DVector &u0_) const
Definition: nlp_solver.cpp:160
#define BEGIN_NAMESPACE_ACADO
virtual ~NLPsolver()
Definition: nlp_solver.cpp:65


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