Customized Cost Function and Binary Manipulated Variable in (NL)MPC

9 views (last 30 days)
Hi everyone!
I am trying to implement MPC to control the compressor of a model similar to the Residential Refrigerator Model (Residential Refrigerator - MATLAB & Simulink - MathWorks Deutschland). I used simulation data (inputs: Compressor on/off and Door open/closed, output: air temperature in the compartment) to derive a data-driven linear state-space model of the plant.
Additionally to temperature setpoint tracking, I want to use information about door openings to lower the energy consumption. Therefore, I thought about using a customized cost function, where an active compressor is penalized during a door opening.
Now to my problem:
To my knowledge, defining a customized cost function is only possible in NLMPC and not in linear MPC. But NLMPC is not really an option, because (to my knowledge) defining a binary MV (0 = compressor off, 1 = compressor on) is not supported in NLMPC. Is there a workaround to consider and lower the power consumption of the compressor without using a customized cost function? Or is there a way to use a customized cost function in linear MPC that I don't know of? Or is there a possibility to use binary MV in NLMPC?
I would be really grateful if someone could help me!

Accepted Answer

Thomas Kuenzel
Thomas Kuenzel on 18 Dec 2023
Hi Sebastian, the following initial answer is not mine but from our colleague Gernot Schraberger, who is an expert on MPC:
1) I would use a constraint to limit the temperature or compressor power during door open phase. Constraints can be defined in matrix form E*u + F*y >=G (E,F,G are matrices, u and y vectors of the plant inputs and outputs). Without knowing in detail, how you want to express this penalty a formulation like -door - compressor >= -1.5 would work (door open=1, closed = 0, compressor on = 1, off =0).
2) Using a nonlinear MPC only for allowing a customized nonlinear cost function is not very efficient, especially the binary inputs cause problems here and NMPC runs typically much slower. I would not use that approach.
3) If for the first case with the constraints in linear MPC a nonlinear constraint will be needed, there are ways to formulate a piecewise linear constraint, but that has a certain complexity. If such an approach is needed, it would make sense to have a more detailed conversation.
Maybe this already helps. Please contact us if you are interested in more in-depth support!
  1 Comment
Sebastian
Sebastian on 18 Dec 2023
Hi Thomas,
thank you very much for the response!
ad 2) I got the idea to use nonlinear MPC from the example: Control House Heating System Using Nonlinear Model Predictive Control With Neural State-Space Prediction Model - MATLAB & Simulink - MathWorks Deutschland. If I use a compressor with a continuous output instead of an on/off compressor, the problem would be pretty similar to the mentioned example. But when I try to identify a neural state space model (like in this example) with the same experimental data sets which I used to identify my linear state space model, the result is very unsatisfying.
In the case of a compressor with continuous output and if I would be able to identify a good nss model, would you still suggest sticking to linear MPC?
ad 1 + 3) This approach seems appealing to me, since I can work with linear MPC. I would appreciate further help from you regarding the formulation of piecewise linear constraints, since I am new to MPC and have no experience.
With kind regards,
Sebastian

Sign in to comment.

More Answers (0)

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!