Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
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
00174
00175 protected:
00176 virtual returnValue setupOptions( );
00177 virtual returnValue setupLogging( );
00178
00179
00180
00181
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
00200