ACADO Toolkit  1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
Public Member Functions | Protected Member Functions | Protected Attributes

Stores and evaluates path constraints within optimal control problems. More...

#include <path_constraint.hpp>

Inheritance diagram for PathConstraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PathConstraint ()
 Default constructor.
 PathConstraint (const Grid &grid_)
 Default constructor.
 PathConstraint (const PathConstraint &rhs)
 Copy constructor (deep copy).
virtual ~PathConstraint ()
 Destructor.
PathConstraintoperator= (const PathConstraint &rhs)
 Assignment operator (deep copy).
returnValue add (const Vector lb_, const Expression &arg, const Vector ub_)
 Adds a path-constraint component.
returnValue evaluate (const OCPiterate &iter)
 Evaluates all components in this constraint and stores the
residuum.
returnValue evaluateSensitivities ()
 Evaluates the sensitivities of all components in this
constraint.
returnValue evaluateSensitivities (int &count, const BlockMatrix &seed, BlockMatrix &hessian)
 Evaluates the sensitivities and Hessian.
int getNC () const
 returns the number of constraints
int getDim (const int &idx_)
 returns the dimension of a specified block of the constraints
BooleanType isBoxConstraint () const
returnValue init (const OCPiterate &iter)
 Initializes the Constraint Element: The dimensions and
index lists.
virtual returnValue setForwardSeed (BlockMatrix *xSeed_, BlockMatrix *xaSeed_, BlockMatrix *pSeed_, BlockMatrix *uSeed_, BlockMatrix *wSeed_, int order)
 Define a forward seed in form of a block matrix.
virtual returnValue setUnitForwardSeed ()
 Defines the first order forward seed to be
the unit-directions matrix.
virtual returnValue setBackwardSeed (BlockMatrix *seed, int order)
 Define a backward seed in form of a block matrix.
virtual returnValue getResiduum (BlockMatrix &lower_residuum, BlockMatrix &upper_residuum)
 Returns the result for the residuum.
virtual returnValue getForwardSensitivities (BlockMatrix *D, int order)
 Returns the result for the forward sensitivities in BlockMatrix form.
virtual returnValue getBackwardSensitivities (BlockMatrix *D, int order)
 Returns the result for the backward sensitivities in BlockMatrix form.
GridgetGrid ()
 returns the constraint grid
int getNX () const
 Returns the number of differential states
.
int getNXA () const
 Returns the number of algebraic states
.
int getNU () const
 Returns the number of controls
.
int getNP () const
 Returns the number of parameters
.
int getNW () const
 Returns the number of disturbances
.
BooleanType isAffine () const
 returns whether the constraint element is affine.
returnValue get (Function &function_, Matrix &lb_, Matrix &ub_)

Protected Member Functions

virtual returnValue initializeEvaluationPoints (const OCPiterate &iter)

Protected Attributes

Grid grid
 the constraint grid
Functionfcn
 the functions
double ** lb
 lower bounds
double ** ub
 upper bounds
EvaluationPointz
 the evaluation points
EvaluationPointJJ
int ** y_index
 index lists
int * t_index
 time indices
int nx
 number of diff.
int na
 number of alg.
int nu
 number of controls
int np
 number of parameters
int nw
 number of disturbances
int ny
 := nx+na+nu+np+nw
int nFcn
 number of functions
int nB
 number of bounds
BlockMatrixxSeed
 the 1st order forward seed in x-direction
BlockMatrixxaSeed
 the 1st order forward seed in x-direction
BlockMatrixpSeed
 the 1st order forward seed in p-direction
BlockMatrixuSeed
 the 1st order forward seed in u-direction
BlockMatrixwSeed
 the 1st order forward seed in w-direction
BlockMatrixbSeed
 the 1st order backward seed
BlockMatrixxSeed2
 the 2nd order forward seed in x-direction
BlockMatrixxaSeed2
 the 2nd order forward seed in x-direction
BlockMatrixpSeed2
 the 2nd order forward seed in p-direction
BlockMatrixuSeed2
 the 2nd order forward seed in u-direction
BlockMatrixwSeed2
 the 2nd order forward seed in w-direction
BlockMatrixbSeed2
 the 2nd order backward seed
BlockMatrix residuumL
 the residuum vectors
BlockMatrix residuumU
 the residuum vectors
BlockMatrix dForward
 the first order forward derivatives
BlockMatrix dBackward
 the first order backward derivatives
CondensingType condType
 the condensing type

Detailed Description

The class PathConstraint allows to manage and evaluate constraints along the whole horizon within optimal control problems. Note that the path constraints need to be decoupled on each control interval, otherwise the class CouplePathConstraint has to be used.

Author:
Boris Houska, Hans Joachim Ferreau

Constructor & Destructor Documentation


Member Function Documentation

returnValue PathConstraint::add ( const Vector  lb_,
const Expression arg,
const Vector  ub_ 
) [inline]
returnValue PathConstraint::evaluateSensitivities ( int &  count,
const BlockMatrix seed,
BlockMatrix hessian 
)
returnValue ConstraintElement::get ( Function function_,
Matrix lb_,
Matrix ub_ 
) [inherited]
returnValue ConstraintElement::getBackwardSensitivities ( BlockMatrix D,
int  order 
) [virtual, inherited]



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

References ACADOERROR, ACADOWARNING, ASSERT, ConstraintElement::dBackward, RET_INPUT_OUT_OF_RANGE, RET_NOT_IMPLEMENTED_YET, and SUCCESSFUL_RETURN.

Referenced by Constraint::getBackwardSensitivities().

int PathConstraint::getDim ( const int &  idx_) [inline]
returnValue ConstraintElement::getForwardSensitivities ( BlockMatrix D,
int  order 
) [virtual, inherited]



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

