46 const std::string& _commonHeaderName
92 if(
this != &arg && &arg != 0 )
112 LOG(
LVL_DEBUG ) <<
"Integrator: setLinearInput... " << endl;
225 for( i = 0; i < _rhs.getDim(); i++ ) {
235 DMatrix dependencyMat = _rhs.getDependencyPattern(
x );
245 f_large << _rhs + A3_large*
x;
304 LOG(
LVL_DEBUG ) <<
"Integrator: setup model data... " << endl;
313 Grid integrationGrid;
315 grid = integrationGrid;
333 if( (NX1+i) != (
uint)order(i) ) {
375 std::vector<Grid> outputGrids_;
377 std::vector<Expression> outputExpressions_;
380 if( outputExpressions_.size() > 0 ) {
384 std::vector<std::string> outputNames;
385 std::vector<std::string> diffs_outputNames;
386 std::vector<uint> dim_outputs;
392 setupOutput( outputGrids_, outputNames, diffs_outputNames, dim_outputs );
395 setupOutput( outputGrids_, outputNames, diffs_outputNames, dim_outputs, outputDependencies_ );
505 for( index3 = 1; index3 <
NX1; index3++ ) {
508 for( index3 = 0; index3 <
NX2; index3++ ) {
517 for( index3 = 1; index3 <
NX2; index3++ ) {
526 for( index3 = 0; index3 <
NX1; index3++ ) {
529 for( index3 = 0; index3 <
NX2; index3++ ) {
631 for( i = 0; i <
NX3; i++ ) {
632 for( j = 0; j <
NX3; j++ ) {
633 result(i,
NX-NX3+j) = A3(i,j);
726 return outputs[index].getName();
ExportVariable rk_diffsPrev1
returnValue setDimensions(uint _NX=0, uint _NU=0, uint _NP=0, uint _NI=0, uint _NOD=0)
#define LOG(level)
Just define a handy macro for getting the logger.
virtual returnValue setLinearOutput(const DMatrix &M3, const DMatrix &A3, const Expression &rhs)
Lowest level, the debug level.
uint getIntegrationInterval(double time)
Allows to setup and evaluate output functions based on SymbolicExpressions.
virtual returnValue getNumSteps(DVector &_numSteps) const
double getTime(uint pointIdx) const
returnValue getNonlinearFeedback(DMatrix &C_, OutputFcn &feedb_) const
std::vector< DMatrix > getOutputDependencies() const
double getFirstTime() const
DVector getDimOutputs() const
returnValue getOutputExpressions(std::vector< Expression > &outputExpressions_) const
std::vector< Grid > outputGrids
DVector getDifferentialStateComponents() const
Allows to export code of an ACADO function.
virtual returnValue updateImplicitSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
ExportAcadoFunction diffs_rhs
virtual ~IntegratorExport()
std::vector< ExportAcadoFunction > outputs
ExportVariable rk_diffsPrev3
Allows to pass back messages to the calling function.
virtual returnValue setModel(const std::string &_name_ODE, const std::string &_name_diffs_ODE)
Expression forwardDerivative(const Expression &arg1, const Expression &arg2)
AlgorithmicBase & operator=(const AlgorithmicBase &rhs)
virtual returnValue setGrid(const Grid &_grid)
Block< Derived > block(Index startRow, Index startCol, Index blockRows, Index blockCols)
returnValue getModel(DifferentialEquation &_f) const
const std::string getNameOUTPUT(uint index) const
virtual returnValue propagateImplicitSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &_index3, const ExportIndex &tmp_index)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
std::vector< ExportAcadoFunction > diffs_outputs
ExportVariable rk_diffsPrev2
Allows to conveniently handle (one-dimensional) grids consisting of time points.
DMatrix expandOutputMatrix(const DMatrix &A3)
Allows to export code of a for-loop.
const std::string getNameDiffsOUTPUT(uint index) const
const std::string getNameOutputDiffs() const
virtual returnValue setNonlinearFeedback(const DMatrix &C, const Expression &feedb)
#define CLOSE_NAMESPACE_ACADO
ExportVariable rk_diffsNew3
Data class for defining models and everything that is related, to be passed to the integrator...
ExportVariable getSubMatrix(const ExportIndex &rowIdx1, const ExportIndex &rowIdx2, const ExportIndex &colIdx1, const ExportIndex &colIdx2) const
returnValue getExpression(Expression &expression) const
const std::string getNameDiffsRHS() const
unsigned getFunctionDim(void)
returnValue getLinearOutput(DMatrix &M3_, DMatrix &A3_, OutputFcn &rhs_) const
Defines a scalar-valued index variable to be used for exporting code.
virtual returnValue setNARXmodel(const uint delay, const DMatrix &parms)=0
IntegratorExport(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
Base class for all variables within the symbolic expressions family.
Allows to export automatically generated algorithms for fast model predictive control.
returnValue getNameDiffsOutputs(std::vector< std::string > &names) const
const std::string getNameRhs() const
const std::string getNameDiffsOutput() const
ExportAcadoFunction diffs_rhs3
const std::string getNameDiffsRhs() const
std::vector< Expression > outputExpressions
const std::string getNameOutputRHS() const
int acadoRoundAway(double x)
returnValue getIntegrationGrid(Grid &integrationGrid_) const
returnValue getOutputGrids(std::vector< Grid > &outputGrids_) const
const std::string getNameRHS() const
virtual returnValue propagateOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index)
virtual returnValue setLinearInput(const DMatrix &M1, const DMatrix &A1, const DMatrix &B1)
BooleanType hasOutputs() const
Encapsulates all user interaction for setting options, logging data and plotting results.
virtual returnValue propagateInputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index)
returnValue addStatement(const ExportStatement &_statement)
virtual returnValue updateInputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
BooleanType hasCompressedStorage() const
unsigned getNumRows() const
virtual returnValue copy(const IntegratorExport &arg)
std::vector< uint > num_outputs
uint getDimOUTPUT(uint index) const
Allows to export a tailored integrator for fast model predictive control.
ExportVariable rk_diffsNew2
unsigned getNumCols() const
uint getNumIntervals() const
returnValue getNumSteps(DVector &_numSteps) const
virtual returnValue setModelData(const ModelData &data)
returnValue getNARXmodel(uint &_delay, DMatrix &_parms) const
GenericVector< T > sumRow() const
returnValue getLinearInput(DMatrix &M1_, DMatrix &A1_, DMatrix &B1_) const
DifferentialStateDerivative dx
std::string getName() const
virtual returnValue getGrid(Grid &grid_) const
ExportAcadoFunction lin_input
double getLastTime() const
virtual returnValue getOutputGrids(std::vector< Grid > &outputGrids_) const
#define BEGIN_NAMESPACE_ACADO
virtual const std::string getNameFullRHS() const
ExportVariable error_code
returnValue clearStaticCounters()
const std::string getNameOutput() const
virtual returnValue setupOutput(const std::vector< Grid > outputGrids_, const std::vector< Expression > rhs)=0
IntegratorExport & operator=(const IntegratorExport &arg)
ExportVariable rk_diffsNew1
returnValue getNameOutputs(std::vector< std::string > &names) const
virtual returnValue setup()=0
virtual returnValue setDifferentialEquation(const Expression &rhs)=0
virtual returnValue clear()
BooleanType exportRhs() const
Allows to export code for a block of statements.
virtual returnValue getOutputExpressions(std::vector< Expression > &outputExpressions_) const
virtual returnValue updateOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
ExportVariable getCol(const ExportIndex &idx) const
returnValue init(const Function &_f, const std::string &_name="acadoFcn", const uint _numX=0, const uint _numXA=0, const uint _numU=0, const uint _numP=0, const uint _numDX=0, const uint _numOD=0)
#define ACADOERROR(retval)
virtual bool equidistantControlGrid() const
Defines a matrix-valued variable to be used for exporting code.
#define ACADOERRORTEXT(retval, text)
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.