[AMPL 16150] IPOPT does not return correct solution!

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 16150] IPOPT does not return correct solution!

mahraz amini
I am trying to solve a super simple question 

var x1 >= 0 ;

minimize obj: -(x1^2)+x1;


When I solve it by Gurobi I receive this message :

ampl: option solver gurobi;

ampl: solve;

Gurobi 6.5.0: unbounded; variable.unbdd returned.

No basis.


which is reasonable.


But when I solve it by IPOPT I got this:


******************************************************************************

This program contains Ipopt, a library for large-scale nonlinear optimization.

 Ipopt is released as open source code under the Eclipse Public License (EPL).

         For more information visit http://projects.coin-or.org/Ipopt

******************************************************************************


This is Ipopt version 3.12.4, running with linear solver mumps.

NOTE: Other linear solvers might be more efficient (see Ipopt documentation).


Number of nonzeros in equality constraint Jacobian...:        0

Number of nonzeros in inequality constraint Jacobian.:        0

Number of nonzeros in Lagrangian Hessian.............:        1


Total number of variables............................:        1

                     variables with only lower bounds:        1

                variables with lower and upper bounds:        0

                     variables with only upper bounds:        0

Total number of equality constraints.................:        0

Total number of inequality constraints...............:        0

        inequality constraints with only lower bounds:        0

   inequality constraints with lower and upper bounds:        0

        inequality constraints with only upper bounds:        0


iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls

   0  9.8999902e-03 0.00e+00 2.00e-02  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0

   1  1.5346023e-04 0.00e+00 1.50e-09  -3.8 9.85e-03    -  1.00e+00 1.00e+00f  1

   2  1.7888952e-06 0.00e+00 1.84e-11  -5.7 1.52e-04    -  1.00e+00 1.00e+00f  1

   3 -7.5005506e-09 0.00e+00 2.51e-14  -8.6 1.80e-06    -  1.00e+00 1.00e+00f  1


Number of Iterations....: 3


                                   (scaled)                 (unscaled)

Objective...............:  -7.5005505996934397e-09   -7.5005505996934397e-09

Dual infeasibility......:   2.5091040356528538e-14    2.5091040356528538e-14

Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00

Complementarity.........:   2.4994494940593761e-09    2.4994494940593761e-09

Overall NLP error.......:   2.4994494940593761e-09    2.4994494940593761e-09



Number of objective function evaluations             = 4

Number of objective gradient evaluations             = 4

Number of equality constraint evaluations            = 0

Number of inequality constraint evaluations          = 0

Number of equality constraint Jacobian evaluations   = 0

Number of inequality constraint Jacobian evaluations = 0

Number of Lagrangian Hessian evaluations             = 3

Total CPU secs in IPOPT (w/o function evaluations)   =      0.001

Total CPU secs in NLP function evaluations           =      0.000


EXIT: Optimal Solution Found.

 

Ipopt 3.12.4: Optimal Solution Found


suffix ipopt_zU_out OUT;

suffix ipopt_zL_out OUT;

ampl: display x1;

x1 = 0


ampl: display obj;

obj = 0


Which obviously wrong! Can anyone explain it to me please?


Thanks

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[AMPL 16166] Re: IPOPT does not return correct solution!

mahraz amini
I think I figured out what happened. objective function is not convex and therefor the founded solution is local optimal.

On Thursday, April 12, 2018 at 8:23:21 AM UTC-4, mahraz amini wrote:
I am trying to solve a super simple question 

var x1 >= 0 ;

minimize obj: -(x1^2)+x1;


When I solve it by Gurobi I receive this message :

ampl: option solver gurobi;

ampl: solve;

Gurobi 6.5.0: unbounded; variable.unbdd returned.

No basis.


which is reasonable.


But when I solve it by IPOPT I got this:


******************************************************************************

This program contains Ipopt, a library for large-scale nonlinear optimization.

 Ipopt is released as open source code under the Eclipse Public License (EPL).

         For more information visit <a href="http://projects.coin-or.org/Ipopt" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fprojects.coin-or.org%2FIpopt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFQIB7VJBk1y9Dl2Ob9V5DEfFdN-w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fprojects.coin-or.org%2FIpopt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFQIB7VJBk1y9Dl2Ob9V5DEfFdN-w&#39;;return true;">http://projects.coin-or.org/Ipopt

******************************************************************************


This is Ipopt version 3.12.4, running with linear solver mumps.

NOTE: Other linear solvers might be more efficient (see Ipopt documentation).


Number of nonzeros in equality constraint Jacobian...:        0

Number of nonzeros in inequality constraint Jacobian.:        0

Number of nonzeros in Lagrangian Hessian.............:        1


Total number of variables............................:        1

                     variables with only lower bounds:        1

                variables with lower and upper bounds:        0

                     variables with only upper bounds:        0

Total number of equality constraints.................:        0

Total number of inequality constraints...............:        0

        inequality constraints with only lower bounds:        0

   inequality constraints with lower and upper bounds:        0

        inequality constraints with only upper bounds:        0


iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls

   0  9.8999902e-03 0.00e+00 2.00e-02  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0

   1  1.5346023e-04 0.00e+00 1.50e-09  -3.8 9.85e-03    -  1.00e+00 1.00e+00f  1

   2  1.7888952e-06 0.00e+00 1.84e-11  -5.7 1.52e-04    -  1.00e+00 1.00e+00f  1

   3 -7.5005506e-09 0.00e+00 2.51e-14  -8.6 1.80e-06    -  1.00e+00 1.00e+00f  1


