Has anyone modelled a non linear stochastic MPC with chance constraints or polynomial chaos? I am trying to model the cost function in terms of the fitted coefficients by the polynomial chaos expansion, but it is not working. I would appreciate a lot a change of experience!

I am happy to share that I implemented the Robust NMPC, just like you did, but I am facing some problems.

When I activate the robust constraint (+ gradient(…P…)) for the lower and upper bound), the solver returns an error after one iteration (the first one the status is 0 and the following ones no).

SQP_RTI: QP solver returned error status 3 QP iteration 0. acados returned status 4 in closed loop iteration 16.

I have tried already to tune the slack parameters, the cost functions, and even with low slack parameters it does not work. I put all of the weights/Zl/Zu in the same order of magnitude, also did not work.

The code runs when the constraint is not robust and also then I turn the A_fun to 0 (“turned off” the jacobians wrt x). Also, I noticed that the matrix P does not maintain positive definite for all iterations, and almost everytime is defined by very small values that become negative.
The code runs too if I remove a term from my non linear equations that contains an if_else casadi statement, that we did to avoid a singularity issue, which I also tried to tune.

I know it is very hard to understand a problem like this only with a short description, but I would appreciate a guess or a direction where I could follow.

I have also read some articles here in discourse about the hessian approximation and type of cost, but it did not work.