Stores and evaluates the constraints of optimal control problems. More...
#include <constraint.hpp>
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 Member Functions inherited from BoxConstraint | |
void | deleteAll () |
returnValue | evaluateBounds (const OCPiterate &iter) |
Protected Attributes | |
AlgebraicConsistencyConstraint * | algebraic_consistency_constraint |
BoundaryConstraint * | boundary_constraint |
CoupledPathConstraint * | coupled_path_constraint |
PathConstraint * | path_constraint |
PointConstraint ** | point_constraints |
Protected Attributes inherited from BoxConstraint | |
DVector ** | blb |
DVector ** | bub |
Grid | grid |
int * | index |
int | nb |
DMatrix * | residuumPL |
DMatrix * | residuumPU |
DMatrix * | residuumUL |
DMatrix * | residuumUU |
DMatrix * | residuumWL |
DMatrix * | residuumWU |
DMatrix * | residuumXAL |
DMatrix * | residuumXAU |
DMatrix * | residuumXL |
DMatrix * | residuumXU |
VariableType * | var |
Friends | |
class | ExportNLPSolver |
class | OptimizationAlgorithm |
class | OptimizationAlgorithmBase |
class | RealTimeAlgorithm |
class | TESTExport |
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.
BEGIN_NAMESPACE_ACADO Constraint::Constraint | ( | ) |
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.
|
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.
|
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.
|
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.
|
protected |
Protected version of the destructor.
Definition at line 101 of file constraint.cpp.
returnValue Constraint::evaluate | ( | const OCPiterate & | iter | ) |
Definition at line 399 of file constraint.cpp.
returnValue Constraint::evaluateSensitivities | ( | ) |
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.
|
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.
|
inline |
returns the dimension of the requested sub-block
|
inline |
returns the dimension of the requested sub-block
|
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.
|
protectedvirtual |
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.
|
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.
|
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.
|
inline |
returns the constraint grid
|
inline |
returns the number of constraints
|
inline |
Returns the number of parameters
|
inline |
Returns the number of controls
|
inline |
returns the number of constraint blocks
|
inline |
Returns the number of disturbances
|
inline |
Returns the number of differential states
|
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.
|
inline |
returns whether the constraint is affine.
|
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.
|
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.
|
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.
|
virtual |
Defines the first order backward seed to be
a unit matrix.
Definition at line 725 of file constraint.cpp.
|
virtual |
Defines the first order forward seed to be
the unit-directions matrix.
Definition at line 662 of file constraint.cpp.
|
friend |
Definition at line 66 of file constraint.hpp.
|
friend |
Definition at line 63 of file constraint.hpp.
|
friend |
Definition at line 62 of file constraint.hpp.
|
friend |
Definition at line 64 of file constraint.hpp.
|
friend |
Definition at line 65 of file constraint.hpp.
|
protected |
Definition at line 465 of file constraint.hpp.
|
protected |
Definition at line 462 of file constraint.hpp.
|
protected |
Definition at line 463 of file constraint.hpp.
|
protected |
Definition at line 464 of file constraint.hpp.
|
protected |
Definition at line 466 of file constraint.hpp.