Hi
I am working on a nonlinear MPC to achieve optimal raceline generation and following by using the model predictive contouring control (MPCC) formulation as stated in: https://arxiv.org/pdf/1711.07300 (at formula 13).
I found an implementation of this problem using acados in https://github.com/mlab-upenn/mpcc?tab=readme-ov-file but they linearize both the errors and the track around the previous solution of theta for that shooting node. Although this is a clever approach, I want to experiment with the results when not linearizing the problem.
I am using the python interface.
-
My first question is whether acados runs faster when using the nonlinear least squares cost formulation instead of an external cost formulation. I would think this is the case as the specific structure of a nonlinear least squares formulation can be exploited and solved more efficiently?
-
My second question is related to the linear term in the MPCC cost formulation (see figure). If I want to use the nonlinearLQ formulation, I can achieve this linear term by
- Using the square root of the state theta_dot as nonlinear function and -Q_theta as diagonal element in the cost matrix W
- Adding an extra state with constant value 1 to the states, such that a linear term is achieved by using nondiagonal elements in W hat couple theta_dot and 1.
A problem with this is that for both methods, the cost matrix W becomes non-positive-semi-definite and the nonlinearLQ requires W to be positive-semi-definite (PSD). My question thus is whether ACADOS will make it PSD by matrix manipulation such as adding a multiple of the unit matrix or will the solver always fail when the provided W matrix is not PSD?
Thanks for helping me!