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

Allows to export a tailored implicit Runge-Kutta integrator for fast model predictive control. More...

#include <irk_export.hpp>

Inheritance diagram for ImplicitRungeKuttaExport:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue getCode (ExportStatementBlock &code)
 
virtual returnValue getDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
 
virtual returnValue getFunctionDeclarations (ExportStatementBlock &declarations) const
 
 ImplicitRungeKuttaExport (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
 
 ImplicitRungeKuttaExport (const ImplicitRungeKuttaExport &arg)
 
ImplicitRungeKuttaExportoperator= (const ImplicitRungeKuttaExport &arg)
 
virtual returnValue setDifferentialEquation (const Expression &rhs)
 
returnValue setEigenvalues (const DMatrix &_eig)
 
returnValue setModel (const std::string &_rhs, const std::string &_diffs_rhs)
 
returnValue setSimplifiedTransformations (const DMatrix &_transf1, const DMatrix &_transf2)
 
returnValue setSimplifiedTransformations (const DMatrix &_transf1, const DMatrix &_transf2, const DMatrix &_transf1_T, const DMatrix &_transf2_T)
 
returnValue setSingleTransformations (const double _tau, const DVector &_low_tria, const DMatrix &_transf1, const DMatrix &_transf2)
 
returnValue setSingleTransformations (const double _tau, const DVector &_low_tria, const DMatrix &_transf1, const DMatrix &_transf2, const DMatrix &_transf1_T, const DMatrix &_transf2_T)
 
virtual returnValue setup ()
 
virtual returnValue setupOutput (const std::vector< Grid > outputGrids_, const std::vector< Expression > rhs)
 
virtual returnValue 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)
 
virtual returnValue 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)
 
virtual ~ImplicitRungeKuttaExport ()
 
- Public Member Functions inherited from RungeKuttaExport
BooleanType checkSymmetry (const DVector &_cc)
 
uint getNumStages ()
 
returnValue initializeButcherTableau (const DMatrix &_AA, const DVector &_bb, const DVector &_cc)
 
RungeKuttaExportoperator= (const RungeKuttaExport &arg)
 
 RungeKuttaExport (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
 
 RungeKuttaExport (const RungeKuttaExport &arg)
 
returnValue setNARXmodel (const uint delay, const DMatrix &parms)
 
virtual ~RungeKuttaExport ()
 
- Public Member Functions inherited from IntegratorExport
virtual bool equidistantControlGrid () const
 
uint getDimOUTPUT (uint index) const
 
virtual returnValue getGrid (Grid &grid_) const
 
const std::string getNameDiffsOUTPUT (uint index) const
 
const std::string getNameDiffsRHS () const
 
virtual const std::string getNameFullRHS () const
 
const std::string getNameOUTPUT (uint index) const
 
const std::string getNameOutputDiffs () const
 
const std::string getNameOutputRHS () const
 
const std::string getNameRHS () const
 
virtual returnValue getNumSteps (DVector &_numSteps) const
 
virtual returnValue getOutputExpressions (std::vector< Expression > &outputExpressions_) const
 
virtual returnValue getOutputGrids (std::vector< Grid > &outputGrids_) const
 
 IntegratorExport (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
 
 IntegratorExport (const IntegratorExport &arg)
 
IntegratorExportoperator= (const IntegratorExport &arg)
 
virtual returnValue propagateImplicitSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &_index3, const ExportIndex &tmp_index)
 
virtual returnValue propagateInputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index)
 
virtual returnValue propagateOutputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index)
 
virtual returnValue setGrid (const Grid &_grid)
 
virtual returnValue setLinearInput (const DMatrix &M1, const DMatrix &A1, const DMatrix &B1)
 
virtual returnValue setLinearOutput (const DMatrix &M3, const DMatrix &A3, const Expression &rhs)
 
virtual returnValue setLinearOutput (const DMatrix &M3, const DMatrix &A3, const std::string &_rhs3, const std::string &_diffs_rhs3)
 
virtual returnValue setModelData (const ModelData &data)
 
virtual returnValue setNonlinearFeedback (const DMatrix &C, const Expression &feedb)
 
virtual returnValue updateImplicitSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
 
virtual returnValue updateInputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
 
virtual returnValue updateOutputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
 
virtual ~IntegratorExport ()
 
- Public Member Functions inherited from ExportAlgorithm
 ExportAlgorithm (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName=std::string())
 
uint getN () const
 
uint getNDX () const
 
uint getNOD () const
 
uint getNP () const
 
uint getNU () const
 
uint getNX () const
 
uint getNXA () const
 
uint getNY () const
 
uint getNYN () const
 
returnValue setDimensions (uint _NX=0, uint _NU=0, uint _NP=0, uint _NI=0, uint _NOD=0)
 
