coin-or / qpOASES

Open-source C++ implementation of the recently proposed online active set strategy
GNU Lesser General Public License v2.1
360 stars 121 forks source link

Linear Programming case -- ERROR: Maximum number of working set recalculations performed #102

Open andrescodas opened 4 years ago

andrescodas commented 4 years ago

Hi. I found a simple example where qpOASES fails at solving a linear programming problem. No matter how large I set nWSR qpOASES return ERROR: Maximum number of working set recalculations performed. Is there any particular option I can use to avoid this issue?

I instantiated the problem with casadi, here http://live.casadi.org/

from casadi import *
import numpy as np 

solver_in = {  
     'a': np.zeros((0, 3), dtype=np.float64),
     'g': np.array([[-1.,  0.,  0.]]),
   'lba': np.zeros((0, 1), dtype=np.float64),
   'lbx': np.array([[     0.],
                    [-10000.],
                    [-10000.]]),
   'uba': np.zeros(shape=(0, 1), dtype=np.float64),
   'ubx': np.array([[ 1.],
                    [ 1.],
                    [ 1.]])}

structure = {'a': DM(solver_in['a']).sparsity()}
solver = conic("lp", 'qpoases', structure, {'nWSR': 20})

solver_out = solver(**solver_in)
WARNING:   Stepsize is 0.000000000000000e+00

#################   qpOASES  --  QP NO.   1   ##################

    Iter   |    StepLength    |       Info       |   nFX    
 ----------+------------------+------------------+--------- 
       0   |   0.000000e+00   |   REM BND    0   |     3   
       1   |   1.000000e+00   |   REM BND    1   |     3   
       2   |   2.500000e-01   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
       3   |   -0.000000e+00   |   REM BND    2   |     3   
       4   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
       5   |   -0.000000e+00   |   REM BND    2   |     3   
       6   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
       7   |   -0.000000e+00   |   REM BND    2   |     3   
       8   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
       9   |   -0.000000e+00   |   REM BND    2   |     3   
      10   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
      11   |   -0.000000e+00   |   REM BND    2   |     3   
      12   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
      13   |   -0.000000e+00   |   REM BND    2   |     3   
      14   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
      15   |   -0.000000e+00   |   REM BND    2   |     3   
      16   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
      17   |   -0.000000e+00   |   REM BND    2   |     3   
      18   |   1.000000e+00   |   REM BND    2   |     3   
WARNING:   Stepsize is -0.000000000000000e+00
      19   |   -0.000000e+00   |   REM BND    2   |     3   
WARNING:  No additional regularisation step could be performed due to limits
ERROR:  Maximum number of working set recalculations performed