Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

User-interface to integrate a DynamicSystem, possibly over multiple stages. More...

#include <integration_algorithm.hpp>

Inheritance diagram for IntegrationAlgorithm:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue addStage (const DynamicSystem &dynamicSystem_, const Grid &stageIntervals, const IntegratorType &integratorType_=INT_UNKNOWN)
 
virtual returnValue addTransition (const Transition &transition_)
 
virtual returnValue clear ()
 
returnValue deleteAllSeeds ()
 
returnValue evaluate (VariablesGrid *x, VariablesGrid *xa, VariablesGrid *p, VariablesGrid *u, VariablesGrid *w)
 
returnValue evaluate (OCPiterate &_iter)
 
returnValue evaluateSensitivities ()
 
returnValue evaluateSensitivities (const BlockMatrix &seed, BlockMatrix &hessian)
 
returnValue getBackwardSensitivities (BlockMatrix &D) const
 
returnValue getBackwardSensitivities (DVector &Dx_x0, DVector &Dx_p=emptyVector, DVector &Dx_u=emptyVector, DVector &Dx_w=emptyVector) const
 
returnValue getForwardSensitivities (BlockMatrix &D) const
 
returnValue getForwardSensitivities (DVector &Dx) const
 
returnValue getX (DVector &xEnd) const
 
returnValue getX (VariablesGrid &X) const
 
returnValue getXA (DVector &xaEnd) const
 
returnValue getXA (VariablesGrid &XA) const
 
returnValue integrate (VariablesGrid *x, VariablesGrid *xa, VariablesGrid *p, VariablesGrid *u, VariablesGrid *w)
 
returnValue integrate (double t0, double tend, const DVector &x0, const DVector &xa=emptyVector, const DVector &p=emptyVector, const DVector &u=emptyVector, const DVector &w=emptyVector)
 
returnValue integrate (const Grid &t, const DVector &x0, const DVector &xa=emptyVector, const DVector &p=emptyVector, const DVector &u=emptyVector, const DVector &w=emptyVector)
 
returnValue integrateSensitivities ()
 
returnValue integrateSensitivities (const BlockMatrix &seed, BlockMatrix &hessian)
 
 IntegrationAlgorithm ()
 
 IntegrationAlgorithm (const IntegrationAlgorithm &rhs)
 
BooleanType isAffine () const
 
IntegrationAlgorithmoperator= (const IntegrationAlgorithm &rhs)
 
returnValue setBackwardSeed (const BlockMatrix &seed)
 
returnValue setBackwardSeed (const DVector &seed)
 
returnValue setForwardSeed (const BlockMatrix &xSeed_, const BlockMatrix &pSeed_=emptyBlockMatrix, const BlockMatrix &uSeed_=emptyBlockMatrix, const BlockMatrix &wSeed_=emptyBlockMatrix)
 
returnValue setForwardSeed (const DVector &xSeed, const DVector &pSeed=emptyVector, const DVector &uSeed=emptyVector, const DVector &wSeed=emptyVector)
 
returnValue setUnitBackwardSeed ()
 
returnValue setUnitForwardSeed ()
 
returnValue unfreeze ()
 
virtual ~IntegrationAlgorithm ()
 
- Public Member Functions inherited from UserInteraction
virtual int addPlotWindow (PlotWindow &_window)
 
virtual int operator<< (PlotWindow &_window)
 
virtual int operator<< (LogRecord &_record)
 
UserInteractionoperator= (const UserInteraction &rhs)
 
 UserInteraction ()
 
 UserInteraction (const UserInteraction &rhs)
 
virtual ~UserInteraction ()
 
- Public Member Functions inherited from Options
returnValue addOptionsList ()
 
returnValue ensureConsistency ()
 
returnValue ensureConsistency ()
 
returnValue get (OptionsName name, int &value) const
 
returnValue get (OptionsName name, double &value) const
 
returnValue get (OptionsName name, std::string &value) const
 
