How can I get the final value of the cost function from MPC block?

Hi everybody,
As the MPC control action is obtained by solving the optimization problem, my question is how can I get the final value the cost function after the minimizing procedure is finish?
Secondly, how can I minimize a variable which it is not a measured output?
Thanks in advanced

 Accepted Answer

1. Optimal cost is an optional block output as explained in the reference document, just search this page for "optimal cost".
2. For the unmeasured outputs, you can specify constraints just as you do for measured ones, see this example .

3 Comments

Thanks a lot Arkadiy, But right now I have another problem, the building MPC design task can't any more linearize the simulink model. how can I fix it? Do you think the installation of the free toolbox(YALMIP) can cause this?
What do you mean exactly when you say "can't any more linearize Simulink model"? What error message are you getting exactly?
The problem is solved. As you know, one of the steps to creat MPC controller in the MPC design tool is to linearize the model of simulink. It stoped work when I install a free optimazation toolbox because it contains name-clash on the linearize function (linearize.m). The pb is solved by deleting this file. Thank you one more time

Sign in to comment.

More Answers (0)

Asked:

on 19 Mar 2014

Commented:

on 23 Mar 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!