Numerical Problems

141 views
Skip to first unread message

Ignacio Basallote

unread,
Mar 20, 2019, 5:16:57 AM3/20/19
to Gurobi Optimization
Hi all!

I am experiencing some numericals problems in my model. I am using the academic license of GUROBI through MATLAB. I have a linear objective function with a second order cone constraint (SOCP). The problem is that the solver gets stuck iterating with no end. The objective primal and dual remain approximately constant, whereas the residuals and the complementary change continuosly. Even though I changed the scale of the model the problem persists. 

Some of the constraints are similar to a MPC:

                    P1(t1)*time_step + kslack(t1) >=Wmin(t1) 

P1(t1)*time_step + P1(t2)*time_step + kslack(t1) + kslack(t2) >=Wmin(t2)

P1(t1)*time_step + P1(t2)*time_step + kslack(t1) + kslack(t2) + … + P1(tn)*time_step + kslack(tn) >=Wmin(tn)

 

P1(t1)*time_step + kslack(t1) <=Wmax(t1)

P1(t1)*time_step + P1(t2)*time_step + kslack(t1) + kslack(t2) <=Wmax(t2)

P1(t1)*time_step + P1(t2)*time_step + kslack(t1) + kslack(t2) + … + P1(tn)*time_step + kslack(tn)  <=Wmax(tn)


The SOC of the battery should be always between a lower and upper limit (Wmin and Wmax are cummulative values during a whole time horizon). In case it is not possible (due to technical constraints), it will be penalized in the objective function.


Then I penalize in the objective function as:

OF = C_loss * Losses + C_ns * sum( kslack)

I attach some screenshoots of the solver performance, the coefficient statistics and an example of  Wmin and Wmax curves as well.

Does anyone know why the algorithm does not converge? If I do not consider the penalization, the algorithm converges without problems. However if I do not include the penalization and if the demand cannot be technically met, the problem would be infeasible...

Thanks in advance for your time and help :) !! Any comment is welcome!
s1.PNG
s2.PNG
s3.png

Robert Luce

unread,
Mar 25, 2019, 12:01:05 AM3/25/19
to Gurobi Optimization
Hello Ignacio,

it's difficult to tell from the screenshots what exactly is happening.  If you could post the model here, I can take a look.  To write out the model to a file, just call

gurobi_write(model, 'socpmodel.mps.bz2');

right before the place where you call the 'gurobi' function.

Best,

Robert

Ignacio Basallote

unread,
Mar 26, 2019, 4:52:44 AM3/26/19
to Gurobi Optimization
Hello Robert,

Thanks for your answer. I have exported the model with YALMIP and saved it with the gurobi-write function as you specified.

This is one scenario when the problem gets stuck. I think that penalizing in the objective function makes my problem ill-conditioned. Do you have any idea how could I solve this problem? 

Thanks in advance :) !

Kind regards,

Ignacio
socpmodel.mps.bz2

Robert Luce

unread,
Mar 27, 2019, 3:07:36 PM3/27/19
to Gurobi Optimization
Hello Ignacio,

the model you have posted seems to be different from the one causing the extreme iteration count shown on the screenshot in your original posting: The number of rows/columns/nonzeros on the screenshot are 22353/12849/84741, while for the posted model these statistics are 23508/4004/28664.

On my machine the posted model is solved to optimality:

Barrier solved model in 86 iterations and 4.80 seconds
Optimal objective 2.11082198e+02

I observe though that for this model, too, bad numerical behaviour plays a role, but here the algorithm terminates after a reasonable number of iterations. Would it be possible to post the model causing the 600+ iteration count shown in your original post, too?

You may also want to try to set the 'BarHomogeneous' parameter, see


When set to one, Gurobi will use a self-dual embedding of the problem, which sometimes has better convergence properties for nearly-infeasible problems.

Robert
Reply all
Reply to author
Forward
0 new messages