ocp.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 
00032 #ifndef ACADO_TOOLKIT_OCP_HPP
00033 #define ACADO_TOOLKIT_OCP_HPP
00034 
00035 #include <acado/ocp/multi_objective_functionality.hpp>
00036 #include <acado/ocp/model_container.hpp>
00037 
00038 BEGIN_NAMESPACE_ACADO
00039 
00040 class Grid;
00041 class Objective;
00042 class Constraint;
00043 
00089 class OCP: public MultiObjectiveFunctionality, public ModelContainer
00090 {
00091 public:
00092 
00095         OCP(    const double &tStart_ = 0.0,  
00096                         const double &tEnd_   = 1.0,  
00097                         const int    &N_      = 20     );
00098 
00099 
00102         OCP(    const double &tStart_,                  
00103                         const double &tEnd_,                    
00104                         const DVector& _numSteps                 );
00105 
00106 
00110         OCP(    const double    &tStart_,  
00111                         const Parameter &tEnd_,    
00112                         const int       &N_ = 20    );
00113 
00114 
00117         OCP(    const Grid &grid_   );
00118 
00119 
00121         virtual ~OCP( );
00122 
00126         returnValue minimizeMayerTerm( const Expression& arg );
00127 
00128 
00134         returnValue minimizeMayerTerm( const int &multiObjectiveIdx,  const Expression& arg );
00135 
00136 
00144         returnValue maximizeMayerTerm( const Expression& arg );
00145 
00146 
00150         returnValue minimizeLagrangeTerm( const Expression& arg );
00151 
00152 
00156         returnValue maximizeLagrangeTerm( const Expression& arg );
00157 
00176         returnValue minimizeLSQ(        const DMatrix   &S,   
00177                                                                 const Function  &h,   
00178                                                                 const DVector   &r     );
00179 
00180         returnValue minimizeLSQ(        const Function &h,   
00181                                                                 const DVector  &r     );
00182 
00183         returnValue minimizeLSQ(        const Function &h     );
00184 
00185         returnValue minimizeLSQ(        const MatrixVariablesGrid &S,   
00186                                                                 const Function            &h,   
00187                                                                 const VariablesGrid       &r     );
00188 
00189         returnValue minimizeLSQ(        const DMatrix       &S,   
00190                                                                 const Function      &h,   
00191                                                                 const VariablesGrid &r     );
00192 
00193         returnValue minimizeLSQ(        const Function      &h, 
00194                                                                 const VariablesGrid &r   );
00195 
00196         returnValue minimizeLSQ(        const MatrixVariablesGrid &S,   
00197                                                                 const Function            &h,   
00198                                                                 const char*        rFilename     );
00199 
00200         returnValue minimizeLSQ(        const DMatrix        &S,
00201                                                                 const Function      &h, 
00202                                                                 const char*  rFilename   );
00203 
00204         returnValue minimizeLSQ(        const Function      &h,   
00205                                                                 const char*  rFilename     );
00206 
00208         returnValue minimizeLSQ(        const DMatrix& S,       
00209                                                                 const Function& h        );
00210 
00213         returnValue minimizeLSQ(        const BMatrix& S,       
00214                                                                 const Function& h        );
00215 
00217         returnValue minimizeLSQ(        const DMatrix& S,               
00218                                                                 const std::string& h     );
00219 
00222         returnValue minimizeLSQ(        const BMatrix& S,               
00223                                                                 const std::string& h     );
00224 
00242         returnValue minimizeLSQEndTerm( const DMatrix  & S,     
00243                                                                         const Function & m,     
00244                                                                         const DVector  & r       );
00245 
00246         returnValue minimizeLSQEndTerm( const Function & m,     
00247                                                                         const DVector  & r       );
00248 
00250         returnValue minimizeLSQEndTerm( const DMatrix& S,               
00251                                                                         const Function& m                );
00252 
00254         returnValue minimizeLSQEndTerm( const DMatrix& S,               
00255                                                                         const std::string& m     );
00256 
00259         returnValue minimizeLSQEndTerm( const BMatrix& S,               
00260                                                                         const Function& m                );
00261 
00264         returnValue minimizeLSQEndTerm( const BMatrix& S,               
00265                                                                         const std::string& m     );
00266 
00274         returnValue minimizeLSQLinearTerms(     const DVector& Slx,     
00275                                                                                 const DVector& Slu       );
00276 
00279         returnValue minimizeLSQLinearTerms(     const BVector& Slx,     
00280                                                                                 const BVector& Slu       );
00290         returnValue subjectTo( const DifferentialEquation& differentialEquation_ );
00291 
00292 
00297         returnValue subjectTo( const ConstraintComponent& component );
00298 
00299 
00304         returnValue subjectTo( int index_, const ConstraintComponent& component );
00305 
00306 
00322         returnValue subjectTo(  const double lb_,
00323                                                         const Expression& arg1,
00324                                                         const Expression& arg2,
00325                                                         const double ub_ );
00326 
00327 
00343         returnValue subjectTo( const double lb_, const Expression *arguments, const double ub_ );
00344 
00357         returnValue subjectTo( const DVector& _lb, const Expression& _expr, const DVector& _ub );
00358 
00359         returnValue subjectTo( int _index, const DVector& _lb, const Expression& _expr, const DVector& _ub );
00360 
00367         BooleanType hasObjective           () const;
00368         BooleanType hasConstraint          () const;
00369 
00370         returnValue getGrid                ( Grid&      grid_                               ) const;
00371         returnValue getObjective           ( Objective& objective_                          ) const;
00372         returnValue getObjective           ( const int &multiObjectiveIdx, Expression **arg ) const;
00373 
00374         returnValue getConstraint( Constraint& constraint_ ) const;
00375 
00376         returnValue setObjective ( const Objective & objective_  );
00377         returnValue setConstraint( const Constraint& constraint_ );
00378         returnValue setNumberIntegrationSteps( const uint numSteps );
00379 
00384         virtual BooleanType hasEquidistantGrid( ) const;
00385 
00386         double getStartTime ( ) const;
00387         double getEndTime( ) const;
00390 protected:
00391 
00392         void setupGrid( double tStart, double tEnd, int N );
00393         void setupGrid( const DVector& times );
00394 
00396         std::tr1::shared_ptr<Grid> grid;
00398         std::tr1::shared_ptr<Objective> objective;
00400         std::tr1::shared_ptr<Constraint> constraint;
00401 };
00402 
00403 CLOSE_NAMESPACE_ACADO
00404 
00405 #endif  // ACADO_TOOLKIT_OCP_HPP


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:38:15