returnValue setDimensions (uint _NX, uint _NDX, uint _NXA, uint _NU, uint _NP, uint _NI, uint _NOD)
 
void setNY (uint NY_)
 
void setNYN (uint NYN_)
 
virtual ~ExportAlgorithm ()
 
- Public Member Functions inherited from AlgorithmicBase
int addLogRecord (LogRecord &_record)
 
returnValue addOption (OptionsName name, int value)
 
returnValue addOption (OptionsName name, double value)
 
returnValue addOption (uint idx, OptionsName name, int value)
 
returnValue addOption (uint idx, OptionsName name, double value)
 
returnValue addOptionsList ()
 
 AlgorithmicBase ()
 
 AlgorithmicBase (UserInteraction *_userInteraction)
 
 AlgorithmicBase (const AlgorithmicBase &rhs)
 
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 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
 
Options getOptions (uint idx) const
 
BooleanType haveOptionsChanged () const
 
BooleanType haveOptionsChanged (uint idx) const
 
AlgorithmicBaseoperator= (const AlgorithmicBase &rhs)
 
returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue printLogRecord (std::ostream &_stream, int idx, LogPrintMode _mode=PRINT_ITEM_BY_ITEM) const
 
returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
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 setAll (LogName _name, const MatrixVariablesGrid &values)
 
returnValue setLast (LogName _name, int lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, double lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DVector &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DMatrix &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const VariablesGrid &lastValue, double time=-INFTY)
 
returnValue setOptions (const Options &arg)
 
returnValue setOptions (uint idx, const Options &arg)
 
virtual ~AlgorithmicBase ()
 

Protected Member Functions

DVector computeCombinations (const DVector &cVec, uint index, uint numEls)
 
virtual returnValue copy (const ImplicitRungeKuttaExport &arg)
 
DVector divideMeasurements (uint index)
 
DVector evaluateDerivedPolynomial (double time)
 
returnValue evaluateDerivedPolynomial (ExportStatementBlock &block, const ExportVariable &variable, const ExportVariable &grid)
 
DMatrix evaluateDerivedPolynomial (uint index)
 
virtual returnValue evaluateMatrix (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index, const ExportIndex &k_index, const ExportVariable &_rk_A, const ExportVariable &Ah, const ExportVariable &C, bool evaluateB, bool DERIVATIVES)
 
DVector evaluatePolynomial (double time)
 
returnValue evaluatePolynomial (ExportStatementBlock &block, const ExportVariable &variable, const ExportVariable &grid, const std::string &h)
 
DMatrix evaluatePolynomial (uint index)
 
virtual returnValue evaluateRhsImplicitSystem (ExportStatementBlock *block, const ExportIndex &k_index, const ExportIndex &stage)
 
virtual returnValue evaluateStatesImplicitSystem (ExportStatementBlock *block, const ExportIndex &k_index, const ExportVariable &Ah, const ExportVariable &C, const ExportIndex &stage, const ExportIndex &i, const ExportIndex &tmp_index)
 
returnValue evaluateStatesOutputSystem (ExportStatementBlock *block, const ExportVariable &Ah, const ExportIndex &stage)
 
virtual DMatrix formMatrix (const DMatrix &mass, const DMatrix &jacobian)
 
returnValue generateOutput (ExportStatementBlock *block, const ExportIndex &index0, const ExportIndex &index1, const ExportIndex &tmp_index1, const ExportIndex &tmp_index2, const ExportVariable &tmp_meas, const ExportVariable &time_tmp, const uint directions)
 
virtual ExportVariable getAuxVariable () const
 
uint getNumIts () const
 
uint getNumItsInit () const
 
returnValue initializeCoefficients ()
 
returnValue initializeDDMatrix ()
 
virtual returnValue prepareInputSystem (ExportStatementBlock &code)
 
returnValue prepareOutputEvaluation (ExportStatementBlock &code)
 
virtual returnValue prepareOutputSystem (ExportStatementBlock &code)
 
virtual returnValue solveImplicitSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportIndex &k_index, const ExportVariable &Ah, const ExportVariable &C, const ExportVariable &det, bool DERIVATIVES=false)
 
virtual returnValue solveInputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportVariable &Ah)
 
virtual returnValue solveOutputSystem (ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportVariable &Ah, bool DERIVATIVES=false)
 
- Protected Member Functions inherited from RungeKuttaExport
virtual returnValue copy (const RungeKuttaExport &arg)
 
- Protected Member Functions inherited from IntegratorExport
virtual returnValue clear ()
 
virtual returnValue copy (const IntegratorExport &arg)
 
DMatrix expandOutputMatrix (const DMatrix &A3)
 
