Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Stores and evaluates the constraints of optimal control problems. More...

#include <constraint.hpp>

Inheritance diagram for Constraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

returnValue add (const double lb_, const Expression &arg, const double ub_)
returnValue add (const DVector lb_, const Expression &arg, const double ub_)
returnValue add (const double lb_, const Expression &arg, const DVector ub_)
returnValue add (const DVector lb_, const Expression &arg, const DVector ub_)
returnValue add (const int index_, const double lb_, const Expression &arg, const double ub_)
returnValue add (const double lb_, const Expression &arg1, const Expression &arg2, const double ub_)
returnValue add (const double lb_, const Expression *arguments, const double ub_)
returnValue add (const uint &endOfStage_, const DifferentialEquation &dae)
returnValue add (const ConstraintComponent &component)
returnValue add (const int index_, const ConstraintComponent &component)
 Constraint ()
 Constraint (const Constraint &rhs)
returnValue evaluate (const OCPiterate &iter)
returnValue evaluateSensitivities ()
returnValue evaluateSensitivities (const BlockMatrix &seed, BlockMatrix &hessian)
virtual returnValue getBackwardSensitivities (BlockMatrix &D, int order)
int getBlockDim (int idx) const
DVector getBlockDims () const
virtual returnValue getBoundResiduum (BlockMatrix &lowerRes, BlockMatrix &upperRes)
virtual returnValue getConstraintResiduum (BlockMatrix &lowerRes, BlockMatrix &upperRes)
virtual returnValue getForwardSensitivities (BlockMatrix &D, int order)
GridgetGrid ()
int getNC ()
int getNP () const
int getNU () const
int getNumberOfBlocks () const
int getNW () const
int getNX () const
int getNXA () const
returnValue getPathConstraints (Function &function_, DMatrix &lb_, DMatrix &ub_) const
returnValue getPointConstraint (const unsigned index, Function &function_, DMatrix &lb_, DMatrix &ub_) const
returnValue init (const Grid &grid_, const int &numberOfStages_=1)
BooleanType isAffine () const
BooleanType isBoxConstraint () const
BooleanType isEmpty () const
Constraintoperator= (const Constraint &rhs)
virtual returnValue setBackwardSeed (BlockMatrix *seed, int order)
virtual returnValue setForwardSeed (BlockMatrix *xSeed_, BlockMatrix *xaSeed_, BlockMatrix *pSeed_, BlockMatrix *uSeed_, BlockMatrix *wSeed_, int order)
virtual returnValue setUnitBackwardSeed ()
virtual returnValue setUnitForwardSeed ()
virtual ~Constraint ()

Protected Member Functions

returnValue add (const int index_, const double lb_, Expression *arg, const double ub_)
returnValue add (const DVector lb_, Expression *arg, const DVector ub_)
void deleteAll ()
virtual returnValue getBounds (const OCPiterate &iter)

Protected Attributes

AlgebraicConsistencyConstraintalgebraic_consistency_constraint
BoundaryConstraintboundary_constraint
CoupledPathConstraintcoupled_path_constraint
PathConstraintpath_constraint
PointConstraint ** point_constraints

Friends

class ExportNLPSolver
class OptimizationAlgorithm
class OptimizationAlgorithmBase
class RealTimeAlgorithm
class TESTExport

Detailed Description

Stores and evaluates the constraints of optimal control problems.

The class Constraint allows to manage and evaluate the constraints of optimal control problems. It consists of a list of all different types of constraints that are derived from the base class ConstraintElement.

Author:
Boris Houska, Hans Joachim Ferreau

Definition at line 60 of file constraint.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 49 of file constraint.cpp.

Copy constructor (deep copy).

Definition at line 61 of file constraint.cpp.

Constraint::~Constraint ( ) [virtual]

Destructor.

Definition at line 95 of file constraint.cpp.


Member Function Documentation

returnValue Constraint::add ( const double  lb_,
const Expression arg,
const double  ub_ 
)

< adds a constraint of the form lb_ <= arg <= ub with constant lower
and upper bounds.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT adds a constraint of the form lb_ <= arg <= ub where the
lower bound is varying over the grid points.
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 194 of file constraint.cpp.

