45 const std::string& _commonHeaderName
89 for(
uint i = 0; i < rhs_.getDim(); i++ ) {
147 LOG(
LVL_DEBUG ) <<
"Preparing to export DiscreteTimeExport... " << endl;
166 rk_eta.
setDoc(
"Working array to pass the input values and return the results." );
167 reset_int.
setDoc(
"The internal memory of the integrator can be reset." );
168 rk_index.setDoc(
"Number of the shooting interval." );
170 integrate.
doc(
"Performs the integration and sensitivity propagation for one shooting interval." );
181 fullRhs.
doc(
"Evaluates the right-hand side of the full model." );
203 for(
uint i1 = 0; i1 <
NX1; i1++ ) {
204 for(
uint i2 = 0; i2 <
NX1; i2++ ) {
207 for(
uint i2 = 0; i2 <
NU; i2++ ) {
214 for(
uint i1 = 0; i1 <
NX3; i1++ ) {
215 for(
uint i2 = 0; i2 <
NX3; i2++ ) {
237 loop->addStatement( std::string(
"if( run > 0 ) {\n") );
242 loop->addStatement( loopTemp1 );
248 loop->addStatement( loopTemp2 );
254 loop->addStatement( loopTemp3 );
256 loop->addStatement( std::string(
"}\n") );
283 loop->addStatement( loop1 );
288 loop->addStatement( std::string(
"if( run == 0 ) {\n" ) );
298 loop->addStatement( std::string(
"}\n" ) );
299 loop->addStatement( std::string(
"else {\n" ) );
306 loop->addStatement( std::string(
"}\n" ) );
311 loop->addStatement(
"}\n" );
358 s <<
"#pragma omp threadprivate( " 365 if(
NX2 > 0 ||
NXA > 0 ) {
374 s <<
" )" << endl << endl;
424 const std::vector<std::string> _outputNames,
425 const std::vector<std::string> _diffs_outputNames,
426 const std::vector<uint> _dims_output ) {
433 const std::vector<std::string> _outputNames,
434 const std::vector<std::string> _diffs_outputNames,
435 const std::vector<uint> _dims_output,
436 const std::vector<DMatrix> _outputDependencies ) {
463 const std::string &_commonHeaderName )
ExportVariable rk_diffsPrev1
#define LOG(level)
Just define a handy macro for getting the logger.
Lowest level, the debug level.
virtual returnValue copy(const DiscreteTimeExport &arg)
ExportVariable getAuxVariable() const
ExportVariable getGlobalExportVariable() const
virtual returnValue setupOutput(const std::vector< Grid > outputGrids_, const std::vector< Expression > rhs)
double getFirstTime() const
virtual returnValue updateImplicitSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
ExportAcadoFunction diffs_rhs
ExportVariable rk_diffsPrev3
Allows to pass back messages to the calling function.
Expression forwardDerivative(const Expression &arg1, const Expression &arg2)
returnValue addComment(const std::string &_comment)
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
ExportVariable rk_diffsPrev2
Allows to export code of a for-loop.
string toString(T const &value)
returnValue setName(const std::string &_name)
const std::string getNameOutputDiffs() const
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
#define CLOSE_NAMESPACE_ACADO
ExportVariable rk_diffsNew3
ExportVariable getSubMatrix(const ExportIndex &rowIdx1, const ExportIndex &rowIdx2, const ExportIndex &colIdx1, const ExportIndex &colIdx2) const
const std::string getNameDiffsRHS() const
Defines a scalar-valued index variable to be used for exporting code.
Base class for all variables within the symbolic expressions family.
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
virtual returnValue setDoc(const std::string &_doc)
ExportAcadoFunction diffs_rhs3
virtual returnValue getCode(ExportStatementBlock &code)
virtual ExportFunction & doc(const std::string &_doc)
DiscreteTimeExport(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
const std::string getNameOutputRHS() const
ExportVariable getCols(const ExportIndex &idx1, const ExportIndex &idx2) const
virtual returnValue setNARXmodel(const uint delay, const DMatrix &parms)
virtual returnValue setup()
const std::string getNameRHS() const
virtual returnValue propagateOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index)
Allows to export a tailored discrete-time 'integrator' for fast model predictive control.
ExportVariable rk_diffsTemp3
Encapsulates all user interaction for setting options, logging data and plotting results.
Allows to export code of an arbitrary function.
virtual uint getDim() const
returnValue setDataStruct(ExportStruct _dataStruct)
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)
std::string getFullName() const
returnValue addLinebreak(uint num=1)
virtual ~DiscreteTimeExport()
Allows to export a tailored integrator for fast model predictive control.
ExportFunction & setReturnValue(const ExportVariable &_functionReturnValue, bool _returnAsPointer=false)
ExportVariable rk_diffsNew2
DiscreteTimeExport & operator=(const DiscreteTimeExport &arg)
uint getNumIntervals() const
returnValue setGlobalExportVariable(const ExportVariable &var)
DifferentialStateDerivative dx
std::string getName() const
returnValue addDeclaration(const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
ExportAcadoFunction lin_input
double getLastTime() const
virtual returnValue setDifferentialEquation(const Expression &rhs)
#define BEGIN_NAMESPACE_ACADO
ExportVariable error_code
returnValue clearStaticCounters()
returnValue addFunction(const ExportFunction &_function)
IntegratorExport & operator=(const IntegratorExport &arg)
ExportVariable rk_diffsNew1
virtual returnValue clear()
IntegratorExport * createDiscreteTimeExport(UserInteraction *_userInteraction, const std::string &_commonHeaderName)
Allows to export code for a block of statements.
ExportArgument getAddress(const ExportIndex &_rowIdx, const ExportIndex &_colIdx=emptyConstExportIndex) const
virtual returnValue updateOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index)
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)
ExportFunction & addIndex(const ExportIndex &_index)
#define ACADOERROR(retval)
virtual bool equidistantControlGrid() const
Defines a matrix-valued variable to be used for exporting code.
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.
std::string getName() const