Number of Iterations....: 3


                                   (scaled)                 (unscaled)

Objective...............:  -7.5005505996934397e-09   -7.5005505996934397e-09

Dual infeasibility......:   2.5091040356528538e-14    2.5091040356528538e-14

Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00

Complementarity.........:   2.4994494940593761e-09    2.4994494940593761e-09

Overall NLP error.......:   2.4994494940593761e-09    2.4994494940593761e-09



Number of objective function evaluations             = 4

Number of objective gradient evaluations             = 4

Number of equality constraint evaluations            = 0

Number of inequality constraint evaluations          = 0

Number of equality constraint Jacobian evaluations   = 0

Number of inequality constraint Jacobian evaluations = 0

Number of Lagrangian Hessian evaluations             = 3

Total CPU secs in IPOPT (w/o function evaluations)   =      0.001

Total CPU secs in NLP function evaluations           =      0.000


EXIT: Optimal Solution Found.

 

Ipopt 3.12.4: Optimal Solution Found


suffix ipopt_zU_out OUT;

suffix ipopt_zL_out OUT;

ampl: display x1;

x1 = 0


ampl: display obj;

obj = 0


Which obviously wrong! Can anyone explain it to me please?


Thanks

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16168] IPOPT does not return correct solution!

AMPL mailing list
That is right. Ipopt correctly returned a locally optimal solution.

It is surprising that Gurobi returned any result at all, since in general it only accepts convex quadratic objectives for minimization. In this simple case, however, apparently Gurobi's presolve routines were able to detect unboundedness even before testing for convexity; when I turn off presolve by adding "option gurobi_options 'presolve=0';" before solving, then Gurobi reports "quadratic objective is not positive definite" and rejects the problem. (Also CPLEX and Xpress reject the problem even when their presolve routines are left on.)

--
Robert Fourer
[hidden email]
{#HS:559800149-5043#}
On Thu, Apr 12, 2018 at 8:07 PM UTC, Zeyad Kassem' Via Ampl Modeling Language <[hidden email]> wrote:
I think I figured out what happened. objective function is not convex and
therefor the founded solution is local optimal.



On Thu, Apr 12, 2018 at 12:23 PM UTC, Zeyad Kassem' Via Ampl Modeling Language <[hidden email]> wrote:
I am trying to solve a super simple question

var x1 >= 0 ;

minimize obj: -(x1^2)+x1;


When I solve it by Gurobi I receive this message :

ampl: option solver gurobi;

ampl: solve;

Gurobi 6.5.0: unbounded; variable.unbdd returned.

No basis.


which is reasonable.


But when I solve it by IPOPT I got this:


******************************************************************************

This program contains Ipopt, a library for large-scale nonlinear optimization.

Ipopt is released as open source code under the Eclipse Public License (EPL).

For more information visit http://projects.coin-or.org/Ipopt

******************************************************************************


This is Ipopt version 3.12.4, running with linear solver mumps.

NOTE: Other linear solvers might be more efficient (see Ipopt documentation).


Number of nonzeros in equality constraint Jacobian...: 0

Number of nonzeros in inequality constraint Jacobian.: 0

Number of nonzeros in Lagrangian Hessian.............: 1


Total number of variables............................: 1

variables with only lower bounds: 1

variables with lower and upper bounds: 0

variables with only upper bounds: 0

Total number of equality constraints.................: 0

Total number of inequality constraints...............: 0

inequality constraints with only lower bounds: 0

inequality constraints with lower and upper bounds: 0

inequality constraints with only upper bounds: 0


iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls

0 9.8999902e-03 0.00e+00 2.00e-02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0

1 1.5346023e-04 0.00e+00 1.50e-09 -3.8 9.85e-03 - 1.00e+00 1.00e+00f 1

2 1.7888952e-06 0.00e+00 1.84e-11 -5.7 1.52e-04 - 1.00e+00 1.00e+00f 1

3 -7.5005506e-09 0.00e+00 2.51e-14 -8.6 1.80e-06 - 1.00e+00 1.00e+00f 1


Number of Iterations....: 3


(scaled) (unscaled)

Objective...............: -7.5005505996934397e-09 -7.5005505996934397e-09

Dual infeasibility......: 2.5091040356528538e-14 2.5091040356528538e-14

Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00

Complementarity.........: 2.4994494940593761e-09 2.4994494940593761e-09

Overall NLP error.......: 2.4994494940593761e-09 2.4994494940593761e-09



Number of objective function evaluations = 4

Number of objective gradient evaluations = 4

Number of equality constraint evaluations = 0

Number of inequality constraint evaluations = 0

Number of equality constraint Jacobian evaluations = 0

Number of inequality constraint Jacobian evaluations = 0

Number of Lagrangian Hessian evaluations = 3

Total CPU secs in IPOPT (w/o function evaluations) = 0.001

Total CPU secs in NLP function evaluations = 0.000


EXIT: Optimal Solution Found.

Ipopt 3.12.4: Optimal Solution Found


suffix ipopt_zU_out OUT;

suffix ipopt_zL_out OUT;

ampl: display x1;

x1 = 0


ampl: display obj;

obj = 0


Which obviously wrong! Can anyone explain it to me please?


Thanks

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.