returnValue Constraint::add ( const DVector  lb_,
const Expression arg,
const double  ub_ 
)

adds a constraint of the form lb_ <= arg <= ub where the
upper bound is varying over the grid points.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 207 of file constraint.cpp.

returnValue Constraint::add ( const double  lb_,
const Expression arg,
const DVector  ub_ 
)

adds a constraint of the form lb_ <= arg <= ub where the
upper and the lower bound are varying over the grid points.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 216 of file constraint.cpp.

returnValue Constraint::add ( const DVector  lb_,
const Expression arg,
const DVector  ub_ 
)

Definition at line 225 of file constraint.cpp.

returnValue Constraint::add ( const int  index_,
const double  lb_,
const Expression arg,
const double  ub_ 
)

< adds a constraint of the form lb_ <= arg <= ub with constant lower
and upper bounds.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 1182 of file constraint.cpp.

returnValue Constraint::add ( const double  lb_,
const Expression arg1,
const Expression arg2,
const double  ub_ 
)

< adds a constraint of the form lb_ <= arg1(0) + arg_2(T) <= ub with
constant lower and upper bounds.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 1200 of file constraint.cpp.

returnValue Constraint::add ( const double  lb_,
const Expression arguments,
const double  ub_ 
)

< adds a constraint of the form lb_ <= sum_i arg_i(t_i) <= ub with
constant lower and upper bounds.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 264 of file constraint.cpp.

returnValue Constraint::add ( const uint endOfStage_,
const DifferentialEquation dae 
)

Adds an algebraic consistency constraint for a specified stage. This
method is rather for internal use, as the optimization routine will
care about the transformation of DAE optimization problems adding
consistency constraints, if necessary. Note that the number of stages
has to be specified in advance within the constructor of the constraint.
Actually, the "endOfStage" does at the same specify the start of
the next stage. Thus the DAE's should be added in the correct order.

Returns:
SUCCESSFUL_RETURN RET_INDEX_OUT_OF_BOUNDS
Parameters:
endOfStage_end of the stage
daethe DAE itself

Definition at line 274 of file constraint.cpp.

< adds a (continuous) contraint.

Returns:
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT adds a (discrete) contraint.
SUCCESSFUL_RETURN RET_INFEASIBLE_CONSTRAINT

Definition at line 281 of file constraint.cpp.

returnValue Constraint::add ( const int  index_,
const ConstraintComponent component 
)

Definition at line 337 of file constraint.cpp.

returnValue Constraint::add ( const int  index_,
const double  lb_,
Expression arg,
const double  ub_ 
) [protected]

CAUTION: This function is protected and stictly for internal use. Note that e.g. the expression pointer will be deleted when using this function.

returnValue Constraint::add ( const DVector  lb_,
Expression arg,
const DVector  ub_ 
) [protected]

CAUTION: This function is protected and strictly for internal use. Note that e.g. the expression pointer will be deleted when using this function.

void Constraint::deleteAll ( ) [protected]

Protected version of the destructor.

Reimplemented from BoxConstraint.

Definition at line 101 of file constraint.cpp.

Definition at line 399 of file constraint.cpp.

Definition at line 475 of file constraint.cpp.

Return the sensitivities and the hessian term contribution of the constraint
components. The seed should be a (1 x getNumberOfBlocks())-matrix, which are
is in an optimization context the multiplier associated with the constraint.

Returns:
SUCCESSFUL_RETURN

Definition at line 532 of file constraint.cpp.

returnValue Constraint::getBackwardSensitivities ( BlockMatrix D,
int  order 
) [virtual]

Returns the result for the backward sensitivities in BlockMatrix form.

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

Definition at line 1051 of file constraint.cpp.

int Constraint::getBlockDim ( int  idx) const [inline]

returns the dimension of the requested sub-block

DVector Constraint::getBlockDims ( ) const [inline]

returns the dimension of the requested sub-block

returnValue Constraint::getBoundResiduum ( BlockMatrix lowerRes,
BlockMatrix upperRes 
) [virtual]