returnValue get (uint idx, OptionsName name, int &value) const
 
returnValue get (uint idx, OptionsName name, double &value) const
 
returnValue get (uint idx, OptionsName name, std::string &value) const
 
uint getNumOptionsLists () const
 
Options getOptions (uint idx) const
 
Optionsoperator= (const Options &rhs)
 
Optionsoperator= (const Options &rhs)
 
 Options ()
 
 Options ()
 
 Options (const Options &rhs)
 
 Options (const Options &rhs)
 
 Options ()
 
 Options (const OptionsList &_optionsList)
 
returnValue print () const
 
returnValue print () const
 
returnValue printOptionsList () const
 
returnValue printOptionsList (uint idx) const
 
returnValue set (OptionsName name, int value)
 
returnValue set (OptionsName name, double value)
 
returnValue set (OptionsName name, const std::string &value)
 
returnValue set (uint idx, OptionsName name, int value)
 
returnValue set (uint idx, OptionsName name, double value)
 
returnValue set (uint idx, OptionsName name, const std::string &value)
 
returnValue setOptions (const Options &arg)
 
returnValue setOptions (uint idx, const Options &arg)
 
returnValue setToDefault ()
 
returnValue setToDefault ()
 
returnValue setToFast ()
 
returnValue setToFast ()
 
returnValue setToMPC ()
 
returnValue setToReliable ()
 
returnValue setToReliable ()
 
 ~Options ()
 
 ~Options ()
 
virtual ~Options ()
 
- Public Member Functions inherited from Logging
int addLogRecord (LogRecord &record)
 
returnValue getAll (LogName _name, MatrixVariablesGrid &values) const
 
returnValue getFirst (LogName _name, DMatrix &firstValue) const
 
returnValue getFirst (LogName _name, VariablesGrid &firstValue) const
 
returnValue getLast (LogName _name, DMatrix &lastValue) const
 
returnValue getLast (LogName _name, VariablesGrid &lastValue) const
 
returnValue getLogRecord (LogRecord &_record) const
 
uint getNumLogRecords () const
 
 Logging ()
 
int operator<< (LogRecord &record)
 
returnValue printLoggingInfo () const
 
returnValue printNumDoubles () const
 
returnValue setAll (LogName _name, const MatrixVariablesGrid &values)
 
returnValue setLast (LogName _name, const DMatrix &value, double time=-INFTY)
 
returnValue setLast (LogName _name, VariablesGrid &value, double time=-INFTY)
 
returnValue updateLogRecord (LogRecord &_record) const
 
virtual ~Logging ()
 
- Public Member Functions inherited from Plotting
int addPlotWindow (PlotWindow &_window)
 
uint getNumPlotWindows () const
 
returnValue getPlotWindow (uint idx, PlotWindow &_window) const
 
returnValue getPlotWindow (PlotWindow &_window) const
 
int operator<< (PlotWindow &_window)
 
Plottingoperator= (const Plotting &rhs)
 
virtual returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
 Plotting ()
 
 Plotting (const Plotting &rhs)
 
virtual returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
virtual ~Plotting ()
 

Protected Member Functions

virtual returnValue setupLogging ()
 
virtual returnValue setupOptions ()
 
- Protected Member Functions inherited from UserInteraction
virtual returnValue getPlotDataFromMemberLoggings (PlotWindow &_window) const
 
BlockStatus getStatus () const
 
returnValue setStatus (BlockStatus _status)
 
- Protected Member Functions inherited from Options
returnValue addOption (OptionsName name, int value)
 
returnValue addOption (OptionsName name, double value)
 
returnValue addOption (OptionsName name, const std::string &value)
 
returnValue addOption (uint idx, OptionsName name, int value)
 
returnValue addOption (uint idx, OptionsName name, double value)
 
returnValue addOption (uint idx, OptionsName name, const std::string &value)
 
returnValue clearOptionsList ()
 
