dynamicmodel.hh
Go to the documentation of this file.
1 #ifndef DYNAMICMODEL_H
2 #define DYNAMICMODEL_H
3 
4 #include <Eigen/Core>
5 
6 template<typename precision,int stateSize,int commandSize>
8 {
9 public:
10  typedef Eigen::Matrix<precision,stateSize,1> stateVec_t; // 1 x stateSize
11  typedef Eigen::Matrix<precision,1,stateSize> stateVecTrans_t; // 1 x stateSize
12  typedef Eigen::Matrix<precision,stateSize,stateSize> stateMat_t; // stateSize x stateSize
13  typedef Eigen::Matrix<precision,stateSize,stateSize> stateTens_t[stateSize]; // stateSize x stateSize x stateSize
14 
15  // typedef for commandSize types
16  typedef Eigen::Matrix<precision,commandSize,1> commandVec_t; // commandSize x 1
17  typedef Eigen::Matrix<precision,1,commandSize> commandVecTrans_t; // 1 x commandSize
18  typedef Eigen::Matrix<precision,commandSize,commandSize> commandMat_t; // commandSize x commandSize
19  typedef Eigen::Matrix<precision,commandSize,commandSize> commandTens_t[commandSize]; // stateSize x commandSize x commandSize
20 
21 
22 
23  // typedef for mixed stateSize and commandSize types
24  typedef Eigen::Matrix<precision,stateSize,commandSize> stateR_commandC_t; // stateSize x commandSize
25  typedef Eigen::Matrix<precision,stateSize,commandSize> stateR_commandC_stateD_t[stateSize]; // stateSize x commandSize x stateSize
26  typedef Eigen::Matrix<precision,stateSize,commandSize> stateR_commandC_commandD_t[commandSize]; // stateSize x commandSize x commandSize
27  typedef Eigen::Matrix<precision,commandSize,stateSize> commandR_stateC_t; // commandSize x stateSize
28  typedef Eigen::Matrix<precision,commandSize,stateSize> commandR_stateC_stateD_t[stateSize]; // commandSize x stateSize x stateSize
29  typedef Eigen::Matrix<precision,commandSize,stateSize> commandR_stateC_commandD_t[commandSize]; // commandSize x stateSize x commandSize
30  typedef Eigen::Matrix<precision,stateSize,stateSize> stateR_stateC_commandD_t[commandSize]; // stateSize x stateSize x commandSize
31  typedef Eigen::Matrix<precision,commandSize,commandSize> commandR_commandC_stateD_t[stateSize]; // commandSize x commandSize x stateSize
32 
33  // constructors //
34 public:
35  // attributes //
36 public:
37 protected:
38  unsigned int stateNb;
39  unsigned int commandNb;
40  double dt;
41 
44 
51 public:
52 
53 
54 protected:
55 
56 
57  // methods //
58 public:
59  virtual stateVec_t computeNextState(double& dt, const stateVec_t& X,const commandVec_t& U)=0;
60  virtual void computeModelDeriv(double& dt, const stateVec_t& X,const commandVec_t& U)=0;
61  virtual stateMat_t computeTensorContxx(const stateVec_t& nextVx)=0;
62  virtual commandMat_t computeTensorContuu(const stateVec_t& nextVx)=0;
63  virtual commandR_stateC_t computeTensorContux(const stateVec_t& nextVx)=0;
64 private:
65 protected:
66  // accessors //
67 public:
68  unsigned int getStateNb() {return stateNb;}
69  unsigned int getCommandNb() {return commandNb;}
72  stateMat_t& getfx() {return fx;}
73  stateTens_t& getfxx() {return fxx;}
74  stateR_commandC_t &getfu() {return fu;}
78 };
79 
80 #endif // DYNAMICMODEL_H
DynamicModel::getfxu
stateR_stateC_commandD_t & getfxu()
Definition: dynamicmodel.hh:76
DynamicModel::getStateNb
unsigned int getStateNb()
Definition: dynamicmodel.hh:68
DynamicModel
Definition: dynamicmodel.hh:7
DynamicModel::getfuu
stateR_commandC_commandD_t & getfuu()
Definition: dynamicmodel.hh:75
DynamicModel::stateTens_t
Eigen::Matrix< precision, stateSize, stateSize > stateTens_t[stateSize]
Definition: dynamicmodel.hh:13
DynamicModel::fxu
stateR_stateC_commandD_t fxu
Definition: dynamicmodel.hh:49
DynamicModel::commandR_stateC_stateD_t
Eigen::Matrix< precision, commandSize, stateSize > commandR_stateC_stateD_t[stateSize]
Definition: dynamicmodel.hh:28
DynamicModel::getfu
stateR_commandC_t & getfu()
Definition: dynamicmodel.hh:74
DynamicModel::getfx
stateMat_t & getfx()
Definition: dynamicmodel.hh:72
DynamicModel::fuu
stateR_commandC_commandD_t fuu
Definition: dynamicmodel.hh:48
DynamicModel::commandTens_t
Eigen::Matrix< precision, commandSize, commandSize > commandTens_t[commandSize]
Definition: dynamicmodel.hh:19
DynamicModel::commandR_stateC_commandD_t
Eigen::Matrix< precision, commandSize, stateSize > commandR_stateC_commandD_t[commandSize]
Definition: dynamicmodel.hh:29
DynamicModel::dt
double dt
Definition: dynamicmodel.hh:40
DynamicModel::commandVec_t
Eigen::Matrix< precision, commandSize, 1 > commandVec_t
Definition: dynamicmodel.hh:16
DynamicModel::commandR_stateC_t
Eigen::Matrix< precision, commandSize, stateSize > commandR_stateC_t
Definition: dynamicmodel.hh:27
DynamicModel::computeTensorContuu
virtual commandMat_t computeTensorContuu(const stateVec_t &nextVx)=0
DynamicModel::computeTensorContux
virtual commandR_stateC_t computeTensorContux(const stateVec_t &nextVx)=0
DynamicModel::getLowerCommandBounds
commandVec_t & getLowerCommandBounds()
Definition: dynamicmodel.hh:70
DynamicModel::fu
stateR_commandC_t fu
Definition: dynamicmodel.hh:47
DynamicModel::fux
stateR_commandC_stateD_t fux
Definition: dynamicmodel.hh:50
DynamicModel::stateR_commandC_commandD_t
Eigen::Matrix< precision, stateSize, commandSize > stateR_commandC_commandD_t[commandSize]
Definition: dynamicmodel.hh:26
DynamicModel::getfux
stateR_commandC_stateD_t & getfux()
Definition: dynamicmodel.hh:77
DynamicModel::stateMat_t
Eigen::Matrix< precision, stateSize, stateSize > stateMat_t
Definition: dynamicmodel.hh:12
DynamicModel::lowerCommandBounds
commandVec_t lowerCommandBounds
Definition: dynamicmodel.hh:42
DynamicModel::commandNb
unsigned int commandNb
Definition: dynamicmodel.hh:39
DynamicModel::commandMat_t
Eigen::Matrix< precision, commandSize, commandSize > commandMat_t
Definition: dynamicmodel.hh:18
DynamicModel::stateR_commandC_stateD_t
Eigen::Matrix< precision, stateSize, commandSize > stateR_commandC_stateD_t[stateSize]
Definition: dynamicmodel.hh:25
DynamicModel::computeNextState
virtual stateVec_t computeNextState(double &dt, const stateVec_t &X, const commandVec_t &U)=0
DynamicModel::commandVecTrans_t
Eigen::Matrix< precision, 1, commandSize > commandVecTrans_t
Definition: dynamicmodel.hh:17
DynamicModel::computeModelDeriv
virtual void computeModelDeriv(double &dt, const stateVec_t &X, const commandVec_t &U)=0
DynamicModel::getCommandNb
unsigned int getCommandNb()
Definition: dynamicmodel.hh:69
DynamicModel::stateVecTrans_t
Eigen::Matrix< precision, 1, stateSize > stateVecTrans_t
Definition: dynamicmodel.hh:11
DynamicModel::fx
stateMat_t fx
Definition: dynamicmodel.hh:45
DynamicModel::commandR_commandC_stateD_t
Eigen::Matrix< precision, commandSize, commandSize > commandR_commandC_stateD_t[stateSize]
Definition: dynamicmodel.hh:31
DynamicModel::getfxx
stateTens_t & getfxx()
Definition: dynamicmodel.hh:73
DynamicModel::computeTensorContxx
virtual stateMat_t computeTensorContxx(const stateVec_t &nextVx)=0
DynamicModel::stateNb
unsigned int stateNb
Definition: dynamicmodel.hh:38
DynamicModel::stateVec_t
Eigen::Matrix< precision, stateSize, 1 > stateVec_t
Definition: dynamicmodel.hh:10
DynamicModel::getUpperCommandBounds
commandVec_t & getUpperCommandBounds()
Definition: dynamicmodel.hh:71
DynamicModel::upperCommandBounds
commandVec_t upperCommandBounds
Definition: dynamicmodel.hh:43
DynamicModel::stateR_stateC_commandD_t
Eigen::Matrix< precision, stateSize, stateSize > stateR_stateC_commandD_t[commandSize]
Definition: dynamicmodel.hh:30
DynamicModel::fxx
stateTens_t fxx
Definition: dynamicmodel.hh:46
DynamicModel::stateR_commandC_t
Eigen::Matrix< precision, stateSize, commandSize > stateR_commandC_t
Definition: dynamicmodel.hh:24