# [Ipopt] Objective value trouble

Stefan Vigerske stefan at math.hu-berlin.de
Fri Dec 10 08:50:59 EST 2010

```Hi,

it seems to work for me. Using the attached gams model, Ipopt has no
problem to find the optimal solution, see output below.

What puzzles me, is that even though you have an unconstrained
minimization problem (except for the variable bounds), the Ipopt
statistics in your output mention one inequality constraint, but still
only one variable. So what exactly are the objective and constraints
that you give to Ipopt?

And yes, and as in Jeff's mail, x=-1 is the solution, not x=-1/2.

Stefan

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:        0
variables with lower and upper bounds:        1
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  1.5000000e+00 0.00e+00 2.00e+00   0.0 0.00e+00    -  0.00e+00
0.00e+00   0
1 -4.4350687e-01 0.00e+00 5.53e-02  -5.0 1.66e+00    -  8.36e-01
1.00e+00f  1
2 -4.9994384e-01 0.00e+00 5.03e-17  -1.9 3.26e-01    -  1.00e+00
1.00e+00f  1
3 -5.0000000e-01 0.00e+00 4.76e-05  -3.4 1.06e-02    -  9.96e-01
1.00e+00f  1
4 -5.0000000e-01 0.00e+00 7.21e-08  -9.1 2.30e-05    -  9.99e-01
1.00e+00f  1
5 -5.0000000e-01 0.00e+00 3.37e-17 -11.0 3.95e-10    -  1.00e+00
1.00e+00f  1

Number of Iterations....: 5

(scaled)                 (unscaled)
Objective...............:  -5.0000000000000000e-01   -5.0000000000000000e-01
Dual infeasibility......:   3.3699894020781983e-17    3.3699894020781983e-17
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   1.0000045988089869e-11    1.0000045988089869e-11
Overall NLP error.......:   1.0000045988089869e-11    1.0000045988089869e-11

Number of objective function evaluations             = 6
Number of objective gradient evaluations             = 6
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             = 5
Total CPU secs in IPOPT (w/o function evaluations)   =      0.020
Total CPU secs in NLP function evaluations           =      0.000

EXIT: Optimal Solution Found.

> I am currently working on a project using the IPopt minimization under contraints.
>
> An example for visual studio "csipopt" converges successfully.
>
> Yet - for the sake of benchmarking - I am trying to minimize the 1D polynomial f(x) = x + x2/2 under the constraints -10<x<10 and with initial guess x = 1.
> Accordingly the gradient is g(x) = 1 + x and the hessian h(x) = 1. IPopt fails to find the minimum x=-1/4 as the iterations deviate only marginally from the initial value as shown by the attached file.
>
> Please advise me how to proceed. I suspect this must be a minor option setting.
>
> Thank you.
>
> Sebastian Ferrera, Chile
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt

--
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: q.gms
Url: http://list.coin-or.org/pipermail/ipopt/attachments/20101210/c255f91e/attachment-0001.pl
```