Deals with algebraic consistency constraints within optimal control problems. More...
#include <algebraic_consistency_constraint.hpp>
Public Member Functions | |
returnValue | add (const uint &endOfStage_, const DifferentialEquation &dae) |
AlgebraicConsistencyConstraint () | |
AlgebraicConsistencyConstraint (const Grid &grid_, const uint &numberOfStages) | |
AlgebraicConsistencyConstraint (const AlgebraicConsistencyConstraint &rhs) | |
returnValue | evaluate (const OCPiterate &iter) |
returnValue | evaluateSensitivities () |
returnValue | evaluateSensitivities (int &count, const BlockMatrix &seed, BlockMatrix &hessian) |
int | getDim (const int &idx_) |
int | getNC () const |
AlgebraicConsistencyConstraint & | operator= (const AlgebraicConsistencyConstraint &rhs) |
virtual | ~AlgebraicConsistencyConstraint () |
Protected Member Functions | |
returnValue | computeForwardSensitivityBlock (int offset1, int offset2, int offset3, int stageIdx, DMatrix *seed) |
virtual returnValue | initializeEvaluationPoints (const OCPiterate &iter) |
Protected Attributes | |
int * | breakPoints |
int | counter |
int * | numberOfAlgebraicStates |
int * | numberOfDifferentialStates |
int | numberOfStages |
Deals with algebraic consistency constraints within optimal control problems.
The class AlgebraicConsistencyConstraint has been introduced in order to deal with algebraic consistency constraints. Usually, the user does not get in touch with this class, as algebraic consistency constraints should automatically be introduced by the optimization routine. It is possible to add several DAE right-hand sides which will be evaluated on a grid (usually, the multiple shooting ot collocation grid) depending on the model stage number. In the easiest case, i.e. for one stage, the evaluation routine will return the algebraic residuum of the DAE at a given point. The differentiation of the AlgebraicConsistencyConstraint will return the derivatives in form of a structured block matrix, which is typically sparse.
Definition at line 65 of file algebraic_consistency_constraint.hpp.
Default constructor.
Definition at line 46 of file algebraic_consistency_constraint.cpp.
AlgebraicConsistencyConstraint::AlgebraicConsistencyConstraint | ( | const Grid & | grid_, |
const uint & | numberOfStages | ||
) |
Default constructor.
grid_ | union grid of the constraint |
numberOfStages | number of model stages |
Definition at line 57 of file algebraic_consistency_constraint.cpp.
AlgebraicConsistencyConstraint::AlgebraicConsistencyConstraint | ( | const AlgebraicConsistencyConstraint & | rhs | ) |
Copy constructor (deep copy).
Definition at line 68 of file algebraic_consistency_constraint.cpp.
Destructor.
Definition at line 95 of file algebraic_consistency_constraint.cpp.
returnValue AlgebraicConsistencyConstraint::add | ( | const uint & | endOfStage_, |
const DifferentialEquation & | dae | ||
) | [inline] |
Adds a consistency constraint for a specified stage.
endOfStage_ | end of the stage |
dae | the DAE itself |
returnValue AlgebraicConsistencyConstraint::computeForwardSensitivityBlock | ( | int | offset1, |
int | offset2, | ||
int | offset3, | ||
int | stageIdx, | ||
DMatrix * | seed | ||
) | [inline, protected] |
only for internal use (routine which computes a part of the block matrix needed for forward differentiation.)
returnValue AlgebraicConsistencyConstraint::evaluate | ( | const OCPiterate & | iter | ) |
Evaluates all components in this constraint and stores the
residuum.
Definition at line 150 of file algebraic_consistency_constraint.cpp.
Evaluates the sensitivities of all components in this
constraint. Note that the seed can be defined via the base
class ConstraintElement.
Definition at line 189 of file algebraic_consistency_constraint.cpp.
returnValue AlgebraicConsistencyConstraint::evaluateSensitivities | ( | int & | count, |
const BlockMatrix & | seed, | ||
BlockMatrix & | hessian | ||
) |
Evaluates the sensitivities and Hessian.
Definition at line 327 of file algebraic_consistency_constraint.cpp.
int AlgebraicConsistencyConstraint::getDim | ( | const int & | idx_ | ) | [inline] |
returns the dimensions of the idx-th block
int AlgebraicConsistencyConstraint::getNC | ( | ) | const [inline] |
returns the number of constraints
returnValue AlgebraicConsistencyConstraint::initializeEvaluationPoints | ( | const OCPiterate & | iter | ) | [protected, virtual] |
Reimplemented from ConstraintElement.
Definition at line 614 of file algebraic_consistency_constraint.cpp.
AlgebraicConsistencyConstraint & AlgebraicConsistencyConstraint::operator= | ( | const AlgebraicConsistencyConstraint & | rhs | ) |
Assignment operator (deep copy).
Definition at line 108 of file algebraic_consistency_constraint.cpp.
int* AlgebraicConsistencyConstraint::breakPoints [protected] |
Definition at line 164 of file algebraic_consistency_constraint.hpp.
int AlgebraicConsistencyConstraint::counter [protected] |
Definition at line 161 of file algebraic_consistency_constraint.hpp.
int* AlgebraicConsistencyConstraint::numberOfAlgebraicStates [protected] |
Definition at line 163 of file algebraic_consistency_constraint.hpp.
int* AlgebraicConsistencyConstraint::numberOfDifferentialStates [protected] |
Definition at line 162 of file algebraic_consistency_constraint.hpp.
int AlgebraicConsistencyConstraint::numberOfStages [protected] |
Definition at line 160 of file algebraic_consistency_constraint.hpp.