Comments and answers for "cplexlsqmilp - bad results, but why?!"
https://developer.ibm.com/answers/questions/476319/cplexlsqmilp-bad-results-but-why.html
The latest comments and answers for the question "cplexlsqmilp - bad results, but why?!"Comment by Mathias_RWTH on Mathias_RWTH's comment
https://developer.ibm.com/answers/comments/476518/view.html
Hi Daniel,
I think I found a reason. The solver seems to work just right.
It's just that for some hours it may result in bad solutions whereas in others again it results in better solutions. The overall result however is optimal. This effect is due to the integrating behavior of the "Storage" constraint. It took me some time to figure that out...
Thanks a lot, I am really grateful for your feedback!Sun, 21 Oct 2018 15:33:19 GMTMathias_RWTHComment by DanielJunglas on DanielJunglas's comment
https://developer.ibm.com/answers/comments/476488/view.html
Can you please attach either a fully working matlab code (what you have pasted above does not compile due to several missing things) or an export SAV or LP file of your model?
Can you please also include a full X vector that provides a smaller objective value than what the CPLEX solution gives?Sat, 20 Oct 2018 14:50:28 GMTDanielJunglasComment by Mathias_RWTH on Mathias_RWTH's comment
https://developer.ibm.com/answers/comments/476431/view.html
And one more information; this is the report I receive after having constrained both of above mentioned observations, but still being only suboptimal:
CPXPARAM_Output_CloneLog 1
CPXPARAM_MIP_Interval 20
CPXPARAM_MIP_Strategy_VariableSelect 1
Found incumbent of value 0.000000 after 0.01 sec. (0.05 ticks)
MIP Presolve eliminated 336 redundant SOS constraints.
Tried aggregator 1 time.
MIQP Presolve eliminated 4003 rows and 336 columns.
Reduced MIQP has 29 rows, 336 columns, and 5224 nonzeros.
Reduced MIQP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators.
Reduced MIQP objective Q matrix has 336 nonzeros.
Presolve time = 0.11 sec. (96.73 ticks)
Tried aggregator 1 time.
Reduced MIQP has 29 rows, 336 columns, and 5224 nonzeros.
Reduced MIQP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators.
Reduced MIQP objective Q matrix has 336 nonzeros.
Presolve time = 0.01 sec. (0.89 ticks)
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 4 threads.
Root relaxation solution time = 0.04 sec. (8.99 ticks)
Nodes Cuts/
Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 0.0000 -5.6425 ---
* 0 0 integral 0 -1.9841 -1.9841 13 0.00%
Elapsed time = 0.23 sec. (107.30 ticks, tree = 0.00 MB, solutions = 2)
Root node processing (before b&c):
Real time = 0.24 sec. (107.33 ticks)
Parallel b&c, 4 threads:
Real time = 0.00 sec. (0.00 ticks)
Sync time (average) = 0.00 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 0.24 sec. (107.33 ticks)Fri, 19 Oct 2018 17:11:27 GMTMathias_RWTHComment by Mathias_RWTH on Mathias_RWTH's comment
https://developer.ibm.com/answers/comments/476428/view.html
If I may add, I can define constraints to prevent both observations from happening.
However, I shouldn't have to as the solver should strive to do so by himself. Do you see why he doesn't? Because even if X(1) = -0.0647 and R(1) = 0.0713, this is not an optimal result. It would be optimal only if X(1) = R(1) [given that other constraints are not harmed, which they are not]Fri, 19 Oct 2018 17:01:16 GMTMathias_RWTHComment by Mathias_RWTH on Mathias_RWTH's comment
https://developer.ibm.com/answers/comments/476424/view.html
I can basically make two observations:
- X is of the same sign as R. This is not yet strictly infeasible, but definitely suboptimal and should not be a result to the intended optimization as X+R should strive at all times to become zero.
EXAMPLE: X(25) = 0.0081, R(25) = 0.0713
- abs(X) is bigger than abs(R). This is also not strictly infeasible, which is why I will define an additional constraint. However, if at all it should be merely slightly bigger to receive an optimal solution.
EXAMPLE: X(61) = 0.192, R(61) = -0,122
What the solver should be doing is basically: X = -R, as long as neither the storage nor the power constraint is violated. I know that this could be done analytically, but I'd rather have it solved by CPLEX just like with my other models to ensure continuity.Fri, 19 Oct 2018 16:27:09 GMTMathias_RWTHComment by DanielJunglas
https://developer.ibm.com/answers/comments/476350/view.html
Please elaborate on what "bad results" are. Is the solution infeasible? Is it suboptimal? Please also explain why you think the results are bad, for example, list a violated constraint or provide a solution that is better.Fri, 19 Oct 2018 10:26:31 GMTDanielJunglas