Numeric error in AMPL

84 views
Skip to first unread message

hosein.h...@gmail.com

unread,
Oct 31, 2015, 8:56:28 AM10/31/15
to AMPL Modeling Language
hi,
I use Gorubi for solving a second-order cone program. In some cases the solver stops and gives the following error :

urobi 6.0.4: numeric error
112 barrier iterations
No basis.
No primal or dual variables returned


I'd be grateful if anybody can advise me how to find the cause of this error and how to resolve it. 

Robert Fourer

unread,
Nov 4, 2015, 10:19:25 AM11/4/15
to am...@googlegroups.com
The "numeric error" here is being reported by the Gurobi solver. You could ask Gurobi for more information as to what is happening, by adding the AMPL command

option gurobi_options 'outlev 1';

before solving. Then post all of the resulting listing here, and it might be possible to give you some suggestions. (There's also the possibility of posting to the Gurobi forum, at groups.google.com/group/gurobi.)

Bob Fourer
am...@googlegroups.com

=======

hosein.h...@gmail.com

unread,
Nov 5, 2015, 7:57:05 PM11/5/15
to AMPL Modeling Language, 4...@ampl.com
hi, 
here is the ampl report :

Optimize a model with 412 rows, 257 columns and 978 nonzeros
Model has 24 quadratic constraints
Coefficient statistics:
  Matrix range    [3e-01, 5e+02]
  Objective range [3e-02, 2e+07]
  Bounds range    [3e-02, 3e-01]
  RHS range       [1e-02, 1e+00]
Presolve removed 282 rows and 102 columns
Presolve time: 0.00s
Presolved: 202 rows, 203 columns, 581 nonzeros
Presolved model has 24 second-order cone constraints
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 37
 AA' NZ     : 1.009e+03
 Factor NZ  : 2.652e+03
 Factor Ops : 3.972e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   1.03148955e+09  3.13222632e+06  9.86e-01 2.00e+08  8.93e+02     0s
   1   1.73338356e+09  3.12556093e+06  1.96e+00 2.00e+08  1.11e+03     0s
   2   5.25305872e+08  3.12745653e+06  1.85e+00 2.00e+08  1.58e+03     0s
   3   1.09176632e+09  3.12386971e+06  1.97e+00 2.00e+08  2.90e+03     0s
   4   1.60432691e+09  3.11774213e+06  1.96e+00 2.00e+08  4.85e+03     0s
   5   8.71646939e+08  3.10952592e+06  1.53e+00 2.00e+08  9.12e+03     0s
   6   1.05310378e+09  3.10323305e+06  1.72e+00 2.00e+08  1.12e+04     0s
   7   7.81621757e+08  3.10223016e+06  1.56e+00 2.00e+08  1.36e+04     0s
   8   6.99589446e+08  3.07737054e+06  1.56e+00 1.99e+08  2.62e+04     0s
   9   6.15892693e+08  3.01586343e+06  1.57e+00 1.98e+08  5.25e+04     0s
  10   3.43442193e+08  2.81745604e+06  1.65e+00 1.92e+08  8.31e+04     0s
  11   1.02153199e+09  2.32408969e+06  1.32e+00 1.72e+08  5.75e+05     0s
  12   8.10529983e+08 -3.07513805e+05  1.01e+00 8.57e+07  1.87e+06     0s
  13   5.19015006e+08 -8.78461485e+05  7.18e-01 4.28e+07  1.67e+06     0s
  14   1.38109172e+08 -6.99469957e+06  1.57e-01 4.28e+01  5.91e+05     0s
  15   1.36313467e+07 -2.75945172e+06  1.85e-02 8.42e+00  6.60e+04     0s
  16   3.23820013e+06 -7.70096103e+05  4.93e-03 1.81e+00  1.59e+04     0s
  17   1.80083271e+06 -1.21872690e+05  2.85e-03 6.14e-02  7.56e+03     0s
  18   8.65611103e+05 -5.28651246e+04  1.33e-03 1.13e-02  3.59e+03     0s
  19   1.23057423e+03 -3.51616074e+03  1.58e-05 3.20e-05  1.83e+01     0s
  20   2.73432819e+01 -2.51861832e+02  2.91e-06 2.41e-06  1.07e+00     0s
  21   1.02244417e+01 -2.99179516e+01  3.11e-07 3.50e-07  1.54e-01     0s
  22   4.15219555e+00 -9.10802296e+00  5.97e-08 1.09e-07  5.10e-02     0s
  23   2.22174683e+00 -3.90050871e+00  4.64e-13 5.58e-08  2.35e-02     0s
  24   9.20547899e-01 -8.66770635e-01  1.40e-12 6.56e-08  6.87e-03     0s
  25   5.52480924e-01  1.72333022e-01  7.05e-13 7.14e-08  1.46e-03     0s
  26   5.31174223e-01  4.05434225e-01  2.15e-12 2.75e-08  4.84e-04     0s
  27   5.17110192e-01  4.54030444e-01  3.63e-11 2.24e-06  2.43e-04     0s
  28   5.07621663e-01  4.92255921e-01  3.42e-12 5.69e-07  5.91e-05     0s
  29   5.07640363e-01  5.06652456e-01  3.97e-11 2.14e-08  3.80e-06     0s
  30   5.07175183e-01  5.06862279e-01  2.17e-06 8.73e-04  1.23e-06     0s
  31   5.07117260e-01  5.07040561e-01  2.51e-06 1.37e-02  3.39e-07     0s
  32   5.07122773e-01  5.07125985e-01  1.07e-05 2.88e-02  9.17e-09     0s
  33   5.07123347e-01  5.07126717e-01  1.26e-05 2.26e-02  5.41e-09     0s
  34   5.07123703e-01  5.07126756e-01  1.99e-05 2.93e+00  5.26e-09     0s
  35   5.07123627e-01  5.07126786e-01  2.53e-05 1.08e+00  5.08e-09     0s
  36   5.07123632e-01  5.07126794e-01  3.09e-05 1.55e+00  5.03e-09     0s
  37   5.07123640e-01  5.07126796e-01  2.60e-05 1.70e+00  5.02e-09     0s
  38   5.07123639e-01  5.07126796e-01  3.97e-05 2.87e+00  5.02e-09     0s
  39   5.07123672e-01  5.07126797e-01  2.64e-05 3.23e+00  5.02e-09     0s
  40   5.07123726e-01  5.07126797e-01  4.56e-05 2.50e+00  5.01e-09     0s
  41   5.07123626e-01  5.07126797e-01  4.27e-05 2.36e+00  5.01e-09     0s
  42   5.07123637e-01  5.07126797e-01  6.63e-05 8.51e-01  5.01e-09     0s
  43   5.07123638e-01  5.07126797e-01  9.81e-05 1.02e+00  5.01e-09     0s
  44   5.07123387e-01  5.07126797e-01  7.61e-05 4.84e-01  5.00e-09     0s
  45   5.07123384e-01  5.07126797e-01  7.80e-05 7.84e-01  4.99e-09     0s
  46   5.07123398e-01  5.07126797e-01  9.89e-05 2.45e-01  4.99e-09     0s
  47   5.07123400e-01  5.07126798e-01  1.83e-04 1.35e+00  4.99e-09     0s
  48   5.07123474e-01  5.07126798e-01  8.70e-05 1.01e+00  4.99e-09     0s
  49   5.07123464e-01  5.07126798e-01  1.12e-04 3.26e-01  4.99e-09     0s
  50   5.07123463e-01  5.07126798e-01  1.11e-04 3.62e-01  4.99e-09     0s
  51   5.07123443e-01  5.07126773e-01  1.04e-04 1.40e+00  5.08e-09     0s

Barrier performed 51 iterations in 0.06 seconds
Sub-optimal termination - objective 5.07621663e-01


please note that some problem instance are solve but some are not with the above error. 

Robert Fourer

unread,
Nov 8, 2015, 6:56:40 PM11/8/15
to am...@googlegroups.com
Gurobi declares optimality when the three residual values (primal, dual, complementarity) are sufficiently small. It seems to be making great progress through iteration 29, but then runs into trouble and never does converge. You could try adding numericfocus=3 to your gurobi_options string to direct Gurobi to put the greatest emphasis on numerical stability. Also you could set barqcptol=1e-5 (the default is 1e-6) to accept a larger residual, though you should check that the resulting solutions are acceptable. Finally the large variation in objective function coefficients -- from .03 to 2000000 -- may cause numerical difficulties; if you can formulate the model with less variation then it may solve better.

If you try all of these things without success then you should request help from the Gurobi developers (by writing to groups.google.com/group/gurobi) since they are the only ones who have access to the details of the Gurobi implementation.
Reply all
Reply to author
Forward
0 new messages