returnValue copy (const Options &rhs)
 
returnValue copy (const Options &rhs)
 
returnValue declareOptionsUnchanged ()
 
returnValue declareOptionsUnchanged (uint idx)
 
BooleanType haveOptionsChanged () const
 
BooleanType haveOptionsChanged (uint idx) const
 

Protected Attributes

ShootingMethodintegrationMethod
 
OCPiterate iter
 
- Protected Attributes inherited from UserInteraction
BlockStatus status
 
- Protected Attributes inherited from Options
std::vector< OptionsListlists
 
- Protected Attributes inherited from Logging
std::vector< LogRecordlogCollection
 
int logIdx
 
- Protected Attributes inherited from Plotting
PlotCollection plotCollection
 

Additional Inherited Members

- Public Attributes inherited from Options
real_t boundRelaxation
 
real_t boundTolerance
 
int dropBoundPriority
 
int_t dropBoundPriority
 
int dropEqConPriority
 
int_t dropEqConPriority
 
int dropIneqConPriority
 
int_t dropIneqConPriority
 
int enableCholeskyRefactorisation
 
int_t enableCholeskyRefactorisation
 
int enableDriftCorrection
 
int_t enableDriftCorrection
 
BooleanType enableDropInfeasibles
 
BooleanType enableEqualities
 
BooleanType enableFarBounds
 
BooleanType enableFlippingBounds
 
BooleanType enableFullLITests
 
BooleanType enableInertiaCorrection
 
BooleanType enableNZCTests
 
BooleanType enableRamping
 
BooleanType enableRegularisation
 
real_t epsDen
 
real_t epsFlipping
 
real_t epsIterRef
 
real_t epsLITests
 
real_t epsNum
 
real_t epsNZCTests
 
real_t epsRegularisation
 
real_t finalRamping
 
real_t growFarBounds
 
real_t initialFarBounds
 
real_t initialRamping
 
SubjectToStatus initialStatusBounds
 
real_t maxDualJump
 
real_t maxPrimalJump
 
int numRefinementSteps
 
int_t numRefinementSteps
 
int numRegularisationSteps
 
int_t numRegularisationSteps
 
PrintLevel printLevel
 
real_t rcondSMin
 
real_t terminationTolerance
 

Detailed Description

User-interface to integrate a DynamicSystem, possibly over multiple stages.

The class IntegrationAlgorithm serves as a user-interface to integrate a DynamicSystem, possibly over multiple stages.

\author Boris Houska, Hans Joachim Ferreau

Definition at line 56 of file integration_algorithm.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO IntegrationAlgorithm::IntegrationAlgorithm ( )

Default constructor.

Definition at line 48 of file integration_algorithm.cpp.

IntegrationAlgorithm::IntegrationAlgorithm ( const IntegrationAlgorithm rhs)

Copy constructor (deep copy).

Definition at line 59 of file integration_algorithm.cpp.

IntegrationAlgorithm::~IntegrationAlgorithm ( )
virtual

Destructor.

Definition at line 71 of file integration_algorithm.cpp.

Member Function Documentation

returnValue IntegrationAlgorithm::addStage ( const DynamicSystem dynamicSystem_,
const Grid stageIntervals,
const IntegratorType integratorType_ = INT_UNKNOWN 
)
virtual

Set the Differential Equations stage by stage.

Definition at line 98 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::addTransition ( const Transition transition_)
virtual

Set the Transition stages.

Definition at line 106 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::clear ( )
virtual

Deletes all stages and transitions and resets the DynamicDiscretization.

Definition at line 112 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::deleteAllSeeds ( )

Deletes all seeds that have been set with the methods above.
This function will also give the corresponding memory free.

Returns
SUCCESSFUL_RETURN
RET_NO_SEED_ALLOCATED

Definition at line 249 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::evaluate ( VariablesGrid x,
VariablesGrid xa,
VariablesGrid p,
VariablesGrid u,
VariablesGrid w 
)

