MPC optimization problem infeasible after 3rd loop
Awaiting user inputHello, I modelled a two string battery system to minimize the batteries capacity loss over lifetime. the model is quite complex and non linear. for running it , I get reasonable results for the first two optimization loops/ horizons, but in the third one it crashes. from tiral and error I identified the critical part (cyclic losses) that most likely cause the infeasiblity. is it because the variable values are very small?
can you suggest some steps I can take to tackle this issue?
kind regards, Melina
-
Hi Melina,
Could you please share a log output of the infeasible run? Could you additionally share the constraints causing the infeasibility? In best case, please share these constraints in LP format.
Did you have a look at How do I determine why my model is infeasible?
Best regards,
Jaromił0 -
Hey, thank you for your quick response.
yes I did check out the infeasibility guidelines.
this is the log output of the critical run:
Presolve time: 0.03s
Presolved: 3653 rows, 1449 columns, 7790 nonzeros
Presolved model has 856 bilinear constraint(s)
Warning: Model contains variables with very large bounds participating
in product terms.
Presolve was not able to compute smaller bounds for these variables.
Consider bounding these variables or reformulating the model.
Solving non-convex MIQCPVariable types: 1447 continuous, 2 integer (2 binary)
Root relaxation: objective 4.806758e-01, 1302 iterations, 0.11 seconds (0.07 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time0 0 0.48068 0 644 - 0.48068 - - 0s
0 2 0.48068 0 644 - 0.48068 - - 5s
143 100 18.59114 19 629 - 3.72304 - 196 10s
263 188 18.59114 27 629 - 3.72304 - 203 15s
524 377 18.59114 64 624 - 3.72304 - 155 20s
699 566 18.59114 83 624 - 3.72304 - 163 25s
1017 873 18.59114 110 628 - 3.72304 - 148 31s
1349 1082 18.59114 155 627 - 3.72304 - 143 37s
1632 1084 508.38002 105 2 - 3.72304 - 135 41s
1636 1088 2522.10513 138 2 - 3.72304 - 135 49s
1639 1092 524.38105 101 2 - 3.72304 - 135 52s
1640 1092 22.73889 140 2 - 3.72304 - 135 62s
1644 1096 119.32474 24 2 - 3.72304 - 136 78s
1647 1100 372.69821 191 2 - 3.72304 - 137 80s
1648 1100 1332.40392 66 2 - 3.72304 - 136 96sExplored 1650 nodes (227649 simplex iterations) in 96.75 seconds (45.85 work units)
Thread count was 8 (of 8 available processors)Solution count 0
Model is infeasible
Best objective -, best bound -, gap -The constraints that I suppose cause the infeasibility (model runs if they are set to constant) copied from the LP file :
delta_soc1_timestep1: delta_soe1_timestep[0] = 0
delta_soc1_timestep[1]: - SOE1[0] + SOE1[1] - delta_soe1_timestep[1] = 0
delta_soc1_timestep[2]: - SOE1[1] + SOE1[2] - delta_soe1_timestep[2] = 0
delta_soc1_timestep[3]: - SOE1[2] + SOE1[3] - delta_soe1_timestep[3] = 0
delta_soc1_timestep[4]: - SOE1[3] + SOE1[4] - delta_soe1_timestep[4] = 0
delta_soc1_timestep[5]: - SOE1[4] + SOE1[5] - delta_soe1_timestep[5] = 0
delta_soc1_timestep[6]: - SOE1[5] + SOE1[6] - delta_soe1_timestep[6] = 0
delta_soc1_timestep[7]: - SOE1[6] + SOE1[7] - delta_soe1_timestep[7] = 0
delta_soc1_timestep[8]: - SOE1[7] + SOE1[8] - delta_soe1_timestep[8] = 0
delta_soc1_timestep[9]: - SOE1[8] + SOE1[9] - delta_soe1_timestep[9] = 0
delta_soc1_timestep[10]: - SOE1[9] + SOE1[10] - delta_soe1_timestep[10]
= 0
delta_soc1_timestep[11]: - SOE1[10] + SOE1[11] - delta_soe1_timestep[11]
= 0
delta_soc1_timestep[12]: - SOE1[11] + SOE1[12] - delta_soe1_timestep[12]
= 0
delta_soc1_timestep[13]: - SOE1[12] + SOE1[13] - delta_soe1_timestep[13]
= 0
delta_soc1_timestep[14]: - SOE1[13] + SOE1[14] - delta_soe1_timestep[14]
= 0
delta_soc1_timestep[15]: - SOE1[14] + SOE1[15] - delta_soe1_timestep[15]
= 0
delta_soc1_timestep[16]: - SOE1[15] + SOE1[16] - delta_soe1_timestep[16]
= 0
delta_soc1_timestep[17]: - SOE1[16] + SOE1[17] - delta_soe1_timestep[17]
= 0
delta_soc1_timestep[18]: - SOE1[17] + SOE1[18] - delta_soe1_timestep[18]
= 0
delta_soc1_timestep[19]: - SOE1[18] + SOE1[19] - delta_soe1_timestep[19]
= 0
delta_soc1_timestep[20]: - SOE1[19] + SOE1[20] - delta_soe1_timestep[20]
= 0
delta_soc1_timestep[21]: - SOE1[20] + SOE1[21] - delta_soe1_timestep[21]
= 0
delta_soc1_timestep[22]: - SOE1[21] + SOE1[22] - delta_soe1_timestep[22]
= 0
delta_soc1_timestep[23]: - SOE1[22] + SOE1[23] - delta_soe1_timestep[23]
= 0
delta_soc1_timestep[24]: - SOE1[23] + SOE1[24] - delta_soe1_timestep[24]
= 0
delta_soc1_timestep[25]: - SOE1[24] + SOE1[25] - delta_soe1_timestep[25]
= 0
delta_soc1_timestep[26]: - SOE1[25] + SOE1[26] - delta_soe1_timestep[26]
= 0
delta_soc1_timestep[27]: - SOE1[26] + SOE1[27] - delta_soe1_timestep[27]
= 0
delta_soc1_timestep[28]: - SOE1[27] + SOE1[28] - delta_soe1_timestep[28]
= 0
delta_soc1_timestep[29]: - SOE1[28] + SOE1[29] - delta_soe1_timestep[29]
= 0
delta_soc1_timestep[30]: - SOE1[29] + SOE1[30] - delta_soe1_timestep[30]
= 0
delta_soc1_timestep[31]: - SOE1[30] + SOE1[31] - delta_soe1_timestep[31]
= 0-1 <= delta_soe1_timestep[0] <= 1
-1 <= delta_soe1_timestep[1] <= 1
-1 <= delta_soe1_timestep[2] <= 1
-1 <= delta_soe1_timestep[3] <= 1
-1 <= delta_soe1_timestep[4] <= 1
-1 <= delta_soe1_timestep[5] <= 1
-1 <= delta_soe1_timestep[6] <= 1
-1 <= delta_soe1_timestep[7] <= 1
-1 <= delta_soe1_timestep[8] <= 1
-1 <= delta_soe1_timestep[9] <= 1
-1 <= delta_soe1_timestep[10] <= 1
-1 <= delta_soe1_timestep[11] <= 1
-1 <= delta_soe1_timestep[12] <= 1
-1 <= delta_soe1_timestep[13] <= 1
-1 <= delta_soe1_timestep[14] <= 1
-1 <= delta_soe1_timestep[15] <= 1
-1 <= delta_soe1_timestep[16] <= 1
-1 <= delta_soe1_timestep[17] <= 1
-1 <= delta_soe1_timestep[18] <= 1
-1 <= delta_soe1_timestep[19] <= 1
-1 <= delta_soe1_timestep[20] <= 1
-1 <= delta_soe1_timestep[21] <= 1
-1 <= delta_soe1_timestep[22] <= 1
-1 <= delta_soe1_timestep[23] <= 1
-1 <= delta_soe1_timestep[24] <= 1
-1 <= delta_soe1_timestep[25] <= 1
-1 <= delta_soe1_timestep[26] <= 1
-1 <= delta_soe1_timestep[27] <= 1
-1 <= delta_soe1_timestep[28] <= 1
-1 <= delta_soe1_timestep[29] <= 1
-1 <= delta_soe1_timestep[30] <= 1
-1 <= delta_soe1_timestep[31] <= 1delta_soc2_timestep1: delta_soe2_timestep[0] = 0
delta_soc2_timestep[1]: - SOE2[0] + SOE2[1] - delta_soe2_timestep[1] = 0
delta_soc2_timestep[2]: - SOE2[1] + SOE2[2] - delta_soe2_timestep[2] = 0
delta_soc2_timestep[3]: - SOE2[2] + SOE2[3] - delta_soe2_timestep[3] = 0
delta_soc2_timestep[4]: - SOE2[3] + SOE2[4] - delta_soe2_timestep[4] = 0
delta_soc2_timestep[5]: - SOE2[4] + SOE2[5] - delta_soe2_timestep[5] = 0
delta_soc2_timestep[6]: - SOE2[5] + SOE2[6] - delta_soe2_timestep[6] = 0
delta_soc2_timestep[7]: - SOE2[6] + SOE2[7] - delta_soe2_timestep[7] = 0
delta_soc2_timestep[8]: - SOE2[7] + SOE2[8] - delta_soe2_timestep[8] = 0
delta_soc2_timestep[9]: - SOE2[8] + SOE2[9] - delta_soe2_timestep[9] = 0
delta_soc2_timestep[10]: - SOE2[9] + SOE2[10] - delta_soe2_timestep[10]
= 0
delta_soc2_timestep[11]: - SOE2[10] + SOE2[11] - delta_soe2_timestep[11]
= 0
delta_soc2_timestep[12]: - SOE2[11] + SOE2[12] - delta_soe2_timestep[12]
= 0
delta_soc2_timestep[13]: - SOE2[12] + SOE2[13] - delta_soe2_timestep[13]
= 0
delta_soc2_timestep[14]: - SOE2[13] + SOE2[14] - delta_soe2_timestep[14]
= 0
delta_soc2_timestep[15]: - SOE2[14] + SOE2[15] - delta_soe2_timestep[15]
= 0
delta_soc2_timestep[16]: - SOE2[15] + SOE2[16] - delta_soe2_timestep[16]
= 0
delta_soc2_timestep[17]: - SOE2[16] + SOE2[17] - delta_soe2_timestep[17]
= 0
delta_soc2_timestep[18]: - SOE2[17] + SOE2[18] - delta_soe2_timestep[18]
= 0
delta_soc2_timestep[19]: - SOE2[18] + SOE2[19] - delta_soe2_timestep[19]
= 0
delta_soc2_timestep[20]: - SOE2[19] + SOE2[20] - delta_soe2_timestep[20]
= 0
delta_soc2_timestep[21]: - SOE2[20] + SOE2[21] - delta_soe2_timestep[21]
= 0
delta_soc2_timestep[22]: - SOE2[21] + SOE2[22] - delta_soe2_timestep[22]
= 0
delta_soc2_timestep[23]: - SOE2[22] + SOE2[23] - delta_soe2_timestep[23]
= 0
delta_soc2_timestep[24]: - SOE2[23] + SOE2[24] - delta_soe2_timestep[24]
= 0
delta_soc2_timestep[25]: - SOE2[24] + SOE2[25] - delta_soe2_timestep[25]
= 0
delta_soc2_timestep[26]: - SOE2[25] + SOE2[26] - delta_soe2_timestep[26]
= 0
delta_soc2_timestep[27]: - SOE2[26] + SOE2[27] - delta_soe2_timestep[27]
= 0
delta_soc2_timestep[28]: - SOE2[27] + SOE2[28] - delta_soe2_timestep[28]
= 0
delta_soc2_timestep[29]: - SOE2[28] + SOE2[29] - delta_soe2_timestep[29]
= 0
delta_soc2_timestep[30]: - SOE2[29] + SOE2[30] - delta_soe2_timestep[30]
= 0
delta_soc2_timestep[31]: - SOE2[30] + SOE2[31] - delta_soe2_timestep[31]
= 0-1 <= delta_soe2_timestep[0] <= 1
-1 <= delta_soe2_timestep[1] <= 1
-1 <= delta_soe2_timestep[2] <= 1
-1 <= delta_soe2_timestep[3] <= 1
-1 <= delta_soe2_timestep[4] <= 1
-1 <= delta_soe2_timestep[5] <= 1
-1 <= delta_soe2_timestep[6] <= 1
-1 <= delta_soe2_timestep[7] <= 1
-1 <= delta_soe2_timestep[8] <= 1
-1 <= delta_soe2_timestep[9] <= 1
-1 <= delta_soe2_timestep[10] <= 1
-1 <= delta_soe2_timestep[11] <= 1
-1 <= delta_soe2_timestep[12] <= 1
-1 <= delta_soe2_timestep[13] <= 1
-1 <= delta_soe2_timestep[14] <= 1
-1 <= delta_soe2_timestep[15] <= 1
-1 <= delta_soe2_timestep[16] <= 1
-1 <= delta_soe2_timestep[17] <= 1
-1 <= delta_soe2_timestep[18] <= 1
-1 <= delta_soe2_timestep[19] <= 1
-1 <= delta_soe2_timestep[20] <= 1
-1 <= delta_soe2_timestep[21] <= 1
-1 <= delta_soe2_timestep[22] <= 1
-1 <= delta_soe2_timestep[23] <= 1
-1 <= delta_soe2_timestep[24] <= 1
-1 <= delta_soe2_timestep[25] <= 1
-1 <= delta_soe2_timestep[26] <= 1
-1 <= delta_soe2_timestep[27] <= 1
-1 <= delta_soe2_timestep[28] <= 1
-1 <= delta_soe2_timestep[29] <= 1
-1 <= delta_soe2_timestep[30] <= 1
-1 <= delta_soe2_timestep[31] <= 1Thank you in advance and please let me know if you need more details.
best regards, Melina
0 -
yes I did check out the infeasibility guidelines.
Could you please post the IIS computed by Gurobi? See How do I use 'compute IIS' to find a subset of constraints that are causing model infeasibility?
Did you set specific bounds for your \(\texttt{SOE1}\) and \(\texttt{SOE2}\) variables. Note that the default lower bound for variables is \(0\) and if you want to allow for negative values, you have to set the lower bound explicitly when creating the variable(s).
Moreover, could you please also post the first ~10 log lines holding the coefficient statistics of your model.
0 -
Hello Jaromił ,
yes, I computed the IIS. Non-minimal IIS computed: 2402 constraints, 3904 bounds - I wont print the result here, but all my constraints are in the list of "The following constraint(s) cannot be satisfied:"
both SOE1 and SOE2 variables have the bounds lb=0 and ub=1. for the equivalent delta_soe1_timestep and delta_soe2_timestep the bounds are lb=-1 and ub=1.
Here the information from the log:
Optimize a model with 1284 rows, 2272 columns and 3056 nonzeros
Model fingerprint: 0x517c94ed
Model has 956 quadratic constraints
Model has 160 general constraints
Variable types: 2240 continuous, 32 integer (32 binary)
Coefficient statistics:
Matrix range [6e-02, 1e+05]
QMatrix range [8e-04, 1e+00]
QLMatrix range [3e-01, 1e+00]
Objective range [1e+00, 1e+00]
Bounds range [1e-01, 5e+03]
RHS range [2e-02, 1e+05]
QRHS range [3e-01, 4e-01]
GenCon rhs range [1e+00, 2e+00]
GenCon coe range [4e-02, 1e+00]
Presolve removed 795 rows and 983 columns
Presolve time: 0.04s
Presolved: 3335 rows, 1290 columns, 6907 nonzeros
Presolved model has 2 SOS constraint(s)
Presolved model has 794 bilinear constraint(s)
Warning: Model contains variables with very large bounds participating
in product terms.
Presolve was not able to compute smaller bounds for these variables.
Consider bounding these variables or reformulating the modelbest regards, Melina
0 -
Hi Melina,
yes, I computed the IIS. Non-minimal IIS computed: 2402 constraints, 3904 bounds
Ok, that is not something I would have expected. So it looks like the infeasibility is more complex than initially assumed.
You might want to give it another try with feasRelax.
Otherwise, I do not see a good way to "debug" this infeasibility issue.
You said
The constraints that I suppose cause the infeasibility (model runs if they are set to constant) copied from the LP file :
Could you try to indentify a subset of these constraints which cause infeasibility? Or do you know whether you know the whole two sets of these constraints to make the model infeasible? You could try to relax the bounds of the new SOE1 and SOE2 variables to see whether this solves the infeasibility and then try to understand why it is the case.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
5 comments