Returns the result for the residuum of the bounds.

Returns:
SUCCESSFUL_RETURN
Parameters:
lowerResthe lower residuum
upperResthe upper residuum

Definition at line 910 of file constraint.cpp.

returnValue Constraint::getBounds ( const OCPiterate iter) [protected, virtual]

Writes a special copy of the bounds that is needed within the OptimizationAlgorithm into the optimization variables.

Reimplemented from BoxConstraint.

Definition at line 1211 of file constraint.cpp.

returnValue Constraint::getConstraintResiduum ( BlockMatrix lowerRes,
BlockMatrix upperRes 
) [virtual]

Returns the result for the residuum of the constraints.

Returns:
SUCCESSFUL_RETURN
Parameters:
lowerResthe lower residuum
upperResthe upper residuum

Definition at line 797 of file constraint.cpp.

returnValue Constraint::getForwardSensitivities ( BlockMatrix D,
int  order 
) [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
orderthe order

Definition at line 941 of file constraint.cpp.

Grid& Constraint::getGrid ( ) [inline]

returns the constraint grid

int Constraint::getNC ( ) [inline]

returns the number of constraints

int Constraint::getNP ( ) const [inline]

Returns the number of parameters

Returns:
The requested number of parameters.
int Constraint::getNU ( ) const [inline]

Returns the number of controls

Returns:
The requested number of controls.
int Constraint::getNumberOfBlocks ( ) const [inline]

returns the number of constraint blocks

int Constraint::getNW ( ) const [inline]

Returns the number of disturbances

Returns:
The requested number of disturbances.
int Constraint::getNX ( ) const [inline]

Returns the number of differential states

Returns:
The requested number of differential states.
int Constraint::getNXA ( ) const [inline]

Returns the number of algebraic states

Returns:
The requested number of algebraic states.
returnValue Constraint::getPathConstraints ( Function function_,
DMatrix lb_,
DMatrix ub_ 
) const

Definition at line 1228 of file constraint.cpp.

returnValue Constraint::getPointConstraint ( const unsigned  index,
Function function_,
DMatrix lb_,
DMatrix ub_ 
) const

Definition at line 1233 of file constraint.cpp.

returnValue Constraint::init ( const Grid grid_,
const int &  numberOfStages_ = 1 
)

Initializes the constraint.

Parameters:
grid_the discretization grid.
numberOfStages_the number of stages (default = 1).
Returns:
SUCCESSFUL_RETURN

Definition at line 129 of file constraint.cpp.

BooleanType Constraint::isAffine ( ) const [inline]

returns whether the constraint is affine.

returns whether object only comprises box constraints.

Returns whether or not the constraint is empty.

Returns:
BT_TRUE if no constraint is specified yet.
BT_FALSE otherwise.

Definition at line 1164 of file constraint.cpp.

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

Assignment operator (deep copy).

Definition at line 151 of file constraint.cpp.

returnValue Constraint::setBackwardSeed ( BlockMatrix seed,
int  order 
) [virtual]

Define a backward seed in form of a block matrix.

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

Definition at line 719 of file constraint.cpp.

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

Define a forward seed in form of a block matrix.

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.

Definition at line 599 of file constraint.cpp.

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

Returns:
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 725 of file constraint.cpp.

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

Returns:
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 662 of file constraint.cpp.


Friends And Related Function Documentation

friend class ExportNLPSolver [friend]

Definition at line 66 of file constraint.hpp.

friend class OptimizationAlgorithm [friend]

Definition at line 63 of file constraint.hpp.

friend class OptimizationAlgorithmBase [friend]

Definition at line 62 of file constraint.hpp.

friend class RealTimeAlgorithm [friend]

Definition at line 64 of file constraint.hpp.

friend class TESTExport [friend]

Definition at line 65 of file constraint.hpp.


Member Data Documentation

Definition at line 465 of file constraint.hpp.

Definition at line 462 of file constraint.hpp.

Definition at line 463 of file constraint.hpp.

Definition at line 464 of file constraint.hpp.

Definition at line 466 of file constraint.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:01:37