References ACADOERROR, ACADOWARNING, ASSERT, ConstraintElement::dForward, RET_INPUT_OUT_OF_RANGE, RET_NOT_IMPLEMENTED_YET, and SUCCESSFUL_RETURN.

Referenced by Constraint::getForwardSensitivities().

int ConstraintElement::getNP ( ) const [inline, inherited]
Returns:
The requested number of parameters.

References acadoMax(), ConstraintElement::fcn, and ConstraintElement::nFcn.

int ConstraintElement::getNU ( ) const [inline, inherited]
Returns:
The requested number of controls.

References acadoMax(), ConstraintElement::fcn, and ConstraintElement::nFcn.

int ConstraintElement::getNW ( ) const [inline, inherited]
Returns:
The requested number of disturbances.

References acadoMax(), ConstraintElement::fcn, and ConstraintElement::nFcn.

int ConstraintElement::getNX ( ) const [inline, inherited]
Returns:
The requested number of differential states.

References acadoMax(), ConstraintElement::fcn, and ConstraintElement::nFcn.

int ConstraintElement::getNXA ( ) const [inline, inherited]
Returns:
The requested number of algebraic states.

References acadoMax(), ConstraintElement::fcn, and ConstraintElement::nFcn.

returnValue ConstraintElement::getResiduum ( BlockMatrix lower_residuum,
BlockMatrix upper_residuum 
) [virtual, inherited]



Returns:
SUCCESSFUL_RETURN
Parameters:
lower_residuumthe lower residuum
upper_residuumthe upper residuum

References ConstraintElement::residuumL, ConstraintElement::residuumU, and SUCCESSFUL_RETURN.

Referenced by Constraint::getConstraintResiduum().

returnValue ConstraintElement::init ( const OCPiterate iter) [inherited]
returnValue ConstraintElement::initializeEvaluationPoints ( const OCPiterate iter) [protected, virtual, inherited]
BooleanType ConstraintElement::isAffine ( ) const [inline, inherited]
PathConstraint & PathConstraint::operator= ( const PathConstraint rhs)
returnValue ConstraintElement::setBackwardSeed ( BlockMatrix seed,
int  order 
) [virtual, inherited]



Returns:
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE
Parameters:
seedthe seed matrix
orderthe order of the seed.

References ACADOWARNING, ConstraintElement::bSeed, ConstraintElement::bSeed2, RET_INPUT_OUT_OF_RANGE, and SUCCESSFUL_RETURN.

Referenced by Constraint::setUnitBackwardSeed().

returnValue ConstraintElement::setForwardSeed ( BlockMatrix xSeed_,
BlockMatrix xaSeed_,
BlockMatrix pSeed_,
BlockMatrix uSeed_,
BlockMatrix wSeed_,
int  order 
) [virtual, inherited]



Returns:
SUCCESFUL RETURN
RET_INPUT_OUT_OF_RANGE
Parameters:
xSeed_the seed in x -direction
xaSeed_the seed in xa-direction
pSeed_the seed in p -direction
uSeed_the seed in u -direction
wSeed_the seed in w -direction
orderthe order of the seed.

References ACADOWARNING, ConstraintElement::pSeed, ConstraintElement::pSeed2, RET_INPUT_OUT_OF_RANGE, SUCCESSFUL_RETURN, ConstraintElement::uSeed, ConstraintElement::uSeed2, ConstraintElement::wSeed, ConstraintElement::wSeed2, ConstraintElement::xaSeed, ConstraintElement::xaSeed2, ConstraintElement::xSeed, and ConstraintElement::xSeed2.

Referenced by Constraint::setForwardSeed(), and ConstraintElement::setUnitForwardSeed().


Member Data Documentation

BlockMatrix* ConstraintElement::bSeed [protected, inherited]
BlockMatrix* ConstraintElement::bSeed2 [protected, inherited]
BlockMatrix ConstraintElement::dBackward [protected, inherited]
BlockMatrix ConstraintElement::dForward [protected, inherited]
Function* ConstraintElement::fcn [protected, inherited]
Grid ConstraintElement::grid [protected, inherited]
EvaluationPoint* ConstraintElement::JJ [protected, inherited]
double** ConstraintElement::lb [protected, inherited]
int ConstraintElement::na [protected, inherited]
int ConstraintElement::nB [protected, inherited]
int ConstraintElement::nFcn [protected, inherited]
int ConstraintElement::np [protected, inherited]
int ConstraintElement::nu [protected, inherited]
int ConstraintElement::nw [protected, inherited]
int ConstraintElement::nx [protected, inherited]
int ConstraintElement::ny [protected, inherited]
BlockMatrix* ConstraintElement::pSeed [protected, inherited]
BlockMatrix* ConstraintElement::pSeed2 [protected, inherited]
BlockMatrix ConstraintElement::residuumL [protected, inherited]
BlockMatrix ConstraintElement::residuumU [protected, inherited]
int* ConstraintElement::t_index [protected, inherited]
double** ConstraintElement::ub [protected, inherited]
BlockMatrix* ConstraintElement::uSeed [protected, inherited]
BlockMatrix* ConstraintElement::uSeed2 [protected, inherited]
BlockMatrix* ConstraintElement::wSeed [protected, inherited]
BlockMatrix* ConstraintElement::wSeed2 [protected, inherited]
BlockMatrix* ConstraintElement::xaSeed [protected, inherited]
BlockMatrix* ConstraintElement::xaSeed2 [protected, inherited]
BlockMatrix* ConstraintElement::xSeed [protected, inherited]
BlockMatrix* ConstraintElement::xSeed2 [protected, inherited]
int** ConstraintElement::y_index [protected, inherited]
EvaluationPoint* ConstraintElement::z [protected, inherited]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines