Custom cost objective for an MPC or NMPC

93 views
Skip to first unread message

Julia Baldyga

unread,
Sep 20, 2017, 8:49:27 AM9/20/17
to YALMIP
Dear Professor,

I am new to the topic optimal control and I am dealing with following MPC/NMPC problem in a project: 

a system has been modelled with 3 discrete states, each having linear dynamics (Hybrid Automaton), and for each linear model a classical MPC has been designed. In Simulink it was implemented as Stateflow Chart and Multiple MPC block. The system has 6 states, two inputs (u1 and u2) and two outputs: (y1 = x1, y2 = x1-x2). The power dissipated during tracking the reference for y2 in this system is: u2*y2. The system should be controlled with another MPCs in such a way that the output tracks the reference using minimum energy (power).

My questions are: is the idea for setting cost objective to J = sum over prediction horizon of y(2)*u(2) correct? y and u are constrained. 

Does the nonlinear term y(2)*u(2) classify this problem as Nonlinear MPC even if the system equations are linear? Is this an admissible function to use for the cost objective or do I need to stick to sum of squares for an MPC?

I am a complete beginner in optimal control, and after some research I am still not able to answer my questions. I really appreciate your hints.

Johan Löfberg

unread,
Sep 20, 2017, 8:51:55 AM9/20/17
to YALMIP
nonlinear in nonlinear mpc typically relates to the dynamics, so you still have linear mpc. You have a hard problem though, as the objective function is nonconvex

Julia Baldyga

unread,
Sep 20, 2017, 9:49:58 AM9/20/17
to YALMIP
Thank you.

Can SQP solvers as in fmincon deal with a nonconvex problem? (Then I would be able to use for example the nmpc Matlab routine from Pannek and Grüne)

If not, do I need another solver? Is Yalmip the right Toolbox to implement this OP and then the controller?

Johan Löfberg

unread,
Sep 20, 2017, 9:52:13 AM9/20/17
to YALMIP
Depends on what you mean with "deal with". fmincon does not assume convexity,  but whether you get a good solution, or if it manages to solve the problem is another thing.

YALMIP supports fmincon, and can thus be used here

Julia Baldyga

unread,
Sep 20, 2017, 11:02:55 AM9/20/17
to YALMIP
After reading about an optimization problem, I think I uderstand what you say. The problem is considered solved once we have:

  1. A candidate solution: A particular choice of the decision variable x and its corresponding objective value f(x), AND
  2. A proof of optimality: A mathematical proof that the choice of xis globally optimal, i.e. that f(x)f(x) holds for every choice of x.
When ff is nonconvex, a candidate solution may still be easy to find, but the proof of optimality (even local) becomes extremely difficult. Did I get it right?

Do you mean I could still get a "good" solution even if it is not the global minimum?

Johan Löfberg

unread,
Sep 20, 2017, 11:21:06 AM9/20/17
to YALMIP
Correct, proving optimality is as hard as finding a solution. You can easily have though that the globally optimal solution is found easily, but you don't know if it is optimal. Since you have linear dynamics, it is easy to find feasible solutions.

To prove global optimality, you need global solvers. keeping track of lower and upper bounds (bmibnb , baron, scip in yalmip)

Julia Baldyga

unread,
Sep 20, 2017, 12:36:01 PM9/20/17
to YALMIP
Thank you a lot, professor. I think I see what it is all about. 

I also read a lot about the ACADO Toolkit, however, I read that ACADO aims for a fast solution of optimal control problems and  it uses gradient based optimisation solvers (which only guarantee local optimality). Can you confirm that?

If this is true, and as I understand correctly, SQP as in fmincon is not a global optimization routine, then my conclusion is that the best idea for me to calculate globally optimal input function is to make use of YALMIP and one of global solvers you mentioned. Am I right? I do not have to worry about implementing the MPC on a target at first, but only need to run a simulation in Simulink.

Johan Löfberg

unread,
Sep 20, 2017, 1:07:13 PM9/20/17
to YALMIP
correct
Reply all
Reply to author
Forward
0 new messages