Allows to export a tailored integrator for fast model predictive control. More...
#include <integrator_export.hpp>
Allows to export a tailored integrator for fast model predictive control.
The class IntegratorExport allows to export a tailored integrator for fast model predictive control.
Definition at line 57 of file integrator_export.hpp.
BEGIN_NAMESPACE_ACADO IntegratorExport::IntegratorExport | ( | UserInteraction * | _userInteraction = 0 , |
const std::string & | _commonHeaderName = "" |
||
) |
Default constructor.
[in] | _userInteraction | Pointer to corresponding user interface. |
[in] | _commonHeaderName | Name of common header file to be included. |
Definition at line 45 of file integrator_export.cpp.
IntegratorExport::IntegratorExport | ( | const IntegratorExport & | arg | ) |
Copy constructor (deep copy).
[in] | arg | Right-hand side object. |
Definition at line 66 of file integrator_export.cpp.
IntegratorExport::~IntegratorExport | ( | ) | [virtual] |
Destructor.
Definition at line 83 of file integrator_export.cpp.
returnValue IntegratorExport::clear | ( | ) | [protected, virtual] |
Frees internal dynamic memory to yield an empty function.
Definition at line 618 of file integrator_export.cpp.
returnValue IntegratorExport::copy | ( | const IntegratorExport & | arg | ) | [protected, virtual] |
Copies all class members from given object.
[in] | arg | Right-hand side object. |
Definition at line 603 of file integrator_export.cpp.
bool IntegratorExport::equidistantControlGrid | ( | ) | const [virtual] |
Returns whether the grid is equidistant.
Definition at line 661 of file integrator_export.cpp.
DMatrix IntegratorExport::expandOutputMatrix | ( | const DMatrix & | A3 | ) | [protected] |
virtual ExportVariable IntegratorExport::getAuxVariable | ( | ) | const [protected, pure virtual] |
Returns the largest global export variable.
Implemented in ImplicitRungeKuttaExport, ForwardIRKExport, ExplicitRungeKuttaExport, DiscreteTimeExport, and ThreeSweepsERKExport.
virtual returnValue IntegratorExport::getCode | ( | ExportStatementBlock & | code | ) | [pure virtual] |
Exports source code of the auto-generated integrator into the given directory.
[in] | code | Code block containing the auto-generated integrator. |
Implements ExportAlgorithm.
Implemented in ImplicitRungeKuttaExport, DiscreteTimeExport, ExplicitRungeKuttaExport, RungeKuttaExport, ForwardIRKExport, ThreeSweepsERKExport, and AdjointERKExport.
virtual returnValue IntegratorExport::getDataDeclarations | ( | ExportStatementBlock & | declarations, |
ExportStruct | dataStruct = ACADO_ANY |
||
) | const [pure virtual] |
Adds all data declarations of the auto-generated integrator to given list of declarations.
[in] | declarations | List of declarations. |
Implements ExportAlgorithm.
Implemented in ImplicitRungeKuttaExport, DiscreteTimeExport, ExplicitRungeKuttaExport, RungeKuttaExport, NARXExport, ThreeSweepsERKExport, AdjointERKExport, and ForwardIRKExport.
uint IntegratorExport::getDimOUTPUT | ( | uint | index | ) | const |
Definition at line 691 of file integrator_export.cpp.
virtual returnValue IntegratorExport::getFunctionDeclarations | ( | ExportStatementBlock & | declarations | ) | const [pure virtual] |
Adds all function (forward) declarations of the auto-generated integrator to given list of declarations.
[in] | declarations | List of declarations. |
Implements ExportAlgorithm.
Implemented in ImplicitRungeKuttaExport, DiscreteTimeExport, ExplicitRungeKuttaExport, RungeKuttaExport, and ForwardIRKExport.
returnValue IntegratorExport::getGrid | ( | Grid & | grid_ | ) | const [virtual] |
Returns the grid of the integrator.
Definition at line 634 of file integrator_export.cpp.
uint IntegratorExport::getIntegrationInterval | ( | double | time | ) | [protected] |
Get the index of the integration interval, corresponding a certain time.
[in] | time | The time. |
Definition at line 624 of file integrator_export.cpp.
const std::string IntegratorExport::getNameDiffsOUTPUT | ( | uint | index | ) | const |
Definition at line 705 of file integrator_export.cpp.
const std::string IntegratorExport::getNameDiffsRHS | ( | ) | const |
Definition at line 701 of file integrator_export.cpp.
const std::string IntegratorExport::getNameFullRHS | ( | ) | const [virtual] |
Definition at line 670 of file integrator_export.cpp.
const std::string IntegratorExport::getNameOUTPUT | ( | uint | index | ) | const |
Definition at line 687 of file integrator_export.cpp.
const std::string IntegratorExport::getNameOutputDiffs | ( | ) | const |
Definition at line 683 of file integrator_export.cpp.
const std::string IntegratorExport::getNameOutputRHS | ( | ) | const |
Definition at line 679 of file integrator_export.cpp.
const std::string IntegratorExport::getNameRHS | ( | ) | const |
Definition at line 666 of file integrator_export.cpp.
returnValue IntegratorExport::getNumSteps | ( | DVector & | _numSteps | ) | const [virtual] |
Returns the number of integration steps along the prediction horizon.
Definition at line 641 of file integrator_export.cpp.
returnValue IntegratorExport::getOutputExpressions | ( | std::vector< Expression > & | outputExpressions_ | ) | const [virtual] |
Returns the output expressions.
Definition at line 648 of file integrator_export.cpp.
returnValue IntegratorExport::getOutputGrids | ( | std::vector< Grid > & | outputGrids_ | ) | const [virtual] |
Returns the output grids.
Definition at line 655 of file integrator_export.cpp.
IntegratorExport & IntegratorExport::operator= | ( | const IntegratorExport & | arg | ) |
Assignment operator (deep copy).
[in] | arg | Right-hand side object. |
Definition at line 89 of file integrator_export.cpp.
returnValue IntegratorExport::propagateImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to propagate the sensitivities of the states defined by the nonlinear, fully implicit system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 460 of file integrator_export.cpp.
returnValue IntegratorExport::propagateInputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to propagate the sensitivities of the states, defined by the linear input system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 394 of file integrator_export.cpp.
returnValue IntegratorExport::propagateOutputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to propagate the sensitivities of the states, defined by the linear output system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 526 of file integrator_export.cpp.
virtual returnValue IntegratorExport::setDifferentialEquation | ( | const Expression & | rhs | ) | [pure virtual] |
Assigns Differential Equation to be used by the integrator.
[in] | rhs | Right-hand side expression. |
Implemented in RungeKuttaExport, DiscreteTimeExport, ImplicitRungeKuttaExport, ExplicitRungeKuttaExport, NARXExport, ThreeSweepsERKExport, AdjointERKExport, and ForwardOverBackwardERKExport.
returnValue IntegratorExport::setGrid | ( | const Grid & | _grid | ) | [virtual] |
Sets integration grid (this grid is expected to be non equidistant, otherwise use the other setGrid function).
[in] | _grid | integration grid |
Definition at line 101 of file integrator_export.cpp.
returnValue IntegratorExport::setLinearInput | ( | const DMatrix & | M1, |
const DMatrix & | A1, | ||
const DMatrix & | B1 | ||
) | [virtual] |
[in] | . |
Reimplemented in ExplicitRungeKuttaExport.
Definition at line 109 of file integrator_export.cpp.
returnValue IntegratorExport::setLinearOutput | ( | const DMatrix & | M3, |
const DMatrix & | A3, | ||
const Expression & | rhs | ||
) | [virtual] |
[in] | . |
Reimplemented in NARXExport, and ExplicitRungeKuttaExport.
Definition at line 174 of file integrator_export.cpp.
returnValue IntegratorExport::setLinearOutput | ( | const DMatrix & | M3, |
const DMatrix & | A3, | ||
const std::string & | _rhs3, | ||
const std::string & | _diffs_rhs3 | ||
) | [virtual] |
[in] | . |
Reimplemented in NARXExport, and ExplicitRungeKuttaExport.
Definition at line 253 of file integrator_export.cpp.
returnValue IntegratorExport::setModel | ( | const std::string & | _name_ODE, |
const std::string & | _name_diffs_ODE | ||
) | [virtual] |
Assigns the model to be used by the integrator.
[in] | _name_ODE | Name of the function, evaluating the ODE right-hand side. |
[in] | _name_diffs_ODE | Name of the function, evaluating the derivatives of the ODE right-hand side. |
Reimplemented in ImplicitRungeKuttaExport, and NARXExport.
Definition at line 139 of file integrator_export.cpp.
returnValue IntegratorExport::setModelData | ( | const ModelData & | data | ) | [virtual] |
Passes all the necessary model data to the integrator.
[in] | data | The model data. |
Definition at line 289 of file integrator_export.cpp.
virtual returnValue IntegratorExport::setNARXmodel | ( | const uint | delay, |
const DMatrix & | parms | ||
) | [pure virtual] |
Sets a polynomial NARX model to be used by the integrator.
[in] | delay | The delay for the states in the NARX model. |
[in] | parms | The parameters defining the polynomial NARX model. |
Implemented in NARXExport, RungeKuttaExport, and DiscreteTimeExport.
virtual returnValue IntegratorExport::setup | ( | ) | [pure virtual] |
Initializes export of a tailored integrator.
Reimplemented from ExportAlgorithm.
Implemented in DiagonallyImplicitRKExport, ThreeSweepsERKExport, AdjointERKExport, ForwardOverBackwardERKExport, ImplicitRungeKuttaExport, ForwardIRKExport, DiscreteTimeExport, RungeKuttaExport, ExplicitRungeKuttaExport, and NARXExport.
virtual returnValue IntegratorExport::setupOutput | ( | const std::vector< Grid > | outputGrids_, |
const std::vector< Expression > | rhs | ||
) | [pure virtual] |
Sets up the output with the grids for the different output functions.
outputGrids_ | The vector containing a grid for each output function. |
rhs | The expressions corresponding the output functions. |
Implemented in RungeKuttaExport, ExplicitRungeKuttaExport, ImplicitRungeKuttaExport, and DiscreteTimeExport.
virtual returnValue IntegratorExport::setupOutput | ( | const std::vector< Grid > | outputGrids_, |
const std::vector< std::string > | _outputNames, | ||
const std::vector< std::string > | _diffs_outputNames, | ||
const std::vector< uint > | _dims_output | ||
) | [pure virtual] |
Sets up the output with the grids for the different output functions.
outputGrids_ | The vector containing a grid for each output function. |
_outputNames | The names of the output functions. |
_diffs_outputNames | The names of the functions, evaluating the derivatives of the outputs. |
_dims_output | The dimensions of the output functions. |
Implemented in ExplicitRungeKuttaExport, ImplicitRungeKuttaExport, and DiscreteTimeExport.
virtual returnValue IntegratorExport::setupOutput | ( | const std::vector< Grid > | outputGrids_, |
const std::vector< std::string > | _outputNames, | ||
const std::vector< std::string > | _diffs_outputNames, | ||
const std::vector< uint > | _dims_output, | ||
const std::vector< DMatrix > | _outputDependencies | ||
) | [pure virtual] |
Sets up the output with the grids for the different output functions.
outputGrids_ | The vector containing a grid for each output function. |
_outputNames | The names of the output functions. |
_diffs_outputNames | The names of the functions, evaluating the derivatives of the outputs. |
_dims_output | The dimensions of the output functions. |
_outputDependencies | A separate dependency matrix for each output. |
Implemented in ExplicitRungeKuttaExport, ImplicitRungeKuttaExport, and DiscreteTimeExport.
returnValue IntegratorExport::updateImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to update the sensitivities of the states defined by the nonlinear, fully implicit system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 422 of file integrator_export.cpp.
returnValue IntegratorExport::updateInputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to update the sensitivities of the states, defined by the linear input system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 372 of file integrator_export.cpp.
returnValue IntegratorExport::updateOutputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | tmp_index | ||
) | [virtual] |
Exports the code needed to update the sensitivities of the states, defined by the linear output system.
[in] | block | The block to which the code will be exported. |
Reimplemented in NARXExport.
Definition at line 504 of file integrator_export.cpp.
DMatrix IntegratorExport::A11 [protected] |
Definition at line 434 of file integrator_export.hpp.
DMatrix IntegratorExport::A33 [protected] |
Definition at line 435 of file integrator_export.hpp.
DMatrix IntegratorExport::B11 [protected] |
Definition at line 434 of file integrator_export.hpp.
bool IntegratorExport::crsFormat [protected] |
True if the CRS format is used for the jacobian of output functions.
Definition at line 438 of file integrator_export.hpp.
std::vector<ExportAcadoFunction> IntegratorExport::diffs_outputs [protected] |
Module to export the evaluation of the derivatives of the output functions.
Definition at line 483 of file integrator_export.hpp.
ExportAcadoFunction IntegratorExport::diffs_rhs [protected] |
Module to export the evaluation of the derivatives of the ordinary differential equations.
Definition at line 449 of file integrator_export.hpp.
ExportAcadoFunction IntegratorExport::diffs_rhs3 [protected] |
Definition at line 454 of file integrator_export.hpp.
uint IntegratorExport::diffsDim [protected] |
This is the total number of sensitivities needed.
Definition at line 429 of file integrator_export.hpp.
DifferentialStateDerivative IntegratorExport::dx [protected] |
The differential state derivatives in the model.
Definition at line 474 of file integrator_export.hpp.
ExportVariable IntegratorExport::error_code [protected] |
Variable containing the error code, returned by the integrator.
Definition at line 456 of file integrator_export.hpp.
bool IntegratorExport::exportRhs [protected] |
True if the right-hand side and their derivatives should be exported too.
Definition at line 437 of file integrator_export.hpp.
ExportFunction IntegratorExport::fullRhs [protected] |
Function that evaluates the full right-hand side.
Definition at line 443 of file integrator_export.hpp.
Grid IntegratorExport::grid [protected] |
Evaluation grid along the prediction horizon.
Definition at line 440 of file integrator_export.hpp.
uint IntegratorExport::inputDim [protected] |
This is the dimension of the input to the integrator.
Definition at line 430 of file integrator_export.hpp.
ExportFunction IntegratorExport::integrate [protected] |
Function that integrates the exported ODE.
Definition at line 447 of file integrator_export.hpp.
ExportAcadoFunction IntegratorExport::lin_input [protected] |
Definition at line 451 of file integrator_export.hpp.
DMatrix IntegratorExport::M11 [protected] |
Definition at line 434 of file integrator_export.hpp.
DMatrix IntegratorExport::M33 [protected] |
Definition at line 435 of file integrator_export.hpp.
uint IntegratorExport::NDX3 [protected] |
Definition at line 426 of file integrator_export.hpp.
std::vector<uint> IntegratorExport::num_outputs [protected] |
A separate dimension for each output.
Definition at line 485 of file integrator_export.hpp.
DVector IntegratorExport::numSteps [protected] |
The number of integration steps per shooting interval.
Definition at line 441 of file integrator_export.hpp.
uint IntegratorExport::NX1 [protected] |
Definition at line 423 of file integrator_export.hpp.
uint IntegratorExport::NX2 [protected] |
Definition at line 424 of file integrator_export.hpp.
uint IntegratorExport::NX3 [protected] |
Definition at line 425 of file integrator_export.hpp.
uint IntegratorExport::NXA3 [protected] |
Definition at line 427 of file integrator_export.hpp.
OnlineData IntegratorExport::od [protected] |
The "online" data values in the model.
Definition at line 477 of file integrator_export.hpp.
std::vector<DMatrix> IntegratorExport::outputDependencies [protected] |
A separate dependency matrix for each output.
Definition at line 481 of file integrator_export.hpp.
std::vector<Expression> IntegratorExport::outputExpressions [protected] |
A separate expression for each output.
Definition at line 480 of file integrator_export.hpp.
std::vector<Grid> IntegratorExport::outputGrids [protected] |
A separate grid for each output.
Definition at line 479 of file integrator_export.hpp.
std::vector<ExportAcadoFunction> IntegratorExport::outputs [protected] |
Module to export output functions.
Definition at line 482 of file integrator_export.hpp.
ExportVariable IntegratorExport::reset_int [protected] |
Variable containing the number of the current integration step.
Definition at line 457 of file integrator_export.hpp.
ExportAcadoFunction IntegratorExport::rhs [protected] |
Module to export ODE.
Definition at line 448 of file integrator_export.hpp.
ExportAcadoFunction IntegratorExport::rhs3 [protected] |
Definition at line 453 of file integrator_export.hpp.
ExportVariable IntegratorExport::rhs_in [protected] |
Definition at line 444 of file integrator_export.hpp.
ExportVariable IntegratorExport::rhs_out [protected] |
Definition at line 445 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsNew1 [protected] |
Definition at line 464 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsNew2 [protected] |
Variable containing the derivatives wrt the previous values.
Definition at line 467 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsNew3 [protected] |
Definition at line 470 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsPrev1 [protected] |
Definition at line 463 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsPrev2 [protected] |
Variable containing the sensitivities from the previous integration step.
Definition at line 466 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsPrev3 [protected] |
Definition at line 471 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_diffsTemp2 [protected] |
Variable containing intermediate results of evaluations of the derivatives of the differential equations (ordinary and algebraic).
Definition at line 468 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_eta [protected] |
Variable containing the inputs or the results of the integrator.
Definition at line 461 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_index [protected] |
Variable containing the number of the current shooting interval.
Definition at line 458 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_ttt [protected] |
Variable containing the integration time.
Definition at line 459 of file integrator_export.hpp.
ExportVariable IntegratorExport::rk_xxx [protected] |
Variable containing the current integrator state.
Definition at line 460 of file integrator_export.hpp.
bool IntegratorExport::timeDependant [protected] |
Definition at line 432 of file integrator_export.hpp.
Control IntegratorExport::u [protected] |
The control inputs in the model.
Definition at line 476 of file integrator_export.hpp.
DifferentialState IntegratorExport::x [protected] |
The differential states in the model.
Definition at line 473 of file integrator_export.hpp.
AlgebraicState IntegratorExport::z [protected] |
The algebraic states in the model.
Definition at line 475 of file integrator_export.hpp.