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