uint getIntegrationInterval (double time)
 

Protected Attributes

DMatrix coeffs
 
bool CONTINUOUS_OUTPUT
 
DMatrix DD
 
ExportVariable debug_mat
 
DMatrix eig
 
std::vector< ExportVariablegridVariables
 
ExportAcadoFunction lin_output
 
DVector low_tria
 
uint NDX2
 
DVector numDX_output
 
uint numIts
 
uint numItsInit
 
std::vector< ExportIndexnumMeas
 
std::vector< ExportVariablenumMeasVariables
 
DVector numVARS_output
 
DVector numXA_output
 
uint NVARS2
 
uint NVARS3
 
std::vector< ExportVariablepolynDerVariables
 
ExportVariable polynEvalVar
 
std::vector< ExportVariablepolynVariables
 
bool REUSE
 
ExportVariable rk_A
 
ExportVariable rk_auxSolver
 
ExportVariable rk_b
 
ExportVariable rk_diffK
 
ExportVariable rk_diffsOutputTemp
 
ExportVariable rk_diffsTemp3
 
ExportVariable rk_dk1
 
ExportVariable rk_dk3
 
ExportVariable rk_mat1
 
ExportVariable rk_mat3
 
ExportVariable rk_out
 
ExportVariable rk_outH
 
std::vector< ExportVariablerk_outputs
 
ExportVariable rk_rhsOutputTemp
 
ExportVariable rk_rhsTemp
 
DMatrix simplified_transf1
 
DMatrix simplified_transf1_T
 
DMatrix simplified_transf2
 
DMatrix simplified_transf2_T
 
DMatrix single_transf1
 
DMatrix single_transf1_T
 
DMatrix single_transf2
 
DMatrix single_transf2_T
 
ExportLinearSolversolver
 
ExportVariable stepsH
 
double tau
 
std::vector< uinttotalMeas
 
- Protected Attributes inherited from RungeKuttaExport
DMatrix AA
 
DVector bb
 
DVector cc
 
BooleanType is_symmetric
 
uint numStages
 
ExportVariable rk_kkk
 
- Protected Attributes inherited from IntegratorExport
DMatrix A11
 
DMatrix A33
 
DMatrix B11
 
bool crsFormat
 
std::vector< ExportAcadoFunctiondiffs_outputs
 
ExportAcadoFunction diffs_rhs
 
ExportAcadoFunction diffs_rhs3
 
uint diffsDim
 
DifferentialStateDerivative dx
 
ExportVariable error_code
 
bool exportRhs
 
ExportFunction fullRhs
 
Grid grid
 
uint inputDim
 
ExportFunction integrate
 
ExportAcadoFunction lin_input
 
DMatrix M11
 
DMatrix M33
 
uint NDX3
 
std::vector< uintnum_outputs
 
DVector numSteps
 
uint NX1
 
uint NX2
 
uint NX3
 
uint NXA3
 
OnlineData od
 
std::vector< DMatrixoutputDependencies
 
std::vector< ExpressionoutputExpressions
 
std::vector< GridoutputGrids
 
std::vector< ExportAcadoFunctionoutputs
 
ExportVariable reset_int
 
ExportAcadoFunction rhs
 
ExportAcadoFunction rhs3
 
ExportVariable rhs_in
 
ExportVariable rhs_out
 
ExportVariable rk_diffsNew1
 
ExportVariable rk_diffsNew2
 
ExportVariable rk_diffsNew3
 
ExportVariable rk_diffsPrev1
 
ExportVariable rk_diffsPrev2
 
ExportVariable rk_diffsPrev3
 
ExportVariable rk_diffsTemp2
 
ExportVariable rk_eta
 
ExportVariable rk_index
 
ExportVariable rk_ttt
 
ExportVariable rk_xxx
 
bool timeDependant
 
Control u
 
DifferentialState x
 
AlgebraicState z
 
- Protected Attributes inherited from ExportAlgorithm
std::string commonHeaderName
 
uint N
 
uint NDX
 
uint NOD
 
uint NP
 
uint NU
 
uint NX
 
uint NXA
 
uint NY
 
uint NYN
 
- Protected Attributes inherited from AlgorithmicBase
int outputLoggingIdx
 
BooleanType useModuleStandalone
 
UserInteractionuserInteraction
 

Detailed Description

Allows to export a tailored implicit Runge-Kutta integrator for fast model predictive control.

The class ImplicitRungeKuttaExport allows to export a tailored implicit Runge-Kutta integrator for fast model predictive control.

Author
Rien Quirynen

Definition at line 55 of file irk_export.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO ImplicitRungeKuttaExport::ImplicitRungeKuttaExport ( UserInteraction _userInteraction = 0,
const std::string &  _commonHeaderName = "" 
)

