User-interface to integrate a DynamicSystem, possibly over multiple stages. More...
#include <integration_algorithm.hpp>
Protected Attributes | |
ShootingMethod * | integrationMethod |
OCPiterate | iter |
Protected Attributes inherited from UserInteraction | |
BlockStatus | status |
Protected Attributes inherited from Options | |
std::vector< OptionsList > | lists |
Protected Attributes inherited from Logging | |
std::vector< LogRecord > | logCollection |
int | logIdx |
Protected Attributes inherited from Plotting | |
PlotCollection | plotCollection |
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.
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.
|
virtual |
Destructor.
Definition at line 71 of file integration_algorithm.cpp.
|
virtual |
Set the Differential Equations stage by stage.
Definition at line 98 of file integration_algorithm.cpp.
|
virtual |
Set the Transition stages.
Definition at line 106 of file integration_algorithm.cpp.
|
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.
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.
x | differential states |
xa | algebraic states |
p | parameters |
u | controls |
w | disturbances |
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.
Definition at line 256 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::evaluateSensitivities | ( | const BlockMatrix & | seed, |
BlockMatrix & | hessian | ||
) |
Evaluates the sensitivities and the hessian.
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.
D | the 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.
Dx_x0 | backward sensitivities w.r.t. the initial states |
Dx_p | backward sensitivities w.r.t. the parameters |
Dx_u | backward sensitivities w.r.t. the controls |
Dx_w | backward sensitivities w.r.t. the disturbance |
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.
D | the 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.
Dx | the result for the forward sensitivities. |
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.
xEnd | the result for the states at time tend. |
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.
X | the differential states on the grid. |
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.
xaEnd | the result for the algebraic states at time tend. |
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.
XA | the algebraic states on the grid. |
Definition at line 323 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::integrate | ( | VariablesGrid * | x, |
VariablesGrid * | xa, | ||
VariablesGrid * | p, | ||
VariablesGrid * | u, | ||
VariablesGrid * | w | ||
) |
x | differential states |
xa | algebraic states |
p | parameters |
u | controls |
w | disturbances |
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.
t0 | the start time |
tend | the end time |
x0 | the initial state |
xa | the initial algebraic state |
p | the parameters |
u | the controls |
w | the 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.
t | the grid [t0,tend] |
x0 | the initial state |
xa | the initial algebraic state |
p | the parameters |
u | the controls |
w | the disturbance |
Definition at line 172 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::integrateSensitivities | ( | ) |
Evaluates the sensitivities.
Definition at line 262 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::integrateSensitivities | ( | const BlockMatrix & | seed, |
BlockMatrix & | hessian | ||
) |
Evaluates the sensitivities and the hessian.
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.
seed | the seed matrix |
Definition at line 224 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::setBackwardSeed | ( | const DVector & | seed | ) |
Define a backward seed
seed | the 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.
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.
xSeed | the seed w.r.t states |
pSeed | the seed w.r.t parameters |
uSeed | the seed w.r.t controls |
wSeed | the 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.
Definition at line 242 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::setUnitForwardSeed | ( | ) |
Defines the first order forward seed to be
the unit-directions matrix.
Definition at line 218 of file integration_algorithm.cpp.
|
protectedvirtual |
Prototype member function for setting-up the logging information at initialization of derived classes.
Reimplemented from Logging.
Definition at line 451 of file integration_algorithm.cpp.
|
protectedvirtual |
Prototype member function for setting-up the option list(s) at initialization of derived classes.
Reimplemented from Options.
Definition at line 422 of file integration_algorithm.cpp.
returnValue IntegrationAlgorithm::unfreeze | ( | ) |
Definition at line 281 of file integration_algorithm.cpp.
|
protected |
Definition at line 380 of file integration_algorithm.hpp.
|
protected |
Definition at line 381 of file integration_algorithm.hpp.