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

Allows to export a tailored discrete-time 'integrator' for fast model predictive control. More...

#include <discrete_export.hpp>

Inheritance diagram for DiscreteTimeExport:
Inheritance graph
[legend]

Public Member Functions

 DiscreteTimeExport (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
 
 DiscreteTimeExport (const DiscreteTimeExport &arg)
 
virtual returnValue getCode (ExportStatementBlock &code)
 
virtual returnValue getDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
 
virtual returnValue getFunctionDeclarations (ExportStatementBlock &declarations) const
 
DiscreteTimeExportoperator= (const DiscreteTimeExport &arg)
 
virtual returnValue setDifferentialEquation (const Expression &rhs)
 
virtual returnValue setNARXmodel (const uint delay, const DMatrix &parms)
 
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 ~DiscreteTimeExport ()
 
- 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 setModel (const std::string &_name_ODE, const std::string &_name_diffs_ODE)
 
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

virtual returnValue copy (const DiscreteTimeExport &arg)
 
ExportVariable getAuxVariable () const
 
- 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

ExportVariable rk_diffsTemp3
 
- 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 discrete-time 'integrator' for fast model predictive control.

The class DiscreteTimeExport allows to export a tailored discrete-time 'integrator' for fast model predictive control.

Author
Rien Quirynen

Definition at line 56 of file discrete_export.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO DiscreteTimeExport::DiscreteTimeExport ( 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 discrete_export.cpp.

DiscreteTimeExport::DiscreteTimeExport ( const DiscreteTimeExport arg)

Copy constructor (deep copy).

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

Definition at line 51 of file discrete_export.cpp.

DiscreteTimeExport::~DiscreteTimeExport ( )
virtual

Destructor.

Definition at line 58 of file discrete_export.cpp.

Member Function Documentation

returnValue DiscreteTimeExport::copy ( const DiscreteTimeExport arg)
protectedvirtual

Copies all class members from given object.

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

\return SUCCESSFUL_RETURN

Definition at line 496 of file discrete_export.cpp.

ExportVariable DiscreteTimeExport::getAuxVariable ( ) const
protectedvirtual

Returns the largest global export variable.

\return SUCCESSFUL_RETURN

Implements IntegratorExport.

Definition at line 469 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 IntegratorExport.

Definition at line 337 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 IntegratorExport.

Reimplemented in NARXExport.

Definition at line 102 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 IntegratorExport.

Definition at line 124 of file discrete_export.cpp.

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

Assignment operator (deep copy).

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

Definition at line 442 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 IntegratorExport.

Reimplemented in NARXExport.

Definition at line 64 of file discrete_export.cpp.

returnValue DiscreteTimeExport::setNARXmodel ( const uint  delay,
const DMatrix parms 
)
virtual

Sets a polynomial NARX model to be used by the integrator.

@param[in] delay            The delay for the states in the NARX model.
@param[in] parms            The parameters defining the polynomial NARX model.

\return SUCCESSFUL_RETURN

Implements IntegratorExport.

Reimplemented in NARXExport.

Definition at line 411 of file discrete_export.cpp.

returnValue DiscreteTimeExport::setup ( )
virtual

Initializes export of a tailored integrator.

\return SUCCESSFUL_RETURN

Implements IntegratorExport.

Reimplemented in NARXExport.

Definition at line 136 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 IntegratorExport.

Definition at line 417 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 423 of file discrete_export.cpp.

returnValue DiscreteTimeExport::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 432 of file discrete_export.cpp.

Member Data Documentation

ExportVariable DiscreteTimeExport::rk_diffsTemp3
protected

Definition at line 216 of file discrete_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:23