Skip to main content

Modification of the objective function at each iteration. Is there a better way to formulate a MPC problem??



  • Daniel Espinoza


    I think you need to give more information.... mow many problems are you solving? how long does each one takes? Are you certain that you can not solve the problem in one go? Do you have any (Gurobi) logs? what are the termination conditions for the solver?


  • Giusi Buttitta
    First Comment
    First Question

    Hi Daniel,


    Thank you for your reply. 

    I'm sorry but I didn't write that I'm trying to formulate an MPC problem. In this case, the very first time slot of the result of the optimisation problem solved in the Control Horizon is then used as the initial condition to solve the optimisation problem in the next iteration. That's why I cannot solve the problem in one go but I need multiple iterations. 

    I don't have ant Gurobi logs but I run the simulation again to produce one as soon as possible so that I can post it here.


  • Greg Droge
    First Comment

    I have a similar problem in that I am solving a Model Predictive Control problem and need to repeatedly solve a problem which is very similar. I am using the Matlab interface ( where my Q and A matrices are the same at each time instant, but my c and b matrices change every time I solve the problem. I am transitioning from using osqp as osqp does not allow for mixed-integer constraints. One feature in osqp that I am looking for is that, in osqp, you can create the problem once and update the matrices at each iteration. This allows osqp to do a great deal of the pre-optimization configuration once, speeding up the optimization at subsequent calls.


Please sign in to leave a comment.