Default constructor.

@param[in] _userInteraction         Pointer to corresponding user interface.
@param[in] _commonHeaderName        Name of common header file to be included.

Definition at line 44 of file irk_export.cpp.

ImplicitRungeKuttaExport::ImplicitRungeKuttaExport ( const ImplicitRungeKuttaExport arg)

Copy constructor (deep copy).

@param[in] arg              Right-hand side object.

Definition at line 67 of file irk_export.cpp.

ImplicitRungeKuttaExport::~ImplicitRungeKuttaExport ( )
virtual

Destructor.

Definition at line 91 of file irk_export.cpp.

Member Function Documentation

DVector ImplicitRungeKuttaExport::computeCombinations ( const DVector cVec,
uint  index,
uint  numEls 
)
protected

Recursive function that helps with the computation of the coefficients of polynomials that are used to evaluate the continuous output (see initializeCoefficients), by computing the correct combinations of elements of the vector cc from the Butcher table.

Parameters
[in]cVecThe vector with all the elements of the vector cc from the Butcher table, of which combinations are computed in a recursive way.
[in]indexAn index of the vector cVec which denotes the relevant part for this invocation.
[in]numElsThe number of elements in the combination.
Returns
SUCCESSFUL_RETURN

Definition at line 923 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::copy ( const ImplicitRungeKuttaExport arg)
protectedvirtual

Copies all class members from given object.

@param[in] arg              Right-hand side object.

\return SUCCESSFUL_RETURN

Definition at line 1581 of file irk_export.cpp.

DVector ImplicitRungeKuttaExport::divideMeasurements ( uint  index)
protected

Divide the total number of measurements over the different integration steps.

@param[in] index    The index of the continuous output for which the division of measurements is returned.

\return The division of measurements over the integration steps, corresponding the given continuous output.

Definition at line 1064 of file irk_export.cpp.

DVector ImplicitRungeKuttaExport::evaluateDerivedPolynomial ( double  time)
protected

Returns the coefficients of the derived polynomial, representing the derivative of the continuous output with respect to time.

@param[in] time                             The point in the interval (0,1] for which the coefficients are returned.

\return Coefficients of the polynomial, corresponding the given grid point

Definition at line 1025 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluateDerivedPolynomial ( ExportStatementBlock block,
const ExportVariable variable,
const ExportVariable grid 
)
protected

Exports the evaluation of the coefficients of the derived polynomial, representing the derivative of the continuous output with respect to time.

@param[in] block                    The block to which the code will be exported.
@param[in] variable                 The variable containing the coefficients of the polynomial.
@param[in] grid                             The variable containing the grid point for the specific output.

\return SUCCESSFUL_RETURN

Definition at line 1044 of file irk_export.cpp.

DMatrix ImplicitRungeKuttaExport::evaluateDerivedPolynomial ( uint  index)
protected

Returns the coefficients of the derived polynomial for the complete grid of the output, corresponding a certain index.

@param[in] index    The index of the continuous output for which the coefficients are returned.

\return Coefficients of the derived polynomial, corresponding the given continuous output

Definition at line 1005 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluateMatrix ( ExportStatementBlock block,
const ExportIndex index1,
const ExportIndex index2,
const ExportIndex tmp_index,
const ExportIndex k_index,
const ExportVariable _rk_A,
const ExportVariable Ah,
const ExportVariable C,
bool  evaluateB,
bool  DERIVATIVES 
)
protectedvirtual

Exports the evaluation of the matrix of the linear system.

@param[in] block                    The block to which the code will be exported.
@param[in] index1                   The loop index of the outer loop.
@param[in] index2                   The loop index of the inner loop.
@param[in] tmp_index                A temporary index to be used.
@param[in] Ah                               The matrix A of the IRK method, multiplied by the step size h.
@param[in] evaluateB                True if the right-hand side of the linear system should also be evaluated, false otherwise.

\return SUCCESSFUL_RETURN

Definition at line 747 of file irk_export.cpp.

DVector ImplicitRungeKuttaExport::evaluatePolynomial ( double  time)
protected

Returns the coefficients of the polynomial, representing the continuous output of the integrator.

@param[in] time                             The point in the interval (0,1] for which the coefficients are returned.

\return Coefficients of the polynomial, corresponding the given grid point

Definition at line 965 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluatePolynomial ( ExportStatementBlock block,
const ExportVariable variable,
const ExportVariable grid,
const std::string &  h 
)
protected

Exports the evaluation of the coefficients of the polynomial, representing the continuous output of the integrator.

@param[in] block                    The block to which the code will be exported.
@param[in] variable                 The variable containing the coefficients of the polynomial.
@param[in] grid                             The variable containing the grid point for the specific output.
@param[in] h                                The integration step size.