Evaluates the descretized DifferentialEquation at a specified
VariablesGrid. The results are written into the residuum of the
type VariablesGrid. This routine is for a simple evaluation only.
If sensitivities are needed use one of the routines below
instead.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
or a specific error message form an underlying
discretization instance.
Parameters
xdifferential states
xaalgebraic states
pparameters
ucontrols
wdisturbances

Definition at line 119 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::evaluate ( OCPiterate _iter)

Definition at line 130 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::evaluateSensitivities ( )

Evaluates the sensitivities.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Definition at line 256 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::evaluateSensitivities ( const BlockMatrix seed,
BlockMatrix hessian 
)

Evaluates the sensitivities and the hessian.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Definition at line 268 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getBackwardSensitivities ( BlockMatrix D) const

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

Definition at line 365 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getBackwardSensitivities ( DVector Dx_x0,
DVector Dx_p = emptyVector,
DVector Dx_u = emptyVector,
DVector Dx_w = emptyVector 
) const

Returns the result for the backward sensitivities at the time tend.

Parameters
Dx_x0backward sensitivities w.r.t. the initial states
Dx_pbackward sensitivities w.r.t. the parameters
Dx_ubackward sensitivities w.r.t. the controls
Dx_wbackward sensitivities w.r.t. the disturbance

Returns
SUCCESSFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 372 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getForwardSensitivities ( BlockMatrix D) const

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

Definition at line 335 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getForwardSensitivities ( DVector Dx) const

Returns the result for the forward sensitivities at the time tend.

Parameters
Dxthe result for the forward sensitivities.

Returns
SUCCESSFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 342 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getX ( DVector xEnd) const

Returns the result for the differential states at time tend.

Parameters
xEndthe result for the states at time tend.
Returns
SUCCESSFUL_RETURN

Definition at line 293 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getX ( VariablesGrid X) const

Returns the requested output on the specified grid. Note
that the output X will be evaluated based on polynomial
interpolation depending on the order of the integrator.

Parameters
Xthe differential states on the grid.

Returns
SUCCESSFUL_RETURN
RET_TRAJECTORY_NOT_FROZEN

Definition at line 313 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getXA ( DVector xaEnd) const

Returns the result for the algebraic states at time tend.

Parameters
xaEndthe result for the algebraic states at time tend.
Returns
SUCCESSFUL_RETURN

Definition at line 303 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::getXA ( VariablesGrid XA) const

Returns the requested output on the specified grid. Note
that the output X will be evaluated based on polynomial
interpolation depending on the order of the integrator.

Parameters
XAthe algebraic states on the grid.

Returns
SUCCESSFUL_RETURN
RET_TRAJECTORY_NOT_FROZEN

Definition at line 323 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::integrate ( VariablesGrid x,
VariablesGrid xa,
VariablesGrid p,
VariablesGrid u,
VariablesGrid w 
)
Parameters
xdifferential states
xaalgebraic states
pparameters
ucontrols
wdisturbances

Definition at line 140 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::integrate ( double  t0,
double  tend,
const DVector x0,
const DVector xa = emptyVector,
const DVector p = emptyVector,
const DVector u = emptyVector,
const DVector w = emptyVector 
)

Starts the integration of the right hand side at time t0.
If neither the maximum number of allowed iteration is
exceeded nor any other error occurs the functions stops the
integration at time tend.

Returns
SUCCESFUL_RETURN or
a error message that depends on the specific
integration routine. (cf. the corresponding header
file that implements the integration routine)
Parameters
t0the start time
tendthe end time
x0the initial state
xathe initial algebraic state
pthe parameters
uthe controls
wthe disturbance

Definition at line 151 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::integrate ( const Grid t,
const DVector x0,
const DVector xa = emptyVector,
const DVector p = emptyVector,
const DVector u = emptyVector,
const DVector w = emptyVector 
)

