- This project gives an example, which can be modified by users.
- Every block during option start and option end should be modified by users according to the actual situation, where contains necessary parameters and printing options.
- Need to pre install dependency
Eigen
:
sudo apt-get install libeigen3-dev
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
- Provide simple parameter type checking function & analysis of calculation results.
- Users can set parameter
SYSTEM_TYPE
inCONTINUOUS
orDISCRETE
according to the actual situation known by users. If users input the information of a continuous system, this component can trans that into discrete. - Midpoint Euler method & Backward Euler method are used to trans system discretization if necessary.
- In
main
function, a loop is used to simulate the normal operation of a classical 1-dim position-velocity-acceleration system.
- The test result is as the follow figure, as the time going, the state variable of the system converge to 0. the number of iterations is 20:
- Reference:
连续方程的离散化与离散LQR原理
迭代法求黎卡提(Riccati)方程的解