Dear Diogo,<div>I don&#39;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.</div><div><br></div><div>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.<br>
<br></div><div>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).</div><div><br></div><div>I hope this helps. Best,</div>
<div>Pierre<br><div class="gmail_quote">On Sun, Feb 19, 2012 at 7:19 PM, Diogo Alagador <span dir="ltr">&lt;<a href="mailto:alagador@isa.utl.pt">alagador@isa.utl.pt</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br>
<br>
I have a MINLP to solve and I am using the NEOS solvers facility, in order to reach the Bonmin solver.<br>
My problem is in the prob.mod file (below),and data in the data.dat (below).<br>
However some problems arose in the solving procedures (below).<br>
<br>
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?<br>
<br>
Grateful in advance,<br>
My best regards,<br>
<br>
Diogo André<br>
Évora, Portugal<br>
<br>
<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
# FILE prob.mod<br>
<br>
param bbb;<br>
<br>
param sss;<br>
param ddd;<br>
param length {i in 1..ddd};<br>
<br>
param cls;<br>
param cost {j in 1..cls};<br>
<br>
param mat{i in 1..ddd, j in 1..cls};<br>
<br>
set x1;<br>
set x0;<br>
set rep_sss;<br>
param ttt {k in rep_sss};<br>
<br>
var x{j in 1..cls} binary;<br>
<br>
<br>
maximize OBJ:<br>
        -sum{i in 1..ddd}(<br>
                (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]))*<br>
                length[i]*<br>
                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])));<br>
<br>
<br>
subject to B:<br>
        sum{j in 1..cls} cost[j]*x[j] = bbb;<br>
subject to P {k in x1}:<br>
        x[k]=1;<br>
subject to U {k in x0}:<br>
        x[k]=0;<br>
subject to T {k in rep_sss}:<br>
        sum{j in 1..cls} mat[k,j]*x[j] &gt;= ttt[k];<br>
<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
# FILE data.dat<br>
<br>
 param bbb :=  2 ;<br>
 param sss :=  7 ;<br>
 param ddd :=  12 ;<br>
 param length :=<br>
 1   1<br>
 2   1<br>
 3   2<br>
 4   3<br>
 5   2<br>
 6   1<br>
 7   1<br>
 8   2<br>
 9   1<br>
 10   1<br>
 11   1<br>
 12   1;<br>
 param cls := 9 ;<br>
 param cost :=<br>
 1   1<br>
 2   1<br>
 3   1<br>
 4   1<br>
 5   1<br>
 6   1<br>
 7   1<br>
 8   1<br>
 9   1;<br>
 param mat: 1 2 3 4 5 6 7 8 9 :=<br>
 1   1 0 0 0 1 0 0 0 0<br>
 2   0 0 0 0 1 0 0 0 0<br>
 3   1 1 0 1 0 0 1 0 0<br>
 4   0 1 0 0 1 0 0 0 0<br>
 5   0 0 1 0 0 0 0 0 0<br>
 6   0 0 1 0 1 0 1 0 0<br>
 7   0 1 1 0 0 0 0 0 0<br>
 8   2 1 0 1 2 0 1 0 0<br>
 9   0 2 3 0 2 0 1 0 0<br>
 10   0 1 3 0 1 0 1 0 0<br>
 11   0 1 2 0 1 0 1 0 0<br>
 12   1 0 0 0 2 0 0 0 0;<br>
 set x1 :=  ;<br>
 set x0 := 6 8 9 ;<br>
 set rep_sss := 1 3 ;<br>
 param ttt :=<br>
 1   1<br>
 3   1;<br>
<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
##############################<u></u>###########################<br>
# ON SCREEN WARNINGS IN NEOS BONMIN SOLVER<br>
<br>
<br>
Executing /opt/neos/Drivers/bonmin-ampl/<u></u>bonmin-ampl-driver.py at time: 2012-02-19 11:32:59.242536<br>
File exists<br>
You are using the solver bonmin-ampl.<br>
Executing AMPL.<br>
processing data.<br>
processing commands.<br>
<br>
Presolve eliminates 3 constraints and 3 variables.<br>
Adjusted problem:<br>
6 variables, all nonlinear<br>
3 constraints, all linear; 12 nonzeros<br>
        1 equality constraint<br>
        2 inequality constraints<br>
1 nonlinear objective; 6 nonzeros.<br>
<br>
Error: ERROR WHILE EVALUATING GRAD_F in OsiTMINLPInterface::<u></u>getObjCoefficients()<br>
Bonmin 1.5.1 using Cbc 2.7.2 and Ipopt <a href="tel:3.10.1" value="+333101" target="_blank">3.10.1</a><br>
bonmin:<br>
<br>
Error: Ipopt exited with error code -13 Invalid number detected<br>
******************************<u></u>******************************<u></u>******************<br>
Error: Error at _cmdno 3 executing &quot;solve&quot; command<br>
This program contains Ipopt, a library for large-scale nonlinear optimization.<br>
Error: (file amplin, line 95, offset 1421):<br>
 Ipopt is released as open source code under the Eclipse Public License (EPL).<br>
Error:<br>
         For more information visit <a href="http://projects.coin-or.org/Ipopt" target="_blank">http://projects.coin-or.org/<u></u>Ipopt</a><br>
Error:  Error differentiating OBJ: division by 0<br>
******************************<u></u>******************************<u></u>******************<br>
<br>
NLP0012I<br>
              Num      Status      Obj             It       time                 Location<br>
NLP0014I             1         OPT -5.13612945.5g       13 0.004999g<br>
NLP0012I<br>
              Num      Status      Obj             It       time                 Location<br>
NLP0014I             1         OPT -5.13485915.5g        7 0.002g<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
NLP0014I             2         OPT -4.87686515.5g       17 0.005999g<br>
NLP0014I             3         OPT -4.86155255.5g       15 0.004g<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
NLP0014I             4         OPT 5.5093683e-3165.5g        0 0g<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
NLP0012I<br>
              Num      Status      Obj             It       time                 Location<br>
NLP0014I             1         OPT 6.9532934e-3105.5g        0 0g<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
NLP0014I             2         OPT 5.5082118e-3165.5g        0 0g<br>
Cbc0012I Integer solution of 6.9532934e-310 found by DiveMIPFractional after 0 iterations and 0 nodes (0.01 seconds)<br>
NLP0014I             2         OPT -5.03528325.5g        7 0.001g<br>
NLP0014I             3         OPT -4.87686525.5g       13 0.004999g<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
Error in an AMPL evaluation. Run with &quot;halt_on_ampl_error yes&quot; to see details.<br>
        &quot;Aborted&quot;<br>
<br>
bonmin: Error encountered in optimization.<br>
 Error (512) in /opt/ampl/ampl -R amplin<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Bonmin mailing list<br>
<a href="mailto:Bonmin@list.coin-or.org" target="_blank">Bonmin@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/bonmin" target="_blank">http://list.coin-or.org/<u></u>mailman/listinfo/bonmin</a><br>
</blockquote></div><br></div>