Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

Base class for discretizing a DifferentialEquation for use in optimal control algorithms. More...

#include <dynamic_discretization.hpp>

Inheritance diagram for DynamicDiscretization:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue addStage (const DynamicSystem &dynamicSystem_, const Grid &stageIntervals, const IntegratorType &integratorType_=INT_UNKNOWN)=0
 
virtual returnValue addTransition (const Transition &transition_)=0
 
virtual returnValue clear ()=0
 
virtual DynamicDiscretizationclone () const =0
 
virtual returnValue deleteAllSeeds ()
 
 DynamicDiscretization ()
 
 DynamicDiscretization (UserInteraction *_userInteraction)
 
 DynamicDiscretization (const DynamicDiscretization &rhs)
 
virtual returnValue evaluate (OCPiterate &iter)=0
 
virtual returnValue evaluateSensitivities ()=0
 
virtual returnValue evaluateSensitivities (const BlockMatrix &seed, BlockMatrix &hessian)=0
 
virtual returnValue evaluateSensitivitiesLifted ()=0
 
virtual returnValue getBackwardSensitivities (BlockMatrix &D) const
 
virtual returnValue getForwardSensitivities (BlockMatrix &D) const
 
int getNumberOfIntervals () const
 
virtual returnValue getResiduum (BlockMatrix &residuum_) const
 
virtual BooleanType isAffine () const =0
 
DynamicDiscretizationoperator= (const DynamicDiscretization &rhs)
 
virtual returnValue setBackwardSeed (const BlockMatrix &seed)
 
virtual returnValue setForwardSeed (const BlockMatrix &xSeed_, const BlockMatrix &pSeed_, const BlockMatrix &uSeed_, const BlockMatrix &wSeed_)
 
virtual returnValue setUnitBackwardSeed ()
 
virtual returnValue setUnitForwardSeed ()
 
virtual returnValue unfreeze ()=0
 
virtual ~DynamicDiscretization ()
 
- Public Member Functions inherited from AlgorithmicBase
int addLogRecord (LogRecord &_record)
 
returnValue addOption (OptionsName name, int value)
 
returnValue addOption (OptionsName name, double value)
 
returnValue addOption (uint idx, OptionsName name, int value)
 
returnValue addOption (uint idx, OptionsName name, double value)
 
returnValue addOptionsList ()
 
 AlgorithmicBase ()
 
 AlgorithmicBase (UserInteraction *_userInteraction)
 
 AlgorithmicBase (const AlgorithmicBase &rhs)
 
returnValue get (OptionsName name, int &value) const
 
returnValue get (OptionsName name, double &value) const
 
returnValue get (OptionsName name, std::string &value) const
 
returnValue get (uint idx, OptionsName name, int &value) const
 
returnValue get (uint idx, OptionsName name, double &value) const
 
returnValue getAll (LogName _name, MatrixVariablesGrid &values) const
 
returnValue getFirst (LogName _name, DMatrix &firstValue) const
 
returnValue getFirst (LogName _name, VariablesGrid &firstValue) const
 
returnValue getLast (LogName _name, DMatrix &lastValue) const
 
returnValue getLast (LogName _name, VariablesGrid &lastValue) const
 
Options getOptions (uint idx) const
 
BooleanType haveOptionsChanged () const
 
BooleanType haveOptionsChanged (uint idx) const
 
AlgorithmicBaseoperator= (const AlgorithmicBase &rhs)
 
returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue printLogRecord (std::ostream &_stream, int idx, LogPrintMode _mode=PRINT_ITEM_BY_ITEM) const
 
returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue set (OptionsName name, int value)
 
returnValue set (OptionsName name, double value)
 
returnValue set (OptionsName name, const std::string &value)
 
returnValue set (uint idx, OptionsName name, int value)
 
returnValue set (uint idx, OptionsName name, double value)
 
returnValue setAll (LogName _name, const MatrixVariablesGrid &values)
 
returnValue setLast (LogName _name, int lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, double lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DVector &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DMatrix &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const VariablesGrid &lastValue, double time=-INFTY)
 
returnValue setOptions (const Options &arg)
 
returnValue setOptions (uint idx, const Options &arg)
 
virtual ~AlgorithmicBase ()
 

Protected Member Functions

void copy (const DynamicDiscretization &rhs)
 
uint getNumEvaluationPoints () const
 
void initializeVariables ()
 
virtual returnValue setupLogging ()
 
virtual returnValue setupOptions ()
 

Protected Attributes

BlockMatrix bSeed
 
