[Bonmin] is the problem in a non-differentiable objective function?

Pierre Bonami pierre.bonami at gmail.com
Tue Feb 28 11:59:25 EST 2012


Dear Diogo,
I don't really understand why but it seems that sometime in the
optimization Ipopt has to evaluate a log(0) and can not seem to get away
with it.

I would recommend that you add a tiny epsilon inside the log. I have tried
adding a constant term of 1e-9 and then it can solve the problem.

There might also be a better way to model the objective function (in
general it is dangerous I guess to have quantities that may become log(0)
or 0/0 by branching).

I hope this helps. Best,
Pierre
On Sun, Feb 19, 2012 at 7:19 PM, Diogo Alagador <alagador at isa.utl.pt> wrote:

> Dear all,
>
> I have a MINLP to solve and I am using the NEOS solvers facility, in order
> to reach the Bonmin solver.
> My problem is in the prob.mod file (below),and data in the data.dat
> (below).
> However some problems arose in the solving procedures (below).
>
> Can you tell me if the problem is one of infeasibility of objective
> function differentiation, as written in one line of warnings, of if some
> other previous bugs exist?
>
> Grateful in advance,
> My best regards,
>
> Diogo André
> Évora, Portugal
>
>
> ##############################**###########################
> ##############################**###########################
> ##############################**###########################
> # FILE prob.mod
>
> param bbb;
>
> param sss;
> param ddd;
> param length {i in 1..ddd};
>
> param cls;
> param cost {j in 1..cls};
>
> param mat{i in 1..ddd, j in 1..cls};
>
> set x1;
> set x0;
> set rep_sss;
> param ttt {k in rep_sss};
>
> var x{j in 1..cls} binary;
>
>
> maximize OBJ:
>        -sum{i in 1..ddd}(
>                (sum{j in 1..cls} mat[i,j]*x[j]/sum{k in 1..sss} (sum{h in
> 1..cls} mat[k,h]*x[h]))*
>                length[i]*
>                log(sum{j in 1..cls} mat[i,j]*x[j]/sum{k in 1..sss} (sum{h
> in 1..cls} mat[k,h]*x[h])));
>
>
> subject to B:
>        sum{j in 1..cls} cost[j]*x[j] = bbb;
> subject to P {k in x1}:
>        x[k]=1;
> subject to U {k in x0}:
>        x[k]=0;
> subject to T {k in rep_sss}:
>        sum{j in 1..cls} mat[k,j]*x[j] >= ttt[k];
>
> ##############################**###########################
> ##############################**###########################
> ##############################**###########################
> # FILE data.dat
>
>  param bbb :=  2 ;
>  param sss :=  7 ;
>  param ddd :=  12 ;
>  param length :=
>  1   1
>  2   1
>  3   2
>  4   3
>  5   2
>  6   1
>  7   1
>  8   2
>  9   1
>  10   1
>  11   1
>  12   1;
>  param cls := 9 ;
>  param cost :=
>  1   1
>  2   1
>  3   1
>  4   1
>  5   1
>  6   1
>  7   1
>  8   1
>  9   1;
>  param mat: 1 2 3 4 5 6 7 8 9 :=
>  1   1 0 0 0 1 0 0 0 0
>  2   0 0 0 0 1 0 0 0 0
>  3   1 1 0 1 0 0 1 0 0
>  4   0 1 0 0 1 0 0 0 0
>  5   0 0 1 0 0 0 0 0 0
>  6   0 0 1 0 1 0 1 0 0
>  7   0 1 1 0 0 0 0 0 0
>  8   2 1 0 1 2 0 1 0 0
>  9   0 2 3 0 2 0 1 0 0
>  10   0 1 3 0 1 0 1 0 0
>  11   0 1 2 0 1 0 1 0 0
>  12   1 0 0 0 2 0 0 0 0;
>  set x1 :=  ;
>  set x0 := 6 8 9 ;
>  set rep_sss := 1 3 ;
>  param ttt :=
>  1   1
>  3   1;
>
> ##############################**###########################
> ##############################**###########################
> ##############################**###########################
> # ON SCREEN WARNINGS IN NEOS BONMIN SOLVER
>
>
> Executing /opt/neos/Drivers/bonmin-ampl/**bonmin-ampl-driver.py at time:
> 2012-02-19 11:32:59.242536
> File exists
> You are using the solver bonmin-ampl.
> Executing AMPL.
> processing data.
> processing commands.
>
> Presolve eliminates 3 constraints and 3 variables.
> Adjusted problem:
> 6 variables, all nonlinear
> 3 constraints, all linear; 12 nonzeros
>        1 equality constraint
>        2 inequality constraints
> 1 nonlinear objective; 6 nonzeros.
>
> Error: ERROR WHILE EVALUATING GRAD_F in OsiTMINLPInterface::**
> getObjCoefficients()
> Bonmin 1.5.1 using Cbc 2.7.2 and Ipopt 3.10.1
> bonmin:
>
> Error: Ipopt exited with error code -13 Invalid number detected
> ****************************************************************
> ******************
> Error: Error at _cmdno 3 executing "solve" command
> This program contains Ipopt, a library for large-scale nonlinear
> optimization.
> Error: (file amplin, line 95, offset 1421):
>  Ipopt is released as open source code under the Eclipse Public License
> (EPL).
> Error:
>         For more information visit http://projects.coin-or.org/**Ipopt<http://projects.coin-or.org/Ipopt>
> Error:  Error differentiating OBJ: division by 0
> ****************************************************************
> ******************
>
> NLP0012I
>              Num      Status      Obj             It       time
>       Location
> NLP0014I             1         OPT -5.13612945.5g       13 0.004999g
> NLP0012I
>              Num      Status      Obj             It       time
>       Location
> NLP0014I             1         OPT -5.13485915.5g        7 0.002g
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> NLP0014I             2         OPT -4.87686515.5g       17 0.005999g
> NLP0014I             3         OPT -4.86155255.5g       15 0.004g
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> NLP0014I             4         OPT 5.5093683e-3165.5g        0 0g
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> NLP0012I
>              Num      Status      Obj             It       time
>       Location
> NLP0014I             1         OPT 6.9532934e-3105.5g        0 0g
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> NLP0014I             2         OPT 5.5082118e-3165.5g        0 0g
> Cbc0012I Integer solution of 6.9532934e-310 found by DiveMIPFractional
> after 0 iterations and 0 nodes (0.01 seconds)
> NLP0014I             2         OPT -5.03528325.5g        7 0.001g
> NLP0014I             3         OPT -4.87686525.5g       13 0.004999g
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
>        "Aborted"
>
> bonmin: Error encountered in optimization.
>  Error (512) in /opt/ampl/ampl -R amplin
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ______________________________**_________________
> Bonmin mailing list
> Bonmin at list.coin-or.org
> http://list.coin-or.org/**mailman/listinfo/bonmin<http://list.coin-or.org/mailman/listinfo/bonmin>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/bonmin/attachments/20120228/b9dad196/attachment.html>


More information about the Bonmin mailing list