\return SUCCESSFUL_RETURN

Definition at line 981 of file irk_export.cpp.

DMatrix ImplicitRungeKuttaExport::evaluatePolynomial ( uint  index)
protected

Returns the coefficients of the polynomial for the complete grid of the output, corresponding a certain index.

@param[in] index    The index of the continuous output for which the coefficients are returned.

\return Coefficients of the polynomial, corresponding the given continuous output

Definition at line 945 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluateRhsImplicitSystem ( ExportStatementBlock block,
const ExportIndex k_index,
const ExportIndex stage 
)
protectedvirtual

Exports the evaluation of the right-hand side of the linear system at a specific stage.

@param[in] block                    The block to which the code will be exported.
@param[in] index                    The loop index, defining the stage.

\return SUCCESSFUL_RETURN

Reimplemented in ForwardLiftedIRKExport.

Definition at line 728 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluateStatesImplicitSystem ( ExportStatementBlock block,
const ExportIndex k_index,
const ExportVariable Ah,
const ExportVariable C,
const ExportIndex stage,
const ExportIndex i,
const ExportIndex tmp_index 
)
protectedvirtual

Exports the evaluation of the states at a specific stage.

@param[in] block                    The block to which the code will be exported.
@param[in] Ah                               The matrix A of the IRK method, multiplied by the step size h.
@param[in] index                    The loop index, defining the stage.

\return SUCCESSFUL_RETURN

Reimplemented in ForwardLiftedIRKExport.

Definition at line 677 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::evaluateStatesOutputSystem ( ExportStatementBlock block,
const ExportVariable Ah,
const ExportIndex stage 
)
protected

Exports the evaluation of the states at a specific stage.

@param[in] block                    The block to which the code will be exported.
@param[in] Ah                               The matrix A of the IRK method, multiplied by the step size h.
@param[in] index                    The loop index, defining the stage.

\return SUCCESSFUL_RETURN

Definition at line 705 of file irk_export.cpp.

DMatrix ImplicitRungeKuttaExport::formMatrix ( const DMatrix mass,
const DMatrix jacobian 
)
protectedvirtual

Forms a constant linear system matrix for the collocation equations, given a constant jacobian and mass matrix.

@param[in] jacobian                 given constant Jacobian matrix
@param[in] mass                             given constant mass matrix

\return SUCCESSFUL_RETURN

Reimplemented in DiagonallyImplicitRKExport.

Definition at line 549 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::generateOutput ( ExportStatementBlock block,
const ExportIndex index0,
const ExportIndex index1,
const ExportIndex tmp_index1,
const ExportIndex tmp_index2,
const ExportVariable tmp_meas,
const ExportVariable time_tmp,
const uint  directions 
)
protected

Exports the necessary code for the computation of the continuous output.

@param[in] block                    The block to which the code will be exported.
@param[in] tmp_meas                 The number of measurements in the current integration step (in case of an online grid).
@param[in] rk_tPrev                 The time point, defining the beginning of the current integration step (in case of an online grid).
@param[in] time_tmp                 A variable used for time transformations (in case of an online grid).

\return SUCCESSFUL_RETURN

Definition at line 791 of file irk_export.cpp.

ExportVariable ImplicitRungeKuttaExport::getAuxVariable ( ) const
protectedvirtual

Returns the largest global export variable.

\return SUCCESSFUL_RETURN

Implements IntegratorExport.

Reimplemented in ForwardLiftedIRKExport, ForwardIRKExport, SymmetricIRKExport, ForwardBackwardLiftedIRKExport, FeedbackLiftedIRKExport, AdjointLiftedIRKExport, and SymmetricLiftedIRKExport.

Definition at line 171 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::getCode ( ExportStatementBlock code)
virtual

Exports source code of the auto-generated integrator into the given directory.

@param[in] code                             Code block containing the auto-generated integrator.

\return SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Reimplemented in AdjointLiftedIRKExport, FeedbackLiftedIRKExport, ForwardBackwardLiftedIRKExport, ForwardLiftedIRKExport, SymmetricLiftedIRKExport, SymmetricIRKExport, and ForwardIRKExport.

Definition at line 257 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::getDataDeclarations ( ExportStatementBlock declarations,
ExportStruct  dataStruct = ACADO_ANY 
) const
virtual

Adds all data declarations of the auto-generated integrator to given list of declarations.

@param[in] declarations             List of declarations.

\return SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Reimplemented in AdjointLiftedIRKExport, FeedbackLiftedIRKExport, ForwardBackwardLiftedIRKExport, ForwardLiftedIRKExport, SymmetricLiftedIRKExport, SymmetricIRKExport, and ForwardIRKExport.