BlockMatrix dBackward
 
BlockMatrix dForward
 
BooleanType freezeTraj
 
int N
 
int na
 
int np
 
int nu
 
int nw
 
int nx
 
PrintLevel printLevel
 
BlockMatrix pSeed
 
VariablesGrid residuum
 
Grid unionGrid
 
BlockMatrix uSeed
 
BlockMatrix wSeed
 
BlockMatrix xSeed
 
- Protected Attributes inherited from AlgorithmicBase
int outputLoggingIdx
 
BooleanType useModuleStandalone
 
UserInteractionuserInteraction
 

Detailed Description

Base class for discretizing a DifferentialEquation for use in optimal control algorithms.

The class DynamicDiscretization serves as a base class for discretizing a DifferentialEquation for use in optimal control algorithms.

Author
Boris Houska, Hans Joachim Ferreau

Definition at line 62 of file dynamic_discretization.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO DynamicDiscretization::DynamicDiscretization ( )

Default constructor.

Definition at line 48 of file dynamic_discretization.cpp.

DynamicDiscretization::DynamicDiscretization ( UserInteraction _userInteraction)

Definition at line 59 of file dynamic_discretization.cpp.

DynamicDiscretization::DynamicDiscretization ( const DynamicDiscretization rhs)

Copy constructor (deep copy).

Definition at line 72 of file dynamic_discretization.cpp.

DynamicDiscretization::~DynamicDiscretization ( )
virtual

Destructor.

Definition at line 79 of file dynamic_discretization.cpp.

Member Function Documentation

virtual returnValue DynamicDiscretization::addStage ( const DynamicSystem dynamicSystem_,
const Grid stageIntervals,
const IntegratorType integratorType_ = INT_UNKNOWN 
)
pure virtual

Set the Differential Equations stage by stage.

Implemented in CollocationMethod, and ShootingMethod.

virtual returnValue DynamicDiscretization::addTransition ( const Transition transition_)
pure virtual

Set the Transition stages.

Implemented in CollocationMethod, and ShootingMethod.

virtual returnValue DynamicDiscretization::clear ( )
pure virtual

Deletes all stages and transitions and resets the DynamicDiscretization.

Implemented in CollocationMethod, and ShootingMethod.

virtual DynamicDiscretization* DynamicDiscretization::clone ( ) const
pure virtual

Clone constructor (deep copy).

Implemented in CollocationMethod, and ShootingMethod.

void DynamicDiscretization::copy ( const DynamicDiscretization rhs)
protected

Definition at line 246 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::deleteAllSeeds ( )
virtual

Deletes all seeds that have been set with the methods above.
This function will also give the corresponding memory free.

Returns
SUCCESSFUL_RETURN
RET_NO_SEED_ALLOCATED

Reimplemented in CollocationMethod, and ShootingMethod.

Definition at line 176 of file dynamic_discretization.cpp.

virtual returnValue DynamicDiscretization::evaluate ( OCPiterate iter)
pure virtual

Evaluates the descretized DifferentialEquation at a specified
VariablesGrid. The results are written into the residuum of the
type VariablesGrid. This routine is for a simple evaluation only.
If sensitivities are needed use one of the routines below
instead.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
or a specific error message form an underlying
discretization instance.

Implemented in CollocationMethod, and ShootingMethod.

virtual returnValue DynamicDiscretization::evaluateSensitivities ( )
pure virtual

Evaluates the sensitivities.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Implemented in ShootingMethod, and CollocationMethod.

virtual returnValue DynamicDiscretization::evaluateSensitivities ( const BlockMatrix seed,
BlockMatrix hessian 
)
pure virtual

Evaluates the sensitivities and the hessian.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Implemented in ShootingMethod, and CollocationMethod.

virtual returnValue DynamicDiscretization::evaluateSensitivitiesLifted ( )
pure virtual

Evaluates the sensitivities.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Implemented in ShootingMethod, and CollocationMethod.

returnValue DynamicDiscretization::getBackwardSensitivities ( BlockMatrix D) const
virtual

Returns the result for the backward sensitivities in BlockMatrix form.

Returns
SUCCESSFUL_RETURN
RET_INPUT_OUT_OF_RANGE the total number of intervals.
Parameters
Dthe result for the forward sensitivi- ties

Definition at line 169 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::getForwardSensitivities ( BlockMatrix D) const
virtual

Returns the result for the forward sensitivities in BlockMatrix form.

Returns
SUCCESSFUL_RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
Dthe result for the forward sensitivi- ties

