model_data.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
33 #ifndef ACADO_TOOLKIT_MODELDATA_HPP
34 #define ACADO_TOOLKIT_MODELDATA_HPP
35 
37 
38 
40 
41 
52 class ModelData {
53 
54 
55 //
56 // PUBLIC MEMBER FUNCTIONS:
57 //
58 public:
59 
60 
64  ModelData( );
65 
66 
82  returnValue setDimensions( uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NDX3, uint _NXA, uint _NXA3, uint _NU, uint _NOD, uint _NP );
83 
84 
92  uint addOutput( const OutputFcn& outputEquation_, const Grid& measurements );
93 
94 
104  uint addOutput( const std::string& output, const std::string& diffs_output, const uint dim, const Grid& measurements );
105 
106 
118  uint addOutput( const std::string& output, const std::string& diffs_output, const uint dim,
119  const Grid& measurements, const std::string& colInd, const std::string& rowPtr );
120 
121 
126  BooleanType hasOutputs () const;
127 
128 
135  uint getDimOutput( uint index ) const;
136 
137 
142  returnValue getNumSteps( DVector& _numSteps ) const;
143 
144 
149  returnValue setNumSteps( const DVector& _numSteps );
150 
151 
156  returnValue getOutputExpressions( std::vector<Expression>& outputExpressions_ ) const;
157 
158 
163  returnValue getOutputGrids( std::vector<Grid>& outputGrids_ ) const;
164 
165 
170  std::vector<DMatrix> getOutputDependencies( ) const;
171 
172 
181 
182 
190  returnValue setNARXmodel( const uint _delay, const DMatrix& _parms );
191 
192 
199  returnValue setLinearInput( const DMatrix& M1_, const DMatrix& A1_, const DMatrix& B1_ );
200 
201 
208  returnValue setLinearOutput( const DMatrix& M3_, const DMatrix& A3_, const OutputFcn& rhs_ );
209 
210 
217  returnValue setNonlinearFeedback( const DMatrix& C_, const OutputFcn& feedb_ );
218 
219 
226  returnValue setLinearOutput( const DMatrix& M3_, const DMatrix& A3_,
227  const std::string& _rhs3,
228  const std::string& _diffs3 );
229 
230 
239  returnValue setModel( const std::string& fileName,
240  const std::string& _rhs_ODE,
241  const std::string& _diffs_rhs_ODE );
242 
243 
248  returnValue getIntegrationGrid( Grid& integrationGrid_ ) const;
249 
250 
258  returnValue setIntegrationGrid( const Grid& _ocpGrid,
259  const uint _numSteps );
260 
261 
267 
268 
274 
275 
280  returnValue getNARXmodel( uint& _delay, DMatrix& _parms ) const;
281 
282 
289  returnValue getLinearInput( DMatrix& M1_, DMatrix& A1_, DMatrix& B1_ ) const;
290 
291 
298  returnValue getLinearOutput( DMatrix& M3_, DMatrix& A3_, OutputFcn& rhs_ ) const;
299 
300 
307  returnValue getNonlinearFeedback( DMatrix& C_, OutputFcn& feedb_ ) const;
308 
309 
316  returnValue getLinearOutput( DMatrix& M3_, DMatrix& A3_ ) const;
317 
318 
323  BooleanType exportRhs() const;
325 
326 
331  uint getNX( ) const;
332  uint getNX1( ) const;
333  uint getNX2( ) const;
334  uint getNX3( ) const;
335 
336 
341  uint getNDX( ) const;
342  uint getNDX3( ) const;
343 
344 
349  uint getNXA( ) const;
350  uint getNXA3( ) const;
351 
356  uint getNU( ) const;
357  returnValue setNU( const uint NU_ );
358 
363  uint getNP( ) const;
364  returnValue setNP( const uint NP_ );
365 
370  uint getNOD( ) const;
371  returnValue setNOD( const uint NOD_ );
372 
377  uint getN( ) const;
378 
385  returnValue setN( const uint N_ );
386 
387 
392  DVector getDimOutputs( ) const;
393 
394 
399  uint getNumOutputs( ) const;
400 
401 
406  returnValue getDimOutputs( std::vector<uint>& dims ) const;
407 
408 
413  DVector getNumMeas( ) const;
414 
415 
416  const std::string getFileNameModel() const;
417  const std::string getNameRhs() const;
418  const std::string getNameDiffsRhs() const;
419  const std::string getNameOutput() const;
420  const std::string getNameDiffsOutput() const;
421  returnValue getNameOutputs( std::vector<std::string>& names ) const;
422  returnValue getNameDiffsOutputs( std::vector<std::string>& names ) const;
423 
424 
425  //
426  // PROTECTED FUNCTIONS:
427  //
428  protected:
429 
430 
431  //
432  // DATA MEMBERS:
433  //
434  protected:
435 
446  uint N;
450  std::string externModel;
451  std::string rhs_name;
452  std::string diffs_name;
453  std::string rhs3_name;
454  std::string diffs3_name;
460  std::vector<Expression> outputExpressions;
461  std::vector<Grid> outputGrids;
462  std::vector<uint> dim_outputs;
463  std::vector<uint> num_meas;
464  std::vector<std::string> outputNames;
465  std::vector<std::string> diffs_outputNames;
466  std::vector<DVector> colInd_outputs;
467  std::vector<DVector> rowPtr_outputs;
469  // ------------------------------------
470  // ------------------------------------
471  // NEW VARIABLES IN VERSION 2.0:
472  // ------------------------------------
473  // ------------------------------------
477 
481 
484 
485  // NARX model:
488 
489 };
490 
491 
493 
494 
495 
496 #endif // ACADO_TOOLKIT_MODELDATA_HPP
497 
498 /*
499  * end of file
500  */
std::vector< DVector > colInd_outputs
Definition: model_data.hpp:466
DVector numSteps
Definition: model_data.hpp:458
returnValue setIntegrationGrid(const Grid &_ocpGrid, const uint _numSteps)
Definition: model_data.cpp:396
DifferentialEquation differentialEquation
Definition: model_data.hpp:455
Allows to setup and evaluate output functions based on SymbolicExpressions.
Definition: output_fcn.hpp:55
returnValue setNP(const uint NP_)
Definition: model_data.cpp:577
returnValue getNonlinearFeedback(DMatrix &C_, OutputFcn &feedb_) const
Definition: model_data.cpp:237
OutputFcn feedb
Definition: model_data.hpp:483
std::vector< DMatrix > getOutputDependencies() const
Definition: model_data.cpp:173
DVector getNumMeas() const
Definition: model_data.cpp:614
BooleanType modelDimensionsSet() const
Definition: model_data.cpp:459
DVector getDimOutputs() const
Definition: model_data.cpp:591
returnValue getOutputExpressions(std::vector< Expression > &outputExpressions_) const
Definition: model_data.cpp:166
std::vector< uint > dim_outputs
Definition: model_data.hpp:462
BooleanType hasEquidistantControlGrid() const
Definition: model_data.cpp:439
returnValue setNonlinearFeedback(const DMatrix &C_, const OutputFcn &feedb_)
Definition: model_data.cpp:340
DMatrix A1
Definition: model_data.hpp:475
Allows to pass back messages to the calling function.
std::string externModel
Definition: model_data.hpp:450
std::vector< uint > num_meas
Definition: model_data.hpp:463
returnValue setNU(const uint NU_)
Definition: model_data.cpp:570
returnValue getModel(DifferentialEquation &_f) const
Definition: model_data.cpp:203
DMatrix parms
Definition: model_data.hpp:487
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
Allows to conveniently handle (one-dimensional) grids consisting of time points.
Definition: grid.hpp:58
std::string diffs_name
Definition: model_data.hpp:452
returnValue setLinearInput(const DMatrix &M1_, const DMatrix &A1_, const DMatrix &B1_)
Definition: model_data.cpp:309
DMatrix M1
Definition: model_data.hpp:474
#define CLOSE_NAMESPACE_ACADO
Data class for defining models and everything that is related, to be passed to the integrator...
Definition: model_data.hpp:52
returnValue getLinearOutput(DMatrix &M3_, DMatrix &A3_, OutputFcn &rhs_) const
Definition: model_data.cpp:228
uint getNXA3() const
Definition: model_data.cpp:531
const std::string getFileNameModel() const
Definition: model_data.cpp:624
uint getNX1() const
Definition: model_data.cpp:489
std::vector< DVector > rowPtr_outputs
Definition: model_data.hpp:467
DMatrix A3
Definition: model_data.hpp:479
returnValue setNumSteps(const DVector &_numSteps)
Definition: model_data.cpp:159
std::string rhs_name
Definition: model_data.hpp:451
Grid integrationGrid
Definition: model_data.hpp:457
uint getDimOutput(uint index) const
returnValue getNameDiffsOutputs(std::vector< std::string > &names) const
Definition: model_data.cpp:655
const std::string getNameRhs() const
Definition: model_data.cpp:629
uint addOutput(const OutputFcn &outputEquation_, const Grid &measurements)
Definition: model_data.cpp:80
const std::string getNameDiffsOutput() const
Definition: model_data.cpp:644
const std::string getNameDiffsRhs() const
Definition: model_data.cpp:634
std::vector< Expression > outputExpressions
Definition: model_data.hpp:460
uint getN() const
Definition: model_data.cpp:557
returnValue setLinearOutput(const DMatrix &M3_, const DMatrix &A3_, const OutputFcn &rhs_)
Definition: model_data.cpp:322
DMatrix M3
Definition: model_data.hpp:478
uint getNDX() const
Definition: model_data.cpp:507
returnValue setModel(const DifferentialEquation &_f)
Definition: model_data.cpp:253
returnValue getIntegrationGrid(Grid &integrationGrid_) const
Definition: model_data.cpp:389
DMatrix C
Definition: model_data.hpp:482
returnValue setNOD(const uint NOD_)
Definition: model_data.cpp:584
uint getNU() const
Definition: model_data.cpp:540
returnValue getOutputGrids(std::vector< Grid > &outputGrids_) const
Definition: model_data.cpp:196
std::string diffs3_name
Definition: model_data.hpp:454
BooleanType model_dimensions_set
Definition: model_data.hpp:449
std::vector< Grid > outputGrids
Definition: model_data.hpp:461
BooleanType hasOutputs() const
Definition: model_data.cpp:145
returnValue setNARXmodel(const uint _delay, const DMatrix &_parms)
Definition: model_data.cpp:280
returnValue clearIntegrationGrid()
Definition: model_data.cpp:431
BooleanType hasCompressedStorage() const
Definition: model_data.cpp:471
OutputFcn rhs3
Definition: model_data.hpp:480
uint getNXA() const
Definition: model_data.cpp:525
uint getNumOutputs() const
Definition: model_data.cpp:601
std::string rhs3_name
Definition: model_data.hpp:453
returnValue getNumSteps(DVector &_numSteps) const
Definition: model_data.cpp:152
BooleanType hasDifferentialEquation() const
Definition: model_data.cpp:452
returnValue getNARXmodel(uint &_delay, DMatrix &_parms) const
Definition: model_data.cpp:210
returnValue getLinearInput(DMatrix &M1_, DMatrix &A1_, DMatrix &B1_) const
Definition: model_data.cpp:219
std::vector< std::string > outputNames
Definition: model_data.hpp:464
BooleanType export_rhs
Definition: model_data.hpp:448
uint getNX() const
Definition: model_data.cpp:478
#define BEGIN_NAMESPACE_ACADO
returnValue setDimensions(uint _NX1, uint _NX2, uint _NX3, uint _NDX, uint _NDX3, uint _NXA, uint _NXA3, uint _NU, uint _NOD, uint _NP)
Definition: model_data.cpp:63
BooleanType hasOutputFunctions() const
Definition: model_data.cpp:445
USING_NAMESPACE_ACADO void output(const char *name, const Expression &e)
std::vector< std::string > diffs_outputNames
Definition: model_data.hpp:465
uint getNDX3() const
Definition: model_data.cpp:516
const std::string getNameOutput() const
Definition: model_data.cpp:639
returnValue getNameOutputs(std::vector< std::string > &names) const
Definition: model_data.cpp:649
uint getNOD() const
Definition: model_data.cpp:551
uint getNX3() const
Definition: model_data.cpp:501
uint getNP() const
Definition: model_data.cpp:546
DMatrix B1
Definition: model_data.hpp:476
BooleanType exportRhs() const
Definition: model_data.cpp:465
returnValue setN(const uint N_)
Definition: model_data.cpp:563
uint getNX2() const
Definition: model_data.cpp:495
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:54