Stores and evaluates the constraints of optimal control problems. More...
#include <constraint.hpp>
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.
Definition at line 60 of file constraint.hpp.
Default constructor.
Definition at line 49 of file constraint.cpp.
Constraint::Constraint | ( | const Constraint & | rhs | ) |
Copy constructor (deep copy).
Definition at line 61 of file constraint.cpp.
Constraint::~Constraint | ( | ) | [virtual] |
Destructor.
Definition at line 95 of file constraint.cpp.
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.
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.
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.
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.
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.
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.
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.
endOfStage_ | end of the stage |
dae | the DAE itself |
Definition at line 274 of file constraint.cpp.
returnValue Constraint::add | ( | const ConstraintComponent & | component | ) |
< adds a (continuous) contraint.
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.
returnValue Constraint::evaluate | ( | const OCPiterate & | iter | ) |
Definition at line 399 of file constraint.cpp.
Definition at line 475 of file constraint.cpp.
returnValue Constraint::evaluateSensitivities | ( | const BlockMatrix & | seed, |
BlockMatrix & | hessian | ||
) |
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.
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.
D | the result for the forward sensitivi- ties |
order | the 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.
lowerRes | the lower residuum |
upperRes | the 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.
lowerRes | the lower residuum |
upperRes | the 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.
D | the result for the forward sensitivi- ties |
order | the 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
int Constraint::getNU | ( | ) | const [inline] |
Returns the number of controls
int Constraint::getNumberOfBlocks | ( | ) | const [inline] |
returns the number of constraint blocks
int Constraint::getNW | ( | ) | const [inline] |
Returns the number of disturbances
int Constraint::getNX | ( | ) | const [inline] |
Returns the number of differential states
int Constraint::getNXA | ( | ) | const [inline] |
Returns the 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.
grid_ | the discretization grid. |
numberOfStages_ | the number of stages (default = 1). |
Definition at line 129 of file constraint.cpp.
BooleanType Constraint::isAffine | ( | ) | const [inline] |
returns whether the constraint is affine.
BooleanType Constraint::isBoxConstraint | ( | ) | const [inline] |
returns whether object only comprises box constraints.
BooleanType Constraint::isEmpty | ( | ) | const |
Returns whether or not the constraint is empty.
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.
seed | the seed matrix |
order | the 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.
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 |
order | the order of the seed. |
Definition at line 599 of file constraint.cpp.
returnValue Constraint::setUnitBackwardSeed | ( | ) | [virtual] |
Defines the first order backward seed to be
a unit matrix.
Definition at line 725 of file constraint.cpp.
returnValue Constraint::setUnitForwardSeed | ( | ) | [virtual] |
Defines the first order forward seed to be
the unit-directions matrix.
Definition at line 662 of file constraint.cpp.
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.
Definition at line 465 of file constraint.hpp.
BoundaryConstraint* Constraint::boundary_constraint [protected] |
Definition at line 462 of file constraint.hpp.
CoupledPathConstraint* Constraint::coupled_path_constraint [protected] |
Definition at line 463 of file constraint.hpp.
PathConstraint* Constraint::path_constraint [protected] |
Definition at line 464 of file constraint.hpp.
PointConstraint** Constraint::point_constraints [protected] |
Definition at line 466 of file constraint.hpp.