Definition at line 162 of file dynamic_discretization.cpp.

int DynamicDiscretization::getNumberOfIntervals ( ) const
inline
uint DynamicDiscretization::getNumEvaluationPoints ( ) const
protected

Definition at line 271 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::getResiduum ( BlockMatrix residuum_) const
virtual

Returns the result for the residuum.

Returns
SUCCESSFUL_RETURN
Parameters
residuum_the residuum

Definition at line 144 of file dynamic_discretization.cpp.

void DynamicDiscretization::initializeVariables ( )
protected

Definition at line 234 of file dynamic_discretization.cpp.

virtual BooleanType DynamicDiscretization::isAffine ( ) const
pure virtual

Implemented in ShootingMethod, and CollocationMethod.

DynamicDiscretization & DynamicDiscretization::operator= ( const DynamicDiscretization rhs)

Assignment operator (deep copy).

Definition at line 82 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setBackwardSeed ( const BlockMatrix seed)
virtual

Define a backward seed in form of a block matrix.
Here, the block matrix should have N block columns,
where N is the number of points of the union grid.
The i-th column is associated with the i-th grid
point in the union grid. Note that the directions
can itself be organized in sub-blocks as long as
all dimensions fit together.

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
seedthe seed matrix

Definition at line 125 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setForwardSeed ( const BlockMatrix xSeed_,
const BlockMatrix pSeed_,
const BlockMatrix uSeed_,
const BlockMatrix wSeed_ 
)
virtual

Define a forward seed in form of a block matrix.
Here, the block matrix should have N block rows,
where N is the number of points of the union grid.
The i-th row is associated with the i-th grid
point in the union grid. Note that the direction
can itself be organized in sub-blocks as long as
all dimensions fit together.

Returns
SUCCESFUL RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
xSeed_the seed in x-direction
pSeed_the seed in p-direction
uSeed_the seed in u-direction
wSeed_the seed in w-direction

Definition at line 92 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setUnitBackwardSeed ( )
virtual

Defines the first order backward seed to be
a unit matrix.

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 132 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setUnitForwardSeed ( )
virtual

Defines the first order forward seed to be
the unit-directions matrix.

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 106 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setupLogging ( )
protectedvirtual

Definition at line 215 of file dynamic_discretization.cpp.

returnValue DynamicDiscretization::setupOptions ( )
protectedvirtual

Definition at line 190 of file dynamic_discretization.cpp.

virtual returnValue DynamicDiscretization::unfreeze ( )
pure virtual

Implemented in ShootingMethod, and CollocationMethod.

Member Data Documentation

BlockMatrix DynamicDiscretization::bSeed
protected

the 1st order backward seed

Definition at line 291 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::dBackward
protected

the first order backward derivatives

Definition at line 298 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::dForward
protected

the first order forward derivatives

Definition at line 297 of file dynamic_discretization.hpp.

BooleanType DynamicDiscretization::freezeTraj
protected

whether the trajectory should be frozen

Definition at line 272 of file dynamic_discretization.hpp.

int DynamicDiscretization::N
protected

total number of grid points

Definition at line 270 of file dynamic_discretization.hpp.

int DynamicDiscretization::na
protected

Definition at line 278 of file dynamic_discretization.hpp.

int DynamicDiscretization::np
protected

Definition at line 279 of file dynamic_discretization.hpp.

int DynamicDiscretization::nu
protected

Definition at line 280 of file dynamic_discretization.hpp.

int DynamicDiscretization::nw
protected

Definition at line 281 of file dynamic_discretization.hpp.

int DynamicDiscretization::nx
protected

Definition at line 277 of file dynamic_discretization.hpp.

PrintLevel DynamicDiscretization::printLevel
protected

the print level

Definition at line 271 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::pSeed
protected

the 1st order forward seed in p-direction

Definition at line 287 of file dynamic_discretization.hpp.

VariablesGrid DynamicDiscretization::residuum
protected

the residuum vectors

Definition at line 296 of file dynamic_discretization.hpp.

Grid DynamicDiscretization::unionGrid
protected

the union grids on the stages

Definition at line 269 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::uSeed
protected

the 1st order forward seed in u-direction

Definition at line 288 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::wSeed
protected

the 1st order forward seed in w-direction

Definition at line 289 of file dynamic_discretization.hpp.

BlockMatrix DynamicDiscretization::xSeed
protected

the 1st order forward seed in x-direction

Definition at line 286 of file dynamic_discretization.hpp.


The documentation for this class was generated from the following files:


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