Starts the integration of the right hand side at time t0.
If neither the maximum number of allowed iteration is
exceeded nor any other error occurs the functions stops the
integration at time tend.
In addition, results at intermediate grid points can be
stored. Note that these grid points are for storage only and
have nothing to do the integrator steps.

Returns
SUCCESFUL_RETURN or
a error message that depends on the specific
integration routine. (cf. the corresponding header
file that implements the integration routine)
Parameters
tthe grid [t0,tend]
x0the initial state
xathe initial algebraic state
pthe parameters
uthe controls
wthe disturbance

Definition at line 172 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::integrateSensitivities ( )

Evaluates the sensitivities.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Definition at line 262 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::integrateSensitivities ( const BlockMatrix seed,
BlockMatrix hessian 
)

Evaluates the sensitivities and the hessian.

Returns
SUCCESSFUL_RETURN
RET_NOT_FROZEN

Definition at line 274 of file integration_algorithm.cpp.

BooleanType IntegrationAlgorithm::isAffine ( ) const

Definition at line 287 of file integration_algorithm.cpp.

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

Assignment operator (deep copy).

Definition at line 78 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setBackwardSeed ( const BlockMatrix seed)

Define a backward seed in form of a block matrix.
Here, the block matrix should have N block columns,
where N is the number of points of the union grid.
The i-th column is associated with the i-th grid
point in the union grid. Note that the directions
can itself be organized in sub-blocks as long as
all dimensions fit together.

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
seedthe seed matrix

Definition at line 224 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setBackwardSeed ( const DVector seed)

Define a backward seed

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
seedthe backward seed

Definition at line 231 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setForwardSeed ( const BlockMatrix xSeed_,
const BlockMatrix pSeed_ = emptyBlockMatrix,
const BlockMatrix uSeed_ = emptyBlockMatrix,
const BlockMatrix wSeed_ = emptyBlockMatrix 
)

Define a forward seed in form of a block matrix.
Here, the block matrix should have N block rows,
where N is the number of points of the union grid.
The i-th row is associated with the i-th grid
point in the union grid. Note that the direction
can itself be organized in sub-blocks as long as
all dimensions fit together.

Returns
SUCCESFUL RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
xSeed_the seed in x-direction
pSeed_the seed in p-direction
uSeed_the seed in u-direction
wSeed_the seed in w-direction

Definition at line 193 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setForwardSeed ( const DVector xSeed,
const DVector pSeed = emptyVector,
const DVector uSeed = emptyVector,
const DVector wSeed = emptyVector 
)

Define a forward seed matrix.

Returns
SUCCESFUL RETURN
RET_INPUT_OUT_OF_RANGE
Parameters
xSeedthe seed w.r.t states
pSeedthe seed w.r.t parameters
uSeedthe seed w.r.t controls
wSeedthe seed w.r.t disturbances

Definition at line 203 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setUnitBackwardSeed ( )

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

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 242 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setUnitForwardSeed ( )

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

Returns
SUCCESFUL_RETURN
RET_INPUT_OUT_OF_RANGE

Definition at line 218 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setupLogging ( )
protectedvirtual

Prototype member function for setting-up the logging information at initialization of derived classes.

Returns
SUCCESSFUL_RETURN

Reimplemented from Logging.

Definition at line 451 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::setupOptions ( )
protectedvirtual

Prototype member function for setting-up the option list(s) at initialization of derived classes.

Returns
SUCCESSFUL_RETURN

Reimplemented from Options.

Definition at line 422 of file integration_algorithm.cpp.

returnValue IntegrationAlgorithm::unfreeze ( )

Definition at line 281 of file integration_algorithm.cpp.

Member Data Documentation

ShootingMethod* IntegrationAlgorithm::integrationMethod
protected

Definition at line 380 of file integration_algorithm.hpp.

OCPiterate IntegrationAlgorithm::iter
protected

Definition at line 381 of file integration_algorithm.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:24