Definition at line 200 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::getFunctionDeclarations ( ExportStatementBlock declarations) const
virtual

Adds all function (forward) declarations of the auto-generated integrator to given list of declarations.

@param[in] declarations             List of declarations.

\return SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Reimplemented in AdjointLiftedIRKExport, FeedbackLiftedIRKExport, ForwardBackwardLiftedIRKExport, ForwardLiftedIRKExport, SymmetricLiftedIRKExport, SymmetricIRKExport, and ForwardIRKExport.

Definition at line 244 of file irk_export.cpp.

uint ImplicitRungeKuttaExport::getNumIts ( ) const
protected

Returns the performed number of Newton iterations.

\return The performed number of Newton iterations.

Definition at line 1654 of file irk_export.cpp.

uint ImplicitRungeKuttaExport::getNumItsInit ( ) const
protected

Returns the performed number of Newton iterations for the initialization of the first step.

\return The performed number of Newton iterations for the initialization of the first step.

Definition at line 1660 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::initializeCoefficients ( )
protected

Initializes the matrix coeffs, containing coefficients of polynomials that are used to evaluate the continuous output (see evaluatePolynomial).

Returns
SUCCESSFUL_RETURN

Definition at line 883 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::initializeDDMatrix ( )
protected

Initializes the matrix DD, which is used to extrapolate the variables of the IRK method to the next step.

\return SUCCESSFUL_RETURN

Definition at line 864 of file irk_export.cpp.

ImplicitRungeKuttaExport & ImplicitRungeKuttaExport::operator= ( const ImplicitRungeKuttaExport arg)

Assignment operator (deep copy).

@param[in] arg              Right-hand side object.

Definition at line 101 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::prepareInputSystem ( ExportStatementBlock code)
protectedvirtual

Precompute as much as possible for the linear input system and export the resulting definitions.

@param[in] code                     The block to which the code will be exported.

\return SUCCESSFUL_RETURN

Reimplemented in ForwardIRKExport, FeedbackLiftedIRKExport, ForwardLiftedIRKExport, and DiagonallyImplicitRKExport.

Definition at line 521 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::prepareOutputEvaluation ( ExportStatementBlock code)
protected

Prepares the structures to evaluate the continuous output and exports the resulting definitions.

@param[in] code                             The block to which the code will be exported.

\return SUCCESSFUL_RETURN

Definition at line 1544 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::prepareOutputSystem ( ExportStatementBlock code)
protectedvirtual

Precompute as much as possible for the linear output system and export the resulting definitions.

@param[in] code                     The block to which the code will be exported.

\return SUCCESSFUL_RETURN

Reimplemented in DiagonallyImplicitRKExport, ForwardIRKExport, and ForwardLiftedIRKExport.

Definition at line 535 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setDifferentialEquation ( const Expression rhs)
virtual

Assigns Differential Equation to be used by the integrator.

@param[in] rhs              Right-hand side expression.

\return SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Reimplemented in AdjointLiftedIRKExport, ForwardBackwardLiftedIRKExport, ForwardLiftedIRKExport, SymmetricLiftedIRKExport, and SymmetricIRKExport.

Definition at line 112 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setEigenvalues ( const DMatrix _eig)

This routine sets the eigenvalues of the inverse of the AA matrix.

Definition at line 1306 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setModel ( const std::string &  _rhs,
const std::string &  _diffs_rhs 
)
virtual

Assigns the model to be used by the integrator.

@param[in] _rhs                             Name of the function, evaluating the right-hand side.
@param[in] _diffs_rhs               Name of the function, evaluating the derivatives of the right-hand side.

\return SUCCESSFUL_RETURN

Reimplemented from IntegratorExport.

Definition at line 159 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setSimplifiedTransformations ( const DMatrix _transf1,
const DMatrix _transf2 
)

This routine sets the transformation matrices, defined by the inverse of the AA matrix.

Definition at line 1323 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setSimplifiedTransformations ( const DMatrix _transf1,
const DMatrix _transf2,
const DMatrix _transf1_T,
const DMatrix _transf2_T 
)

Definition at line 1313 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setSingleTransformations ( const double  _tau,
const DVector _low_tria,
const DMatrix _transf1,
const DMatrix _transf2 
)

This routine sets the transformation matrices, defined by the inverse of the AA matrix.

Definition at line 1331 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setSingleTransformations ( const double  _tau,
const DVector _low_tria,
const DMatrix _transf1,
const DMatrix _transf2,
const DMatrix _transf1_T,
const DMatrix _transf2_T 
)

Definition at line 1341 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setup ( )
virtual

Initializes export of a tailored integrator.

