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
00027
00034 #ifndef ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP
00035 #define ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP
00036
00037
00038 #include <acado/utils/acado_utils.hpp>
00039 #include <acado/user_interaction/user_interaction.hpp>
00040 #include <acado/dynamic_discretization/shooting_method.hpp>
00041
00042
00043 BEGIN_NAMESPACE_ACADO
00044
00045
00056 class IntegrationAlgorithm : public UserInteraction
00057 {
00058
00059
00060
00061 public:
00062
00064 IntegrationAlgorithm( );
00065
00067 IntegrationAlgorithm( const IntegrationAlgorithm& rhs );
00068
00070 virtual ~IntegrationAlgorithm( );
00071
00073 IntegrationAlgorithm& operator=( const IntegrationAlgorithm& rhs );
00074
00075
00077 virtual returnValue addStage( const DynamicSystem &dynamicSystem_,
00078 const Grid &stageIntervals,
00079 const IntegratorType &integratorType_ = INT_UNKNOWN );
00080
00082 virtual returnValue addTransition( const Transition& transition_ );
00083
00084
00086 virtual returnValue clear();
00087
00088
00100 returnValue evaluate( VariablesGrid *x ,
00101 VariablesGrid *xa,
00102 VariablesGrid *p ,
00103 VariablesGrid *u ,
00104 VariablesGrid *w
00105 );
00106
00107 returnValue evaluate( OCPiterate& _iter );
00108
00109 returnValue integrate( VariablesGrid *x ,
00110 VariablesGrid *xa,
00111 VariablesGrid *p ,
00112 VariablesGrid *u ,
00113 VariablesGrid *w
00114 );
00115
00116
00126 returnValue integrate( double t0 ,
00127 double tend ,
00128 const DVector &x0 ,
00129 const DVector &xa = emptyVector ,
00130 const DVector &p = emptyVector ,
00131 const DVector &u = emptyVector ,
00132 const DVector &w = emptyVector
00133 );
00134
00148 returnValue integrate( const Grid &t ,
00149 const DVector &x0 ,
00150 const DVector &xa = emptyVector ,
00151 const DVector &p = emptyVector ,
00152 const DVector &u = emptyVector ,
00153 const DVector &w = emptyVector
00154 );
00155
00156
00168 returnValue setForwardSeed( const BlockMatrix &xSeed_,
00169 const BlockMatrix &pSeed_ = emptyBlockMatrix,
00170 const BlockMatrix &uSeed_ = emptyBlockMatrix,
00171 const BlockMatrix &wSeed_ = emptyBlockMatrix );
00172
00177 returnValue setForwardSeed( const DVector &xSeed ,
00178 const DVector &pSeed = emptyVector ,
00179 const DVector &uSeed = emptyVector ,
00180 const DVector &wSeed = emptyVector );
00181
00182
00189 returnValue setUnitForwardSeed();
00190
00191
00192
00204 returnValue setBackwardSeed( const BlockMatrix &seed );
00205
00210 returnValue setBackwardSeed( const DVector &seed );
00211
00218 returnValue setUnitBackwardSeed();
00219
00220
00221
00227 returnValue deleteAllSeeds();
00228
00229
00235 returnValue evaluateSensitivities( );
00236
00242 returnValue integrateSensitivities( );
00243
00249 returnValue evaluateSensitivities( const BlockMatrix &seed,
00250 BlockMatrix &hessian
00251 );
00252
00258 returnValue integrateSensitivities( const BlockMatrix &seed,
00259 BlockMatrix &hessian
00260 );
00261
00262
00263 returnValue unfreeze( );
00264
00265
00266 BooleanType isAffine( ) const;
00267
00268
00276 returnValue getX( DVector& xEnd
00277 ) const;
00278
00286 returnValue getXA( DVector& xaEnd
00287 ) const;
00288
00298 returnValue getX( VariablesGrid& X
00299 ) const;
00300
00301
00311 returnValue getXA( VariablesGrid& XA
00312 ) const;
00313
00314
00320 returnValue getForwardSensitivities( BlockMatrix &D
00323 ) const;
00324
00332 returnValue getForwardSensitivities( DVector &Dx
00333 ) const;
00334
00335
00341 returnValue getBackwardSensitivities( BlockMatrix &D
00344 ) const;
00345
00356 returnValue getBackwardSensitivities( DVector &Dx_x0,
00357 DVector &Dx_p = emptyVector,
00358 DVector &Dx_u = emptyVector,
00359 DVector &Dx_w = emptyVector
00360 ) const;
00361
00362
00363
00364
00365
00366
00367
00368 protected:
00369
00370 virtual returnValue setupOptions( );
00371 virtual returnValue setupLogging( );
00372
00373
00374
00375
00376
00377
00378 protected:
00379
00380 ShootingMethod* integrationMethod;
00381 OCPiterate iter;
00382 };
00383
00384
00385 CLOSE_NAMESPACE_ACADO
00386
00387
00388
00389
00390
00391 #endif // ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP
00392
00393