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

Stores and evaluates Mayer terms within optimal control problems. More...

#include <mayer_term.hpp>

Inheritance diagram for MayerTerm:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MayerTerm ()
 Default constructor.
 MayerTerm (const Grid &grid_, const Expression &arg)
 Default constructor.
 MayerTerm (const Grid &grid_, const Function &arg)
 Default constructor.
 MayerTerm (const MayerTerm &rhs)
 Copy constructor (deep copy).
virtual ~MayerTerm ()
 Destructor.
MayerTermoperator= (const MayerTerm &rhs)
 Assignment operator (deep copy).
returnValue init (const Grid &grid_, const Expression &arg)
returnValue evaluate (const OCPiterate &x)
returnValue evaluateSensitivities (BlockMatrix *hessian)
 Evaluates the objective gradient contribution from this term
and computes the corresponding exact hessian if hessian != 0

.
returnValue setGrid (const Grid &grid_)
 Sets the discretization grid.
returnValue init (const OCPiterate &x)
 Initializes the Objective 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 setBackwardSeed (BlockMatrix *seed, int order)
 Define a backward seed in form of a block matrix.
virtual returnValue getObjectiveValue (double &objectiveValue)
 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.
int getNX () const
 Returns the number of differential states
.
int getNXA () const
 Returns the number of algebraic states
.
int getNP () const
 Returns the number of parameters
.
int getNU () const
 Returns the number of controls
.
int getNW () const
 Returns the number of disturbances
.
returnValue getFunction (Function &_function)
 Returns the element's function
.

Protected Member Functions

Grid getGrid () const
 returns the constraint grid

Protected Attributes

Grid grid
 the objective grid
Function fcn
 the function
EvaluationPoint z
 the evaluation point
EvaluationPoint JJ
int * y_index
 index lists
int t_index
 time index
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
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
double obj
 the objective value
BlockMatrix dForward
 the first order forward derivatives
BlockMatrix dBackward
 the first order backward derivatives

Detailed Description

The class MayerTerm allows to manage and evaluate Mayer terms within optimal control problems.

Author:
Boris Houska, Hans Joachim Ferreau

Constructor & Destructor Documentation

MayerTerm::MayerTerm ( const Grid grid_,
const Expression arg 
)

References ObjectiveElement::fcn.

MayerTerm::MayerTerm ( const Grid grid_,
const Function arg 
)

References ObjectiveElement::fcn.

MayerTerm::MayerTerm ( const MayerTerm rhs)
MayerTerm::~MayerTerm ( ) [virtual]

Member Function Documentation

returnValue ObjectiveElement::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, ObjectiveElement::dBackward, RET_INPUT_OUT_OF_RANGE, RET_NOT_IMPLEMENTED_YET, and SUCCESSFUL_RETURN.

Referenced by Objective::getBackwardSensitivities().

returnValue ObjectiveElement::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, ObjectiveElement::dForward, RET_INPUT_OUT_OF_RANGE, RET_NOT_IMPLEMENTED_YET, and SUCCESSFUL_RETURN.

Referenced by Objective::getForwardSensitivities().

returnValue ObjectiveElement::getFunction ( Function _function) [inline, inherited]
Returns:
SUCCESSFUL_RETURN.

References ObjectiveElement::fcn, and SUCCESSFUL_RETURN.

Grid ObjectiveElement::getGrid ( ) const [inline, protected, inherited]
int ObjectiveElement::getNP ( ) const [inline, inherited]
Returns:
The requested number of parameters.

References ObjectiveElement::fcn, and Function::getNP().

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

References ObjectiveElement::fcn, and Function::getNU().

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

References ObjectiveElement::fcn, and Function::getNW().

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

References ObjectiveElement::fcn, and Function::getNX().

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

References ObjectiveElement::fcn, and Function::getNXA().

returnValue ObjectiveElement::getObjectiveValue ( double &  objectiveValue) [virtual, inherited]



Returns:
SUCCESSFUL_RETURN
Parameters:
objectiveValuethe objective value

References ObjectiveElement::obj, and SUCCESSFUL_RETURN.

Referenced by Objective::getObjectiveValue().

BEGIN_NAMESPACE_ACADO returnValue MayerTerm::init ( const Grid grid_,
const Expression arg 
) [inline]
returnValue ObjectiveElement::init ( const OCPiterate x) [inherited]
MayerTerm & MayerTerm::operator= ( const MayerTerm rhs)
returnValue ObjectiveElement::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, ObjectiveElement::bSeed, ObjectiveElement::bSeed2, RET_INPUT_OUT_OF_RANGE, and SUCCESSFUL_RETURN.

Referenced by Objective::setBackwardSeed().

returnValue ObjectiveElement::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, ObjectiveElement::pSeed, ObjectiveElement::pSeed2, RET_INPUT_OUT_OF_RANGE, SUCCESSFUL_RETURN, ObjectiveElement::uSeed, ObjectiveElement::uSeed2, ObjectiveElement::wSeed, ObjectiveElement::wSeed2, ObjectiveElement::xaSeed, ObjectiveElement::xaSeed2, ObjectiveElement::xSeed, and ObjectiveElement::xSeed2.

Referenced by Objective::setForwardSeed().

BEGIN_NAMESPACE_ACADO returnValue ObjectiveElement::setGrid ( const Grid grid_) [inline, inherited]



Returns:
SUCCESSFUL_RETURN

Reimplemented in LSQTerm.

References ObjectiveElement::grid, and SUCCESSFUL_RETURN.

Referenced by Objective::addLSQEndTerm().


Member Data Documentation

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

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