\return SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Reimplemented in DiagonallyImplicitRKExport, ForwardIRKExport, AdjointLiftedIRKExport, FeedbackLiftedIRKExport, ForwardBackwardLiftedIRKExport, ForwardLiftedIRKExport, SymmetricLiftedIRKExport, and SymmetricIRKExport.

Definition at line 1078 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::setupOutput ( const std::vector< Grid outputGrids_,
const std::vector< Expression rhs 
)
virtual

Sets up the output with the grids for the different output functions.

Parameters
outputGrids_The vector containing a grid for each output function.
rhsThe expressions corresponding the output functions.

Returns
SUCCESSFUL_RETURN

Implements RungeKuttaExport.

Definition at line 1353 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::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 
)
virtual

Sets up the output with the grids for the different output functions.

Parameters
outputGrids_The vector containing a grid for each output function.
_outputNamesThe names of the output functions.
_diffs_outputNamesThe names of the functions, evaluating the derivatives of the outputs.
_dims_outputThe dimensions of the output functions.

Returns
SUCCESSFUL_RETURN

Implements IntegratorExport.

Definition at line 1447 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::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 
)
virtual

Sets up the output with the grids for the different output functions.

Parameters
outputGrids_The vector containing a grid for each output function.
_outputNamesThe names of the output functions.
_diffs_outputNamesThe names of the functions, evaluating the derivatives of the outputs.
_dims_outputThe dimensions of the output functions.
_outputDependenciesA separate dependency matrix for each output.

Returns
SUCCESSFUL_RETURN

Implements IntegratorExport.

Definition at line 1527 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::solveImplicitSystem ( ExportStatementBlock block,
const ExportIndex index1,
const ExportIndex index2,
const ExportIndex index3,
const ExportIndex tmp_index,
const ExportIndex k_index,
const ExportVariable Ah,
const ExportVariable C,
const ExportVariable det,
bool  DERIVATIVES = false 
)
protectedvirtual

Exports the code needed to solve the system of collocation equations for the nonlinear, fully implicit system.

@param[in] block                    The block to which the code will be exported.
@param[in] Ah                               The variable containing the internal coefficients of the RK method, multiplied with the step size.
@param[in] det                              The variable that holds the determinant of the matrix in the linear system.

\return SUCCESSFUL_RETURN

Reimplemented in ForwardLiftedIRKExport.

Definition at line 603 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::solveInputSystem ( ExportStatementBlock block,
const ExportIndex index1,
const ExportIndex index2,
const ExportIndex index3,
const ExportIndex tmp_index,
const ExportVariable Ah 
)
protectedvirtual

Exports the code needed to solve the system of collocation equations for the linear input system.

@param[in] block                    The block to which the code will be exported.
@param[in] A1                               A constant matrix defining the equations of the linear input system.
@param[in] B1                               A constant matrix defining the equations of the linear input system.
@param[in] Ah                               The variable containing the internal coefficients of the RK method, multiplied with the step size.

\return SUCCESSFUL_RETURN

Reimplemented in FeedbackLiftedIRKExport, and DiagonallyImplicitRKExport.

Definition at line 576 of file irk_export.cpp.

returnValue ImplicitRungeKuttaExport::solveOutputSystem ( ExportStatementBlock block,
const ExportIndex index1,
const ExportIndex index2,
const ExportIndex index3,
const ExportIndex tmp_index,
const ExportVariable Ah,
bool  DERIVATIVES = false 
)
protectedvirtual

Exports the code needed to solve the system of collocation equations for the linear output system.

@param[in] block                    The block to which the code will be exported.
@param[in] Ah                               The variable containing the internal coefficients of the RK method, multiplied with the step size.
@param[in] A3                               A constant matrix defining the equations of the linear output system.

\return SUCCESSFUL_RETURN

Reimplemented in DiagonallyImplicitRKExport.

Definition at line 653 of file irk_export.cpp.

Member Data Documentation

DMatrix ImplicitRungeKuttaExport::coeffs
protected

This matrix contains coefficients of polynomials that are used to evaluate the continuous output (see evaluatePolynomial).

Definition at line 533 of file irk_export.hpp.

bool ImplicitRungeKuttaExport::CONTINUOUS_OUTPUT
protected

This boolean is true when continuous output needs to be provided.

Definition at line 520 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::DD
protected

This matrix is used for the initialization of the variables for the next integration step.

Definition at line 532 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::debug_mat
protected

Definition at line 572 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::eig
protected

Definition at line 574 of file irk_export.hpp.

std::vector<ExportVariable> ImplicitRungeKuttaExport::gridVariables
protected

This vector contains an ExportVariable for the grid of each continuous output.

Definition at line 549 of file irk_export.hpp.

ExportAcadoFunction ImplicitRungeKuttaExport::lin_output
protected

