nlp_solver.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00033 #ifndef ACADO_TOOLKIT_NLP_SOLVER_HPP
00034 #define ACADO_TOOLKIT_NLP_SOLVER_HPP
00035 
00036 
00037 #include <acado/utils/acado_utils.hpp>
00038 #include <acado/user_interaction/algorithmic_base.hpp>
00039 
00040 #include <acado/variables_grid/variables_grid.hpp>
00041 #include <acado/clock/real_clock.hpp>
00042 
00043 
00044 
00045 BEGIN_NAMESPACE_ACADO
00046 
00047 
00048 
00059 class NLPsolver : public AlgorithmicBase
00060 {
00061 
00062     //
00063     // PUBLIC MEMBER FUNCTIONS:
00064     //
00065     public:
00066 
00068         NLPsolver(      UserInteraction* _userInteraction = 0
00069                                         );
00070 
00072         NLPsolver( const NLPsolver& rhs );
00073 
00075         virtual ~NLPsolver( );
00076 
00078         NLPsolver& operator=( const NLPsolver& rhs );
00079 
00080         virtual NLPsolver* clone( ) const = 0;
00081 
00082 
00084         virtual returnValue init(VariablesGrid    *xd,
00085                                  VariablesGrid    *xa,
00086                                  VariablesGrid    *p,
00087                                  VariablesGrid    *u,
00088                                  VariablesGrid    *w   ) = 0;
00089 
00090 
00092         virtual returnValue solve(      const DVector &x0_ = emptyConstVector,
00093                                                                         const DVector &p_ = emptyConstVector
00094                                                                         );
00095 
00097         virtual returnValue step(       const DVector &x0_ = emptyConstVector,
00098                                                                         const DVector &p_ = emptyConstVector
00099                                                                         );
00100 
00102         virtual returnValue feedbackStep(       const DVector &x0_,
00103                                                                                         const DVector &p_ = emptyConstVector
00104                                                                                         );
00105 
00107         virtual returnValue performCurrentStep( );
00108 
00110         virtual returnValue prepareNextStep( );
00111 
00113         virtual returnValue shiftVariables(     double timeShift,
00114                                                                         DVector  lastX    =  emptyVector,
00115                                                                         DVector lastXA    =  emptyVector,
00116                                                                         DVector lastP     =  emptyVector,
00117                                                                         DVector lastU     =  emptyVector,
00118                                                                         DVector lastW     =  emptyVector  );
00119 
00120 
00126         virtual returnValue getVarianceCovariance( DMatrix &var ) = 0;
00127 
00128 
00136         virtual returnValue setReference( const VariablesGrid &ref );
00137 
00138 //              virtual returnValue enableNeedToReevaluate( ) = 0;
00139 
00140 
00141                 inline int getNumberOfSteps( ) const;
00142 
00143                 inline returnValue resetNumberOfSteps( );
00144 
00145 
00146 
00147         virtual returnValue getDifferentialStates( VariablesGrid &xd_ ) const;
00148         virtual returnValue getAlgebraicStates   ( VariablesGrid &xa_ ) const;
00149         virtual returnValue getParameters        ( VariablesGrid &p_  ) const;
00150                 virtual returnValue getParameters        ( DVector        &p_  ) const;
00151         virtual returnValue getControls          ( VariablesGrid &u_  ) const;
00152                 virtual returnValue getFirstControl      ( DVector        &u0_ ) const;
00153         virtual returnValue getDisturbances      ( VariablesGrid &w_  ) const;
00154         virtual double      getObjectiveValue    (                    ) const;
00155 
00156                 virtual returnValue getSensitivitiesX(  BlockMatrix& _sens
00157                                                                                                 ) const;
00158 
00159                 virtual returnValue getSensitivitiesXA( BlockMatrix& _sens
00160                                                                                                         ) const;
00161 
00162                 virtual returnValue getSensitivitiesP(  BlockMatrix& _sens
00163                                                                                                 ) const;
00164 
00165                 virtual returnValue getSensitivitiesU(  BlockMatrix& _sens
00166                                                                                                         ) const;
00167 
00168                 virtual returnValue getSensitivitiesW(  BlockMatrix& _sens
00169                                                                                                 ) const;
00170 
00171 
00172     //
00173     // PROTECTED MEMBER FUNCTIONS:
00174     //
00175     protected:
00176                 virtual returnValue setupOptions( );
00177                 virtual returnValue setupLogging( );
00178 
00179 
00180     //
00181     // DATA MEMBERS:
00182     //
00183     protected:
00184 
00185         int numberOfSteps;
00186 };
00187 
00188 
00189 CLOSE_NAMESPACE_ACADO
00190 
00191 
00192 
00193 #include <acado/nlp_solver/nlp_solver.ipp>
00194 
00195 
00196 #endif  // ACADO_TOOLKIT_NLP_SOLVER_HPP
00197 
00198 /*
00199  *   end of file
00200  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:59:22