Part 1 (Cont'd) | MPC Model Simulation using Runge Kutta Method
HTML-код
- Опубликовано: 18 ноя 2024
- NEW: this video shows the MATLAB implementation of the Runge Kutta method for model simulation using Casadi.
This is a workshop on implementing model predictive control (MPC) and moving horizon estimation (MHE) in Matlab. The implementation is based on the Casadi Package which is used for numerical optimization. A non-holonomic mobile robot is used as a system for the implementation.
Full Playlist can be found here:
• MPC and MHE implementa...
You find this workshop useful? you can cite any of my related work here:
scholar.google...
Presenter Website: sites.google.c...
workshop slides and matlab codes can be found here:
github.com/MMe...
Casadi can be downloaded from here:
web.casadi.org...
Can you please tell how did you obtain the exact discrete model from continuous one? I can imagine you expanded around theta + sampling time * theta_dot, which is omega, but the confusion arises from the presence of omega(k) in the denominator, for both x(k+1) and y(k+1)...
By direct integration of the system model. That's not always possible for the dynamical systems in general.
Hi, shouldn't change the computations of the next initial state in the function shift.m to use RK method too? variable f that we have passed to the function is the same for two methods f = Function('f',{states,controls},{rhs});
I don't understand this either?
Yeah, you should. I am trying to find sometime to fix this on github.
Hi,
is it possible to get the whole code?
Would like to see how you implemented the OCP in Matlab.
Hi, Matlab code is linked in the video description. All the best!
@@MohamedWMehrez
Thank you!
I am currently also writing a MPC code. However, I still currently have big problems and can not find my error.
Could you help me with this?
It is the same procedure but it is a different use case
👍
Hi,
did you also change the shift function with Runge Kutta 4th order? Does it even make any difference?
No change is needed to the shift function. We simply changed f which we pass to the shift function and works the same way as f from Euler discretization.
how we can add the arrival cost in this program with EK filter ?
This can be done by adding (the difference between the estimate of the state at time k-N and the corresponding optimization variable for the state at that time) to the cost variable.
Dear Mr. Mehrez, could you please explain why we don't adapt the discretization in the shift function as well? In the shift function we compute the initial state also by a euler discretization, so why don't we use RK4 again?