Definition at line 566 of file irk_export.hpp.

DVector ImplicitRungeKuttaExport::low_tria
protected

Definition at line 581 of file irk_export.hpp.

uint ImplicitRungeKuttaExport::NDX2
protected

Definition at line 525 of file irk_export.hpp.

DVector ImplicitRungeKuttaExport::numDX_output
protected

Definition at line 535 of file irk_export.hpp.

uint ImplicitRungeKuttaExport::numIts
protected

This is the performed number of Newton iterations.

Definition at line 522 of file irk_export.hpp.

uint ImplicitRungeKuttaExport::numItsInit
protected

This is the performed number of Newton iterations for the initialization of the first step.

Definition at line 523 of file irk_export.hpp.

std::vector<ExportIndex> ImplicitRungeKuttaExport::numMeas
protected

Indices containing the number of measurements that are already computed.

Definition at line 556 of file irk_export.hpp.

std::vector<ExportVariable> ImplicitRungeKuttaExport::numMeasVariables
protected

Variables containing the number of measurements per integration interval.

Definition at line 555 of file irk_export.hpp.

DVector ImplicitRungeKuttaExport::numVARS_output
protected

Definition at line 537 of file irk_export.hpp.

DVector ImplicitRungeKuttaExport::numXA_output
protected

Definition at line 536 of file irk_export.hpp.

uint ImplicitRungeKuttaExport::NVARS2
protected

Definition at line 526 of file irk_export.hpp.

uint ImplicitRungeKuttaExport::NVARS3
protected

Definition at line 528 of file irk_export.hpp.

std::vector<ExportVariable> ImplicitRungeKuttaExport::polynDerVariables
protected

Variables containing the coefficients for the derived polynomial.

Definition at line 554 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::polynEvalVar
protected

Local variable that is used for the evaluations of the continuous output.

Definition at line 545 of file irk_export.hpp.

std::vector<ExportVariable> ImplicitRungeKuttaExport::polynVariables
protected

Variables containing the coefficients for the polynomial.

Definition at line 553 of file irk_export.hpp.

bool ImplicitRungeKuttaExport::REUSE
protected

This boolean is true when the IFTR method is used instead of the IFT method.

Definition at line 519 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_A
protected

Variable containing the matrix of the linear system.

Definition at line 561 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_auxSolver
protected

Variable containing auxiliary values for the exported linear solver.

Definition at line 563 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_b
protected

Variable containing the right-hand side of the linear system.

Definition at line 562 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_diffK
protected

Definition at line 571 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_diffsOutputTemp
protected

Variable containing intermediate results of evaluations of the derivatives of an output function.

Definition at line 542 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_diffsTemp3
protected

Definition at line 569 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_dk1
protected

Definition at line 559 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_dk3
protected

Definition at line 568 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_mat1
protected

Definition at line 558 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_mat3
protected

Definition at line 567 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_out
protected

Variable that is used for the evaluations of the continuous output.

Definition at line 544 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_outH
protected

Variable that is used for the evaluations of the continuous output.

Definition at line 543 of file irk_export.hpp.

std::vector<ExportVariable> ImplicitRungeKuttaExport::rk_outputs
protected

Variables containing the evaluations of the continuous output from the integrator.

Definition at line 552 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_rhsOutputTemp
protected

Variable containing intermediate results of evaluations of the right-hand side expression of an output function.

Definition at line 541 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::rk_rhsTemp
protected

Variable containing intermediate results of evaluations of the right-hand side expression.

Definition at line 564 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::simplified_transf1
protected

Definition at line 575 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::simplified_transf1_T
protected

Definition at line 577 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::simplified_transf2
protected

Definition at line 576 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::simplified_transf2_T
protected

Definition at line 578 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::single_transf1
protected

Definition at line 582 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::single_transf1_T
protected

Definition at line 585 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::single_transf2
protected

Definition at line 583 of file irk_export.hpp.

DMatrix ImplicitRungeKuttaExport::single_transf2_T
protected

Definition at line 586 of file irk_export.hpp.

ExportLinearSolver* ImplicitRungeKuttaExport::solver
protected

This is the exported linear solver that is used by the implicit Runge-Kutta method.

Definition at line 530 of file irk_export.hpp.

ExportVariable ImplicitRungeKuttaExport::stepsH
protected

Variable defining the different integration step sizes in case of a non equidistant grid.

Definition at line 547 of file irk_export.hpp.

double ImplicitRungeKuttaExport::tau
protected

Definition at line 580 of file irk_export.hpp.

std::vector<uint> ImplicitRungeKuttaExport::totalMeas
protected

This vector contains the total number of measurements per output (per shooting or integration interval, depending on grid type).

Definition at line 550 of file irk_export.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