Acados with complex u setting

Hi, I hope this message finds this community well. I currently have a control problem with MPC, where controlling ‘u’ is the solution I need to obtain through an optimization problem. However, because my predictive model requires a control ‘u’ with temporal information,such as x_{n+1}=f(x_{t_0{\sim}t_{T_1}},u_{t_0{\sim}t_{T_1}}).Therefore, within a loop iteration for an MPC problem with a prediction horizon of T_2, predictions need to be made as follows:
Therefore, I require the format of my control input ‘u’ at each prediction stage to be as follows. Assuming T_1=4 and T_2=4, we would need four sets of ‘u’.
At the beginning, where u_0, u_1, u_2, u_3 serve as the initial conditions for the entire optimization problem. The variables to be optimized are u_4, u_5, u_6, u_7. I am currently using the acados solver, how should I configure my model to meet the requirements for the control inputs. Thanks for reading and glad for your help.


I seems related to your other post Using temporal convolutional Neural networks in acados

You can augment your system dynamics by auxiliary states in order to “remember” control inputs from previous stages. This can be implemented with the discrete dynamics module.

Overall, the acados OCP solver is really made for the classic OCP structure, in which each control only acts on the current stage.


1 Like

Hi Jonathan,
Thanks for your enlightening answer. But I tried to find an example of using a discrete dynamics module in Acados and I found the answer in another post However the answer in this post seems invalid. It would be very nice if you could show me an example of using discrete dynamics in Acados with a Python interface.
Thanks for the amazing work you did!!!
Best regards,

Hi Ryan,

You are welcome!
Here is an example with discrete dynamics: acados/examples/acados_python/pendulum_on_cart/ocp/ at afe921cbd368543a7fe243d05e5378fcad9ea7f9 · acados/acados · GitHub


1 Like

Thanks for your great work!! :pray: