MILP + MPC problem issue

147 views
Skip to first unread message

AL

unread,
Feb 26, 2021, 6:42:03 AM2/26/21
to YALMIP
Dear Johan,

I am trying to run a simple MPC problem to control the indoor temperature in buildings with the objective of minimizing electricity cost. This seems to work fine.

I add an additional soft constraint that aims to keep the overall power consumption below zero at the end of the day, so I expect the electricity cost to rise at the expense of satisfying this constraint if possible. The problem is the electricity cost further reduces by adding this constraint which doesn't make sense since the previous problem without this constraint is itself a cost minimization problem. 

I have tried different solvers - gurobi, cplex, and intlinprog, get the same results. I am not sure if the problem is caused by the problem formulation since I use the abs operator from Matlab in one of the constraints. 

I include a zip file of the code with this, would appreciate any help. The constraint which causes the issue is on line 84 of the MILP_CONTROL file. If I deactivate it the problem becomes a simple cost optimization problem. 

Kind regards.


yalmipGroupQuestion.zip

Johan Löfberg

unread,
Feb 26, 2021, 7:02:33 AM2/26/21
to YALMIP
If you make open-loop decisions over a receding horizon, you can have that the resulting a-posteriori closed-loop performance happens to improve despite increasing the cost in every open-loop solve. The most extreme example is a stabilizing terminal state weight, without it the closed-loop performance is infinity, but then after increasing the cost in every solve, the system is stable and thus decreased closed-loop cost

I.e. doing something non-greedy in a decision, can lead to better performance overall when evaluating a-posteriori

Not saying this is what you have, but it's not unheard of


Message has been deleted

AL

unread,
Feb 26, 2021, 7:46:46 AM2/26/21
to YALMIP
Thank you very much, Johan. That is indeed the case. I am not using any terminal state constraint, that makes much sense.
Reply all
Reply to author
Forward
0 new messages