Allows to export a tailored diagonally implicit Runge-Kutta integrator for fast model predictive control. More...
#include <dirk_export.hpp>
Allows to export a tailored diagonally implicit Runge-Kutta integrator for fast model predictive control.
The class DiagonallyImplicitRKExport allows to export a tailored diagonally implicit Runge-Kutta integrator for fast model predictive control.
Definition at line 54 of file dirk_export.hpp.
BEGIN_NAMESPACE_ACADO DiagonallyImplicitRKExport::DiagonallyImplicitRKExport | ( | 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 48 of file dirk_export.cpp.
Copy constructor (deep copy).
[in] | arg | Right-hand side object. |
Definition at line 55 of file dirk_export.cpp.
DiagonallyImplicitRKExport::~DiagonallyImplicitRKExport | ( | ) | [virtual] |
Destructor.
Definition at line 61 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::evaluateMatrix | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | tmp_index, | ||
const ExportVariable & | Ah, | ||
const ExportVariable & | C, | ||
bool | evaluateB, | ||
bool | DERIVATIVES | ||
) | [virtual] |
Exports the evaluation of the matrix of the linear system.
[in] | block | The block to which the code will be exported. |
[in] | index1 | The loop index of the outer loop. |
[in] | index2 | The loop index of the inner loop. |
[in] | tmp_index | A temporary index to be used. |
[in] | Ah | The matrix A of the IRK method, multiplied by the step size h. |
[in] | evaluateB | True if the right-hand side of the linear system should also be evaluated, false otherwise. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 319 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::evaluateRhsImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | stage | ||
) | [virtual] |
Exports the evaluation of the right-hand side of the linear system at a specific stage.
[in] | block | The block to which the code will be exported. |
[in] | index | The loop index, defining the stage. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 375 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::evaluateStatesImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportVariable & | Ah, | ||
const ExportVariable & | C, | ||
const ExportIndex & | stage, | ||
const ExportIndex & | i, | ||
const ExportIndex & | j | ||
) | [virtual] |
Exports the evaluation of the states at a specific stage.
[in] | block | The block to which the code will be exported. |
[in] | Ah | The matrix A of the IRK method, multiplied by the step size h. |
[in] | index | The loop index, defining the stage. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 350 of file dirk_export.cpp.
DMatrix DiagonallyImplicitRKExport::formMatrix | ( | const DMatrix & | mass, |
const DMatrix & | jacobian | ||
) | [virtual] |
Forms a constant linear system matrix for the collocation equations, given a constant jacobian and mass matrix.
[in] | jacobian | given constant Jacobian matrix |
[in] | mass | given constant mass matrix |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 163 of file dirk_export.cpp.
DiagonallyImplicitRKExport & DiagonallyImplicitRKExport::operator= | ( | const DiagonallyImplicitRKExport & | arg | ) |
Assignment operator (deep copy).
[in] | arg | Right-hand side object. |
Definition at line 71 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::prepareInputSystem | ( | ExportStatementBlock & | code | ) | [virtual] |
Precompute as much as possible for the linear input system and export the resulting definitions.
[in] | code | The block to which the code will be exported. |
Reimplemented from ForwardIRKExport.
Definition at line 107 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::prepareOutputSystem | ( | ExportStatementBlock & | code | ) | [virtual] |
Precompute as much as possible for the linear output system and export the resulting definitions.
[in] | code | The block to which the code will be exported. |
Reimplemented from ForwardIRKExport.
Definition at line 533 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::sensitivitiesImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index1, | ||
const ExportIndex & | tmp_index2, | ||
const ExportVariable & | Ah, | ||
const ExportVariable & | Bh, | ||
const ExportVariable & | det, | ||
bool | STATES, | ||
uint | number | ||
) | [virtual] |
Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system.
[in] | block | The block to which the code will be exported. |
[in] | Ah | The variable containing the internal coefficients of the RK method, multiplied with the step size. |
[in] | Bh | The variable containing the weights of the RK method, multiplied with the step size. |
[in] | det | The variable that holds the determinant of the matrix in the linear system. |
[in] | STATES | True if the sensitivities with respect to a state are needed, false otherwise. |
[in] | number | This number defines the stage of the state with respect to which the sensitivities are computed. |
Reimplemented from ForwardIRKExport.
Definition at line 236 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::sensitivitiesOutputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | index4, | ||
const ExportIndex & | tmp_index1, | ||
const ExportIndex & | tmp_index2, | ||
const ExportVariable & | Ah, | ||
const ExportVariable & | Bh, | ||
bool | STATES, | ||
uint | number | ||
) | [virtual] |
Exports the code needed to compute the sensitivities of the states, defined by the linear output system.
[in] | block | The block to which the code will be exported. |
[in] | Ah | The variable containing the internal coefficients of the RK method, multiplied with the step size. |
[in] | Bh | The variable containing the weights of the RK method, multiplied with the step size. |
[in] | STATES | True if the sensitivities with respect to a state are needed, false otherwise. |
[in] | number | This number defines the stage of the state with respect to which the sensitivities are computed. |
Reimplemented from ForwardIRKExport.
Definition at line 421 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::setup | ( | ) | [virtual] |
Initializes export of a tailored integrator.
Reimplemented from ForwardIRKExport.
Definition at line 572 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::solveImplicitSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index, | ||
const ExportVariable & | Ah, | ||
const ExportVariable & | C, | ||
const ExportVariable & | det, | ||
bool | DERIVATIVES = false |
||
) | [virtual] |
Exports the code needed to solve the system of collocation equations for the nonlinear, fully implicit system.
[in] | block | The block to which the code will be exported. |
[in] | Ah | The variable containing the internal coefficients of the RK method, multiplied with the step size. |
[in] | det | The variable that holds the determinant of the matrix in the linear system. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 190 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::solveInputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index, | ||
const ExportVariable & | Ah | ||
) | [virtual] |
Exports the code needed to solve the system of collocation equations for the linear input system.
[in] | block | The block to which the code will be exported. |
[in] | A1 | A constant matrix defining the equations of the linear input system. |
[in] | B1 | A constant matrix defining the equations of the linear input system. |
[in] | Ah | The variable containing the internal coefficients of the RK method, multiplied with the step size. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 81 of file dirk_export.cpp.
returnValue DiagonallyImplicitRKExport::solveOutputSystem | ( | ExportStatementBlock * | block, |
const ExportIndex & | index1, | ||
const ExportIndex & | index2, | ||
const ExportIndex & | index3, | ||
const ExportIndex & | tmp_index, | ||
const ExportVariable & | Ah, | ||
bool | DERIVATIVES = false |
||
) | [virtual] |
Exports the code needed to solve the system of collocation equations for the linear output system.
[in] | block | The block to which the code will be exported. |
[in] | Ah | The variable containing the internal coefficients of the RK method, multiplied with the step size. |
[in] | A3 | A constant matrix defining the equations of the linear output system. |
Reimplemented from ImplicitRungeKuttaExport.
Definition at line 394 of file dirk_export.cpp.