Data class for defining models and everything that is related, to be passed to the integrator. More...
#include <model_data.hpp>
Public Member Functions | |
uint | addOutput (const OutputFcn &outputEquation_, const Grid &measurements) |
uint | addOutput (const std::string &output, const std::string &diffs_output, const uint dim, const Grid &measurements) |
uint | addOutput (const std::string &output, const std::string &diffs_output, const uint dim, const Grid &measurements, const std::string &colInd, const std::string &rowPtr) |
returnValue | clearIntegrationGrid () |
BooleanType | exportRhs () const |
uint | getDimOutput (uint index) const |
DVector | getDimOutputs () const |
returnValue | getDimOutputs (std::vector< uint > &dims) const |
const std::string | getFileNameModel () const |
returnValue | getIntegrationGrid (Grid &integrationGrid_) const |
returnValue | getLinearInput (DMatrix &M1_, DMatrix &A1_, DMatrix &B1_) const |
returnValue | getLinearOutput (DMatrix &M3_, DMatrix &A3_, OutputFcn &rhs_) const |
returnValue | getLinearOutput (DMatrix &M3_, DMatrix &A3_) const |
returnValue | getModel (DifferentialEquation &_f) const |
uint | getN () const |
const std::string | getNameDiffsOutput () const |
returnValue | getNameDiffsOutputs (std::vector< std::string > &names) const |
const std::string | getNameDiffsRhs () const |
const std::string | getNameOutput () const |
returnValue | getNameOutputs (std::vector< std::string > &names) const |
const std::string | getNameRhs () const |
returnValue | getNARXmodel (uint &_delay, DMatrix &_parms) const |
uint | getNDX () const |
uint | getNDX3 () const |
uint | getNOD () const |
returnValue | getNonlinearFeedback (DMatrix &C_, OutputFcn &feedb_) const |
uint | getNP () const |
uint | getNU () const |
DVector | getNumMeas () const |
uint | getNumOutputs () const |
returnValue | getNumSteps (DVector &_numSteps) const |
uint | getNX () const |
uint | getNX1 () const |
uint | getNX2 () const |
uint | getNX3 () const |
uint | getNXA () const |
uint | getNXA3 () const |
std::vector< DMatrix > | getOutputDependencies () const |
returnValue | getOutputExpressions (std::vector< Expression > &outputExpressions_) const |
returnValue | getOutputGrids (std::vector< Grid > &outputGrids_) const |
BooleanType | hasCompressedStorage () const |
BooleanType | hasDifferentialEquation () const |
BooleanType | hasEquidistantControlGrid () const |
BooleanType | hasOutputFunctions () const |
BooleanType | hasOutputs () const |
ModelData () | |
BooleanType | modelDimensionsSet () const |
returnValue | setDimensions (uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NDX3, uint _NXA, uint _NXA3, uint _NU, uint _NOD, uint _NP) |
returnValue | setIntegrationGrid (const Grid &_ocpGrid, const uint _numSteps) |
returnValue | setLinearInput (const DMatrix &M1_, const DMatrix &A1_, const DMatrix &B1_) |
returnValue | setLinearOutput (const DMatrix &M3_, const DMatrix &A3_, const OutputFcn &rhs_) |
returnValue | setLinearOutput (const DMatrix &M3_, const DMatrix &A3_, const std::string &_rhs3, const std::string &_diffs3) |
returnValue | setModel (const DifferentialEquation &_f) |
returnValue | setModel (const std::string &fileName, const std::string &_rhs_ODE, const std::string &_diffs_rhs_ODE) |
returnValue | setN (const uint N_) |
returnValue | setNARXmodel (const uint _delay, const DMatrix &_parms) |
returnValue | setNOD (const uint NOD_) |
returnValue | setNonlinearFeedback (const DMatrix &C_, const OutputFcn &feedb_) |
returnValue | setNP (const uint NP_) |
returnValue | setNU (const uint NU_) |
returnValue | setNumSteps (const DVector &_numSteps) |
Protected Attributes | |
DMatrix | A1 |
DMatrix | A3 |
DMatrix | B1 |
DMatrix | C |
std::vector< DVector > | colInd_outputs |
uint | delay |
DifferentialEquation | differentialEquation |
std::string | diffs3_name |
std::string | diffs_name |
std::vector< std::string > | diffs_outputNames |
std::vector< uint > | dim_outputs |
BooleanType | export_rhs |
std::string | externModel |
OutputFcn | feedb |
Grid | integrationGrid |
DMatrix | M1 |
DMatrix | M3 |
BooleanType | model_dimensions_set |
uint | N |
uint | NDX |
uint | NDX3 |
uint | NOD |
uint | NP |
uint | NU |
std::vector< uint > | num_meas |
DVector | numSteps |
uint | NX1 |
uint | NX2 |
uint | NX3 |
uint | NXA |
uint | NXA3 |
std::vector< Expression > | outputExpressions |
std::vector< Grid > | outputGrids |
std::vector< std::string > | outputNames |
DMatrix | parms |
OutputFcn | rhs3 |
std::string | rhs3_name |
std::string | rhs_name |
std::vector< DVector > | rowPtr_outputs |
Data class for defining models and everything that is related, to be passed to the integrator.
TODO: Rien
Definition at line 52 of file model_data.hpp.
BEGIN_NAMESPACE_ACADO ModelData::ModelData | ( | ) |
Default constructor.
Definition at line 44 of file model_data.cpp.
Adds an output function.
outputEquation_ | an output function to be added |
measurements | The measurement grid per interval \return SUCCESSFUL_RETURN |
Definition at line 80 of file model_data.cpp.
uint ModelData::addOutput | ( | const std::string & | output, |
const std::string & | diffs_output, | ||
const uint | dim, | ||
const Grid & | measurements | ||
) |
Adds an output function.
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
measurements | The measurement grid per interval \return SUCCESSFUL_RETURN |
Definition at line 106 of file model_data.cpp.
uint ModelData::addOutput | ( | const std::string & | output, |
const std::string & | diffs_output, | ||
const uint | dim, | ||
const Grid & | measurements, | ||
const std::string & | colInd, | ||
const std::string & | rowPtr | ||
) |
Adds an output function.
output | The output function to be added. |
diffs_output | The derivatives of the output function to be added. |
dim | The dimension of the output function. |
measurements | The measurement grid per interval |
colInd | DVector stores the column indices of the elements for Compressed Row Storage (CRS). |
rowPtr | DVector stores the locations that start a row for Compressed Row Storage (CRS). |
Definition at line 126 of file model_data.cpp.
returnValue ModelData::clearIntegrationGrid | ( | ) |
Clears any previously set integration grid.
Definition at line 431 of file model_data.cpp.
BooleanType ModelData::exportRhs | ( | ) | const |
Definition at line 465 of file model_data.cpp.
Returns the dimension of a specific output function.
index | The index of the output function. |
DVector ModelData::getDimOutputs | ( | ) | const |
Returns the dimensions of the different output functions.
Definition at line 591 of file model_data.cpp.
returnValue ModelData::getDimOutputs | ( | std::vector< uint > & | dims | ) | const |
Returns the dimensions of the different output functions.
Definition at line 607 of file model_data.cpp.
const std::string ModelData::getFileNameModel | ( | ) | const |
Definition at line 624 of file model_data.cpp.
returnValue ModelData::getIntegrationGrid | ( | Grid & | integrationGrid_ | ) | const |
Returns the grid to be used by the integrator.
Definition at line 389 of file model_data.cpp.
returnValue ModelData::getLinearInput | ( | DMatrix & | M1_, |
DMatrix & | A1_, | ||
DMatrix & | B1_ | ||
) | const |
returnValue ModelData::getLinearOutput | ( | DMatrix & | M3_, |
DMatrix & | A3_, | ||
OutputFcn & | rhs_ | ||
) | const |
returnValue ModelData::getLinearOutput | ( | DMatrix & | M3_, |
DMatrix & | A3_ | ||
) | const |
returnValue ModelData::getModel | ( | DifferentialEquation & | _f | ) | const |
Returns the differential equations in the model.
Definition at line 203 of file model_data.cpp.
uint ModelData::getN | ( | ) | const |
Returns number of shooting intervals.
Definition at line 557 of file model_data.cpp.
const std::string ModelData::getNameDiffsOutput | ( | ) | const |
Definition at line 644 of file model_data.cpp.
returnValue ModelData::getNameDiffsOutputs | ( | std::vector< std::string > & | names | ) | const |
Definition at line 655 of file model_data.cpp.
const std::string ModelData::getNameDiffsRhs | ( | ) | const |
Definition at line 634 of file model_data.cpp.
const std::string ModelData::getNameOutput | ( | ) | const |
Definition at line 639 of file model_data.cpp.
returnValue ModelData::getNameOutputs | ( | std::vector< std::string > & | names | ) | const |
Definition at line 649 of file model_data.cpp.
const std::string ModelData::getNameRhs | ( | ) | const |
Definition at line 629 of file model_data.cpp.
returnValue ModelData::getNARXmodel | ( | uint & | _delay, |
DMatrix & | _parms | ||
) | const |
Returns the polynomial NARX model.
Definition at line 210 of file model_data.cpp.
uint ModelData::getNDX | ( | ) | const |
Returns number of differential state derivatives.
Definition at line 507 of file model_data.cpp.
uint ModelData::getNDX3 | ( | ) | const |
Definition at line 516 of file model_data.cpp.
uint ModelData::getNOD | ( | ) | const |
Returns number of parameters.
Definition at line 551 of file model_data.cpp.
returnValue ModelData::getNonlinearFeedback | ( | DMatrix & | C_, |
OutputFcn & | feedb_ | ||
) | const |
uint ModelData::getNP | ( | ) | const |
Returns number of parameters.
Definition at line 546 of file model_data.cpp.
uint ModelData::getNU | ( | ) | const |
Returns number of control inputs.
Definition at line 540 of file model_data.cpp.
DVector ModelData::getNumMeas | ( | ) | const |
Returns the number of measurements for the different output functions.
Definition at line 614 of file model_data.cpp.
uint ModelData::getNumOutputs | ( | ) | const |
Returns the number of different output functions.
Definition at line 601 of file model_data.cpp.
returnValue ModelData::getNumSteps | ( | DVector & | _numSteps | ) | const |
Returns the number of integration steps along the horizon.
Definition at line 152 of file model_data.cpp.
uint ModelData::getNX | ( | ) | const |
Returns number of differential states.
Definition at line 478 of file model_data.cpp.
uint ModelData::getNX1 | ( | ) | const |
Definition at line 489 of file model_data.cpp.
uint ModelData::getNX2 | ( | ) | const |
Definition at line 495 of file model_data.cpp.
uint ModelData::getNX3 | ( | ) | const |
Definition at line 501 of file model_data.cpp.
uint ModelData::getNXA | ( | ) | const |
Returns number of algebraic states.
Definition at line 525 of file model_data.cpp.
uint ModelData::getNXA3 | ( | ) | const |
Definition at line 531 of file model_data.cpp.
std::vector< DMatrix > ModelData::getOutputDependencies | ( | ) | const |
Returns the dependency matrix for each output function, which is defined externally.
Definition at line 173 of file model_data.cpp.
returnValue ModelData::getOutputExpressions | ( | std::vector< Expression > & | outputExpressions_ | ) | const |
Returns the output functions.
Definition at line 166 of file model_data.cpp.
returnValue ModelData::getOutputGrids | ( | std::vector< Grid > & | outputGrids_ | ) | const |
BooleanType ModelData::hasCompressedStorage | ( | ) | const |
Definition at line 471 of file model_data.cpp.
BooleanType ModelData::hasDifferentialEquation | ( | ) | const |
Definition at line 452 of file model_data.cpp.
BooleanType ModelData::hasEquidistantControlGrid | ( | ) | const |
Definition at line 439 of file model_data.cpp.
BooleanType ModelData::hasOutputFunctions | ( | ) | const |
Definition at line 445 of file model_data.cpp.
BooleanType ModelData::hasOutputs | ( | ) | const |
Returns true if there are extra outputs, specified for the integrator.
Definition at line 145 of file model_data.cpp.
BooleanType ModelData::modelDimensionsSet | ( | ) | const |
Definition at line 459 of file model_data.cpp.
returnValue ModelData::setDimensions | ( | uint | _NX1, |
uint | _NX2, | ||
uint | _NX3, | ||
uint | _NDX, | ||
uint | _NDX3, | ||
uint | _NXA, | ||
uint | _NXA3, | ||
uint | _NU, | ||
uint | _NOD, | ||
uint | _NP | ||
) |
Assigns the model dimensions to be used by the integrator.
@param[in] _NX1 Number of differential states in linear input subsystem. @param[in] _NX2 Number of differential states in nonlinear subsystem. @param[in] _NX3 Number of differential states in linear output subsystem. @param[in] _NDX Number of differential states derivatives. @param[in] _NDX3 Number of differential states derivatives in the linear output subsystem. @param[in] _NXA Number of algebraic states. @param[in] _NXA3 Number of algebraic states in the linear output subsystem. @param[in] _NU Number of control inputs @param[in] _NOD Number of "online data" values @param[in] _NP Number of parameters \return SUCCESSFUL_RETURN
Definition at line 63 of file model_data.cpp.
returnValue ModelData::setIntegrationGrid | ( | const Grid & | _ocpGrid, |
const uint | _numSteps | ||
) |
Sets integration grid.
[in] | _ocpGrid | Evaluation grid for optimal control. |
[in] | numSteps | The number of integration steps along the horizon. |
Definition at line 396 of file model_data.cpp.
returnValue ModelData::setLinearInput | ( | const DMatrix & | M1_, |
const DMatrix & | A1_, | ||
const DMatrix & | B1_ | ||
) |
returnValue ModelData::setLinearOutput | ( | const DMatrix & | M3_, |
const DMatrix & | A3_, | ||
const OutputFcn & | rhs_ | ||
) |
returnValue ModelData::setLinearOutput | ( | const DMatrix & | M3_, |
const DMatrix & | A3_, | ||
const std::string & | _rhs3, | ||
const std::string & | _diffs3 | ||
) |
returnValue ModelData::setModel | ( | const DifferentialEquation & | _f | ) |
Assigns Differential Equation to be used by the integrator.
[in] | f | Differential equation. |
Definition at line 253 of file model_data.cpp.
returnValue ModelData::setModel | ( | const std::string & | fileName, |
const std::string & | _rhs_ODE, | ||
const std::string & | _diffs_rhs_ODE | ||
) |
Assigns the model to be used by the integrator.
[in] | _rhs_ODE | Name of the function, evaluating the ODE right-hand side. |
[in] | _diffs_rhs_ODE | Name of the function, evaluating the derivatives of the ODE right-hand side. |
Definition at line 370 of file model_data.cpp.
returnValue ModelData::setN | ( | const uint | N_ | ) |
Sets the number of shooting intervals.
[in] | N_ | The number of shooting intervals. |
Definition at line 563 of file model_data.cpp.
returnValue ModelData::setNARXmodel | ( | const uint | _delay, |
const DMatrix & | _parms | ||
) |
Assigns 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
Definition at line 280 of file model_data.cpp.
returnValue ModelData::setNOD | ( | const uint | NOD_ | ) |
Definition at line 584 of file model_data.cpp.
returnValue ModelData::setNonlinearFeedback | ( | const DMatrix & | C_, |
const OutputFcn & | feedb_ | ||
) |
returnValue ModelData::setNP | ( | const uint | NP_ | ) |
Definition at line 577 of file model_data.cpp.
returnValue ModelData::setNU | ( | const uint | NU_ | ) |
Definition at line 570 of file model_data.cpp.
returnValue ModelData::setNumSteps | ( | const DVector & | _numSteps | ) |
Sets the number of integration steps along the horizon.
Definition at line 159 of file model_data.cpp.
|
protected |
Definition at line 475 of file model_data.hpp.
|
protected |
Definition at line 479 of file model_data.hpp.
|
protected |
Definition at line 476 of file model_data.hpp.
|
protected |
Definition at line 482 of file model_data.hpp.
|
protected |
A separate DVector of column indices for each output if in CRS format.
Definition at line 466 of file model_data.hpp.
|
protected |
Definition at line 486 of file model_data.hpp.
|
protected |
The differential equations in the model.
Definition at line 455 of file model_data.hpp.
|
protected |
The name of the function evaluating the derivatives for the linear output system, if provided.
Definition at line 454 of file model_data.hpp.
|
protected |
The name of the function evaluating the derivatives of the ODE right-hand side, if provided.
Definition at line 452 of file model_data.hpp.
|
protected |
A separate function name for evaluating the derivatives of each output.
Definition at line 465 of file model_data.hpp.
|
protected |
Dimensions of the different output functions.
Definition at line 462 of file model_data.hpp.
|
protected |
True if the right-hand side and their derivatives should be exported too.
Definition at line 448 of file model_data.hpp.
|
protected |
The name of the file containing the needed functions, if provided.
Definition at line 450 of file model_data.hpp.
|
protected |
Definition at line 483 of file model_data.hpp.
|
protected |
Integration grid.
Definition at line 457 of file model_data.hpp.
|
protected |
Definition at line 474 of file model_data.hpp.
|
protected |
Definition at line 478 of file model_data.hpp.
|
protected |
True if the model dimensions have been set.
Definition at line 449 of file model_data.hpp.
|
protected |
Number of shooting intervals.
Definition at line 446 of file model_data.hpp.
|
protected |
Number of differential states derivatives.
Definition at line 439 of file model_data.hpp.
|
protected |
Number of differential states derivatives in output system.
Definition at line 440 of file model_data.hpp.
|
protected |
Number of online data values.
Definition at line 445 of file model_data.hpp.
|
protected |
Number of parameters.
Definition at line 444 of file model_data.hpp.
|
protected |
Number of control inputs.
Definition at line 443 of file model_data.hpp.
|
protected |
Number of measurements for the different output functions.
Definition at line 463 of file model_data.hpp.
|
protected |
The number of integration steps per shooting interval.
Definition at line 458 of file model_data.hpp.
|
protected |
Number of differential states (defined by input system).
Definition at line 436 of file model_data.hpp.
|
protected |
Number of differential states (defined by implicit system).
Definition at line 437 of file model_data.hpp.
|
protected |
Number of differential states (defined by output system).
Definition at line 438 of file model_data.hpp.
|
protected |
Number of algebraic states.
Definition at line 441 of file model_data.hpp.
|
protected |
Number of algebraic states in output system.
Definition at line 442 of file model_data.hpp.
|
protected |
A vector with the output functions.
Definition at line 460 of file model_data.hpp.
|
protected |
A separate grid for each output function.
Definition at line 461 of file model_data.hpp.
|
protected |
A separate function name for each output.
Definition at line 464 of file model_data.hpp.
|
protected |
Definition at line 487 of file model_data.hpp.
|
protected |
Definition at line 480 of file model_data.hpp.
|
protected |
The name of the nonlinear function in the linear output system, if provided.
Definition at line 453 of file model_data.hpp.
|
protected |
The name of the function evaluating the ODE right-hand side, if provided.
Definition at line 451 of file model_data.hpp.
|
protected |
A separate DVector of row pointers for each output if in CRS format.
Definition at line 467 of file model_data.hpp.