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 |
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 | setNumSteps (const DVector &_numSteps) |
Protected Attributes | |
DMatrix | A1 |
DMatrix | A3 |
DMatrix | B1 |
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 |
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.
Default constructor.
Definition at line 44 of file model_data.cpp.
uint ModelData::addOutput | ( | const OutputFcn & | outputEquation_, |
const Grid & | measurements | ||
) |
Adds an output function.
outputEquation_ | an output function to be added |
measurements | The measurement grid per interval |
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 |
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.
Clears any previously set integration grid.
Definition at line 411 of file model_data.cpp.
BooleanType ModelData::exportRhs | ( | ) | const |
Definition at line 445 of file model_data.cpp.
uint ModelData::getDimOutput | ( | uint | index | ) | const |
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 550 of file model_data.cpp.
returnValue ModelData::getDimOutputs | ( | std::vector< uint > & | dims | ) | const |
Returns the dimensions of the different output functions.
Definition at line 566 of file model_data.cpp.
const std::string ModelData::getFileNameModel | ( | ) | const |
Definition at line 583 of file model_data.cpp.
returnValue ModelData::getIntegrationGrid | ( | Grid & | integrationGrid_ | ) | const |
Returns the grid to be used by the integrator.
Definition at line 369 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 537 of file model_data.cpp.
const std::string ModelData::getNameDiffsOutput | ( | ) | const |
Definition at line 603 of file model_data.cpp.
returnValue ModelData::getNameDiffsOutputs | ( | std::vector< std::string > & | names | ) | const |
Definition at line 614 of file model_data.cpp.
const std::string ModelData::getNameDiffsRhs | ( | ) | const |
Definition at line 593 of file model_data.cpp.
const std::string ModelData::getNameOutput | ( | ) | const |
Definition at line 598 of file model_data.cpp.
returnValue ModelData::getNameOutputs | ( | std::vector< std::string > & | names | ) | const |
Definition at line 608 of file model_data.cpp.
const std::string ModelData::getNameRhs | ( | ) | const |
Definition at line 588 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 487 of file model_data.cpp.
uint ModelData::getNDX3 | ( | ) | const |
Definition at line 496 of file model_data.cpp.
uint ModelData::getNOD | ( | ) | const |
Returns number of parameters.
Definition at line 531 of file model_data.cpp.
uint ModelData::getNP | ( | ) | const |
Returns number of parameters.
Definition at line 526 of file model_data.cpp.
uint ModelData::getNU | ( | ) | const |
Returns number of control inputs.
Definition at line 520 of file model_data.cpp.
DVector ModelData::getNumMeas | ( | ) | const |
Returns the number of measurements for the different output functions.
Definition at line 573 of file model_data.cpp.
uint ModelData::getNumOutputs | ( | ) | const |
Returns the number of different output functions.
Definition at line 560 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 458 of file model_data.cpp.
uint ModelData::getNX1 | ( | ) | const |
Definition at line 469 of file model_data.cpp.
uint ModelData::getNX2 | ( | ) | const |
Definition at line 475 of file model_data.cpp.
uint ModelData::getNX3 | ( | ) | const |
Definition at line 481 of file model_data.cpp.
uint ModelData::getNXA | ( | ) | const |
Returns number of algebraic states.
Definition at line 505 of file model_data.cpp.
uint ModelData::getNXA3 | ( | ) | const |
Definition at line 511 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 451 of file model_data.cpp.
Definition at line 432 of file model_data.cpp.
Definition at line 419 of file model_data.cpp.
BooleanType ModelData::hasOutputFunctions | ( | ) | const |
Definition at line 425 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 439 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.
[in] | _NX1 | Number of differential states in linear input subsystem. |
[in] | _NX2 | Number of differential states in nonlinear subsystem. |
[in] | _NX3 | Number of differential states in linear output subsystem. |
[in] | _NDX | Number of differential states derivatives. |
[in] | _NDX3 | Number of differential states derivatives in the linear output subsystem. |
[in] | _NXA | Number of algebraic states. |
[in] | _NXA3 | Number of algebraic states in the linear output subsystem. |
[in] | _NU | Number of control inputs |
[in] | _NOD | Number of "online data" values |
[in] | _NP | Number of parameters |
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 376 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 245 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 350 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 543 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.
[in] | delay | The delay for the states in the NARX model. |
[in] | parms | The parameters defining the polynomial NARX model. |
Definition at line 272 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.
DMatrix ModelData::A1 [protected] |
Definition at line 454 of file model_data.hpp.
DMatrix ModelData::A3 [protected] |
Definition at line 458 of file model_data.hpp.
DMatrix ModelData::B1 [protected] |
Definition at line 455 of file model_data.hpp.
std::vector<DVector> ModelData::colInd_outputs [protected] |
A separate DVector of column indices for each output if in CRS format.
Definition at line 445 of file model_data.hpp.
uint ModelData::delay [protected] |
Definition at line 462 of file model_data.hpp.
DifferentialEquation ModelData::differentialEquation [protected] |
The differential equations in the model.
Definition at line 434 of file model_data.hpp.
std::string ModelData::diffs3_name [protected] |
The name of the function evaluating the derivatives for the linear output system, if provided.
Definition at line 433 of file model_data.hpp.
std::string ModelData::diffs_name [protected] |
The name of the function evaluating the derivatives of the ODE right-hand side, if provided.
Definition at line 431 of file model_data.hpp.
std::vector<std::string> ModelData::diffs_outputNames [protected] |
A separate function name for evaluating the derivatives of each output.
Definition at line 444 of file model_data.hpp.
std::vector<uint> ModelData::dim_outputs [protected] |
Dimensions of the different output functions.
Definition at line 441 of file model_data.hpp.
BooleanType ModelData::export_rhs [protected] |
True if the right-hand side and their derivatives should be exported too.
Definition at line 427 of file model_data.hpp.
std::string ModelData::externModel [protected] |
The name of the file containing the needed functions, if provided.
Definition at line 429 of file model_data.hpp.
Grid ModelData::integrationGrid [protected] |
Integration grid.
Definition at line 436 of file model_data.hpp.
DMatrix ModelData::M1 [protected] |
Definition at line 453 of file model_data.hpp.
DMatrix ModelData::M3 [protected] |
Definition at line 457 of file model_data.hpp.
BooleanType ModelData::model_dimensions_set [protected] |
True if the model dimensions have been set.
Definition at line 428 of file model_data.hpp.
uint ModelData::N [protected] |
Number of shooting intervals.
Definition at line 425 of file model_data.hpp.
uint ModelData::NDX [protected] |
Number of differential states derivatives.
Definition at line 418 of file model_data.hpp.
uint ModelData::NDX3 [protected] |
Number of differential states derivatives in output system.
Definition at line 419 of file model_data.hpp.
uint ModelData::NOD [protected] |
Number of online data values.
Definition at line 424 of file model_data.hpp.
uint ModelData::NP [protected] |
Number of parameters.
Definition at line 423 of file model_data.hpp.
uint ModelData::NU [protected] |
Number of control inputs.
Definition at line 422 of file model_data.hpp.
std::vector<uint> ModelData::num_meas [protected] |
Number of measurements for the different output functions.
Definition at line 442 of file model_data.hpp.
DVector ModelData::numSteps [protected] |
The number of integration steps per shooting interval.
Definition at line 437 of file model_data.hpp.
uint ModelData::NX1 [protected] |
Number of differential states (defined by input system).
Definition at line 415 of file model_data.hpp.
uint ModelData::NX2 [protected] |
Number of differential states (defined by implicit system).
Definition at line 416 of file model_data.hpp.
uint ModelData::NX3 [protected] |
Number of differential states (defined by output system).
Definition at line 417 of file model_data.hpp.
uint ModelData::NXA [protected] |
Number of algebraic states.
Definition at line 420 of file model_data.hpp.
uint ModelData::NXA3 [protected] |
Number of algebraic states in output system.
Definition at line 421 of file model_data.hpp.
std::vector<Expression> ModelData::outputExpressions [protected] |
A vector with the output functions.
Definition at line 439 of file model_data.hpp.
std::vector<Grid> ModelData::outputGrids [protected] |
A separate grid for each output function.
Definition at line 440 of file model_data.hpp.
std::vector<std::string> ModelData::outputNames [protected] |
A separate function name for each output.
Definition at line 443 of file model_data.hpp.
DMatrix ModelData::parms [protected] |
Definition at line 463 of file model_data.hpp.
OutputFcn ModelData::rhs3 [protected] |
Definition at line 459 of file model_data.hpp.
std::string ModelData::rhs3_name [protected] |
The name of the nonlinear function in the linear output system, if provided.
Definition at line 432 of file model_data.hpp.
std::string ModelData::rhs_name [protected] |
The name of the function evaluating the ODE right-hand side, if provided.
Definition at line 430 of file model_data.hpp.
std::vector<DVector> ModelData::rowPtr_outputs [protected] |
A separate DVector of row pointers for each output if in CRS format.
Definition at line 446 of file model_data.hpp.