Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing MOI.Test.test_nonlinear_expression_hs109 #46

Closed
odow opened this issue Oct 26, 2024 · 0 comments · Fixed by #49
Closed

Failing MOI.Test.test_nonlinear_expression_hs109 #46

odow opened this issue Oct 26, 2024 · 0 comments · Fixed by #49
Assignees

Comments

@odow
Copy link
Contributor

odow commented Oct 26, 2024

Extracted from jump-dev/AmplNLWriter.jl#190

Here's a model that Ipopt solves but Uno fails on.

julia> using JuMP, AmplNLWriter, Uno_jll, Ipopt_jll, Test

julia> function main(solver)
           model = Model(
               () -> AmplNLWriter.Optimizer(solver; directory = "/tmp"),
           )
           @variable(model, x1 >= 0)
           @variable(model, x2 >= 0)
           @variable(model, -0.55 <= x3 <= 0.55)
           @variable(model, -0.55 <= x4 <= 0.55)
           @variable(model, 196.0 <= x5 <= 252.0)
           @variable(model, 196.0 <= x6 <= 252.0)
           @variable(model, 196.0 <= x7 <= 252.0)
           @variable(model, -400.0 <= x8 <= 800.0)
           @variable(model, -400.0 <= x9 <= 800.0)
           @objective(model, Min, 3 * x1 + 1e-6 * x1^3 + 2 * x2 + 0.522074e-6 * x2^3)
           @constraint(model, (x4 - x3 + 0.55) >= 0.0)
           @constraint(model, (x3 - x4 + 0.55) >= 0.0)
           @constraint(model, (2250000 - x1^2 - x8^2) >= 0.0)
           @constraint(model, (2250000 - x2^2 - x9^2) >= 0.0)
           @constraint(model, (x5 * x6 * sin(-x3 - 0.25) + x5 * x7 * sin(-x4 - 0.25) + 2 * 0.24740395925452294 * x5^2 - 50.176 * x1 + 400 * 50.176) == 0.0)
           @constraint(model, (x5 * x6 * sin(x3 - 0.25) + x6 * x7 * sin(x3 - x4 - 0.25) + 2 * 0.24740395925452294 * x6^2 - 50.176 * x2 + 400 * 50.176) == 0.0)
           @constraint(model, (x5 * x7 * sin(x4 - 0.25) + x6 * x7 * sin(x4 - x3 - 0.25) + 2 * 0.24740395925452294 * x7^2 + 881.779 * 50.176) == 0.0)
           @constraint(model, (50.176 * x8 + x5 * x6 * cos(-x3 - 0.25) + x5 * x7 * cos(-x4 - 0.25) - 200 * 50.176 - 2 * 0.9689124217106447 * x5^2 + 0.7533e-3 * 50.176 * x5^2) == 0.0)
           @constraint(model, (50.176 * x9 + x5 * x6 * cos(x3 - 0.25) + x6 * x7 * cos(x3 - x4 - 0.25) - 2 * 0.9689124217106447 * x6^2 + 0.7533e-3 * 50.176 * x6^2 - 200 * 50.176) == 0.0)
           @constraint(model, (x5 * x7 * cos(x4 - 0.25) + x6 * x7 * cos(x4 - x3 - 0.25) - 2 * 0.9689124217106447 * x7^2 + 22.938 * 50.176 + 0.7533e-3 * 50.176 * x7^2) == 0.0)
           optimize!(model)
           solution_summary(model)
       end
main (generic function with 2 methods)

julia> main(Ipopt_jll.amplexe)
Ipopt 3.14.16: 

******************************************************************************
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 https://github.com/coin-or/Ipopt
******************************************************************************

This is Ipopt version 3.14.16, running with linear solver MUMPS 5.7.3.

Number of nonzeros in equality constraint Jacobian...:       34
Number of nonzeros in inequality constraint Jacobian.:        8
Number of nonzeros in Lagrangian Hessian.............:       19

Total number of variables............................:        9
                     variables with only lower bounds:        2
                variables with lower and upper bounds:        7
                     variables with only upper bounds:        0
Total number of equality constraints.................:        6
Total number of inequality constraints...............:        4
        inequality constraints with only lower bounds:        4
   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  4.9999950e-02 4.42e+04 5.00e-01  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  2.5369903e+02 4.15e+04 1.39e+05  -1.0 8.41e+02    -  1.18e-05 6.03e-02h  5
   2  5.2937114e+02 3.84e+04 1.21e+05  -1.0 8.52e+04    -  1.28e-02 6.87e-02h  3
   3  7.1519737e+02 3.64e+04 9.93e+04  -1.0 1.58e+05    -  1.72e-02 4.93e-02h  1
   4  7.2783256e+02 3.62e+04 9.89e+04  -1.0 2.11e+05    -  1.67e-01 3.49e-03h  1
   5  1.0631720e+03 3.29e+04 8.45e+04  -1.0 2.14e+05    -  7.11e-02 9.18e-02h  1
   6  1.3186788e+03 3.05e+04 7.48e+04  -1.0 2.91e+05    -  1.45e-01 7.49e-02h  2
   7  1.6952041e+03 2.70e+04 5.89e+04  -1.0 3.38e+05    -  7.04e-01 1.15e-01h  2
   8  1.9513881e+03 2.48e+04 5.02e+04  -1.0 3.91e+05    -  3.85e-01 8.53e-02h  4
   9  4.1825676e+03 8.39e+03 1.63e+05  -1.0 4.14e+05    -  7.17e-01 6.87e-01H  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  5.5267864e+03 8.67e+02 2.22e+05  -1.0 3.23e+05    -  9.71e-01 1.00e+00h  1
  11  5.5590670e+03 2.84e+01 1.58e+04  -1.0 7.64e+04    -  1.00e+00 1.00e+00h  1
  12  5.4077923e+03 9.52e+01 1.09e+03  -1.0 1.53e+05    -  8.92e-01 1.00e+00f  1
  13  5.3167411e+03 1.91e+02 1.33e+01  -1.0 2.54e+05    -  8.98e-01 1.00e+00f  1
  14  5.3268572e+03 2.62e+00 7.61e-01  -1.0 5.36e+04    -  1.00e+00 1.00e+00h  1
  15  5.3270495e+03 1.85e-02 8.24e-03  -1.0 3.17e+03    -  1.00e+00 1.00e+00h  1
  16  5.3270508e+03 3.69e-07 1.00e-06  -1.0 1.52e+01    -  1.00e+00 1.00e+00h  1
  17  5.3268575e+03 3.83e-03 8.78e-04  -2.5 2.97e+02    -  1.00e+00 1.00e+00f  1
  18  5.3268570e+03 3.90e-08 2.83e-08  -2.5 1.22e+00    -  1.00e+00 1.00e+00h  1
  19  5.3268516e+03 2.95e-06 6.66e-07  -3.8 8.26e+00    -  1.00e+00 1.00e+00f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  20  5.3268513e+03 9.10e-09 2.05e-09  -5.7 4.59e-01    -  1.00e+00 1.00e+00h  1
  21  5.3268513e+03 1.82e-11 3.74e-12  -8.6 5.69e-03    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 21

                                   (scaled)                 (unscaled)
Objective...............:   5.3268513101610770e+03    5.3268513101610770e+03
Dual infeasibility......:   3.7421345937686313e-12    3.7421345937686313e-12
Constraint violation....:   1.8189894035458565e-11    1.8189894035458565e-11
Variable bound violation:   2.5194903230385535e-06    2.5194903230385535e-06
Complementarity.........:   2.5060471085158831e-09    2.5060471085158831e-09
Overall NLP error.......:   2.5060471085158831e-09    2.5060471085158831e-09


Number of objective function evaluations             = 44
Number of objective gradient evaluations             = 22
Number of equality constraint evaluations            = 44
Number of inequality constraint evaluations          = 44
Number of equality constraint Jacobian evaluations   = 22
Number of inequality constraint Jacobian evaluations = 22
Number of Lagrangian Hessian evaluations             = 21
Total seconds in IPOPT                               = 0.009

EXIT: Optimal Solution Found.
* Solver : AmplNLWriter

* Status
  Result count       : 1
  Termination status : LOCALLY_SOLVED
  Message from the solver:
  "Ipopt 3.14.16: Optimal Solution Found"

* Candidate solution (result #1)
  Primal status      : FEASIBLE_POINT
  Dual status        : FEASIBLE_POINT
  Objective value    : 5.32685e+03
  Dual objective value : 5.32685e+03

* Work counters
  Solve time (sec)   : 9.15470e-02


julia> main(Uno_jll.amplexe)
Problem /tmp/model.nl_scaled_equalityconstrained_boundrelaxed
13 variables, 10 constraints
Used overwritten options:
- LS_backtracking_ratio = 0.5
- LS_min_step_length = 5e-7
- LS_scale_duals_with_step_length = yes
- armijo_decrease_fraction = 1e-8
- barrier_damping_factor = 1e-5
- barrier_tau_min = 0.99
- constraint_relaxation_strategy = feasibility_restoration
- filter_beta = 0.99999
- filter_fact = 1e4
- filter_gamma = 1e-8
- filter_type = standard
- filter_ubd = 1e4
- globalization_mechanism = LS
- globalization_strategy = waechter_filter_method
- l1_constraint_violation_coefficient = 1000.
- linear_solver = MUMPS
- loose_tolerance = 1e-6
- loose_tolerance_consecutive_iteration_threshold = 15
- progress_norm = L1
- protect_actual_reduction_against_roundoff = yes
- residual_norm = INF
- scale_functions = yes
- sparse_format = COO
- subproblem = primal_dual_interior_point
- switch_to_optimality_requires_linearized_feasibility = no
- switching_delta = 1
- tolerance = 1e-8

┌───────┬─────────┬────────────────┬─────────────┬───────┬────────────────┬──────────────┬─────────────┬───────────────┬──────────────┬─────────────────┬────────────────────────┐
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ primal feas.  │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 0---           │ OPT   │ --0.05289.3820.4995692.25e+06        │ initial point          │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 110.11           │ OPT   │ 0811.1654867.361.34541e+06--               │ rejected (h-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤

├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -13-0.000244141--71.4491074.03261.889334.9240.560266        │ accepted (h-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 200010.11           │ OPT   │ 02927005263.49895680--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -2-0.5--1463502911.98224036--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -3-0.25--731751948.2156170.6--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -4-0.125--36587.51502.3414222.9--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -5-0.0625--18293.71286.293744.04--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ primal feas.  │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -6-0.03125--9146.871179.721128.38--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -7-0.015625--4573.431126.77476.489--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -8-0.0078125--2286.721100.37314.528--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -9-0.00390625--1143.361087.19274.543--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -10-0.00195312--571.6791080.61264.8--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -11-0.000976562--285.841077.32262.49--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -12-0.000488281--142.921075.67261.976--               │ rejected (filter)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼───────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -13-0.000244141--71.45991074.85261.879335.1870.559686        │ accepted (h-type)      │
└───────┴─────────┴────────────────┴─────────────┴───────┴────────────────┴──────────────┴─────────────┴───────────────┴──────────────┴─────────────────┴────────────────────────┘

Uno 1.1.0 (LS feasibility_restoration waechter_filter_method primal_dual_interior_point)
Sat Oct 26 17:42:44 2024
────────────────────────────────────────
Status:					Failed with suboptimal point
Objective value:			1074.848
Primal feasibility:			67.88703
┌ Stationarity residual:		335.1867
└ Complementarity residual:		0.5596864
┌ Feasibility stationarity residual:	335.1867
└ Feasibility complementarity residual:	0.5596864
┌ Infeasibility measure:		261.8791
│ Objective measure:			1074.848
└ Auxiliary measure:			-3.655553
Primal solution:			213.4442 209.9789 -0.001312951 -0.1254641 211.5708 211.552 205.1462 43.53384 44.02934 -47431.21 -46007.99 -0.1241511 0.1241511 
┌ Constraint multipliers:		-6.52738 -6.544021 -7.345252 1.292883 1.333961 1.407053 0.7449334 0.7599686 1.306939 0.7722539 
│ Lower bound multipliers:		0.0001143186 0.0004622744 0.1833327 1.318349 0.001781974 0.001781178 0.003881552 0.0001618576 0.000161182 5.244864e-08 5.218597e-08 1.24344 0.09810801 
└ Upper bound multipliers:		0 0 -0.1803285 -0.09767273 -402.2722 -280.3896 -0.003305927 -0.0001717543 -0.0001725218 0 0 0 0 
┌ Constraint feasibility multipliers:	0 0 0 0 0 0 0 0 0 0 
│ Lower bound feasibility multipliers:	0 0 0 0 0 0 0 0 0 0 0 0 0 
└ Upper bound feasibility multipliers:	0 0 0 0 0 0 0 0 0 0 0 0 0 
Objective multiplier:			1
CPU time:				2.334991s
Iterations:				2000
Objective evaluations:			27503
Constraints evaluations:		27504
Objective gradient evaluations:		2002
Jacobian evaluations:			2002
Hessian evaluations:			2000
Number of subproblems solved:		2000
* Solver : AmplNLWriter

* Status
  Result count       : 1
  Termination status : OTHER_LIMIT
  Message from the solver:
  "Uno 1.1.0: Failed with suboptimal point"

* Candidate solution (result #1)
  Primal status      : UNKNOWN_RESULT_STATUS
  Dual status        : NO_SOLUTION
  Objective value    : 1.07485e+03
  Dual objective value : 1.07485e+03

* Work counters
  Solve time (sec)   : 2.66645e+00


shell> cat /tmp/model.nl
g3 1 1 0
 9 10 1 0 6 0
 8 1
 0 0
 9 2 2
 0 0 0 1
 0 0 0 0 0
 42 2
 0 0
 0 0 0 0 0
C0
o1
o0
o1
o0
o0
o2
o2
n1
o2
v4
v5
o41
o0
o2
n-1
v2
n-0.25
o2
o2
n1
o2
v4
v6
o41
o0
o2
n-1
v3
n-0.25
o2
n0.4948079185090459
o2
v4
v4
o2
n50.176
v0
n20070.4
n0
C1
o1
o0
o1
o0
o0
o2
o2
n1
o2
v4
v5
o41
o0
o2
n1
v2
n-0.25
o2
o2
n1
o2
v5
v6
o41
o54
3
o2
n1
v2
o2
n-1
v3
n-0.25
o2
n0.4948079185090459
o2
v5
v5
o2
n50.176
v1
n20070.4
n0
C2
o1
o54
4
o2
o2
n1
o2
v4
v6
o41
o0
o2
n1
v3
n-0.25
n44244.143104
o2
n0.4948079185090459
o2
v6
v6
o2
o2
n1
o2
v5
v6
o41
o54
3
o2
n-1
v2
o2
n1
v3
n-0.25
n0
C3
o1
o0
o1
o1
o0
o0
o2
n50.176
v7
o2
o2
n1
o2
v4
v5
o46
o0
o2
n-1
v2
n-0.25
o2
o2
n1
o2
v4
v6
o46
o0
o2
n-1
v3
n-0.25
n10035.2
o2
n1.9378248434212895
o2
v4
v4
o2
n0.0377975808
o2
v4
v4
n0
C4
o1
o1
o0
o1
o0
o0
o2
n50.176
v8
o2
o2
n1
o2
v4
v5
o46
o0
o2
n1
v2
n-0.25
o2
o2
n1
o2
v5
v6
o46
o54
3
o2
n1
v2
o2
n-1
v3
n-0.25
o2
n1.9378248434212895
o2
v5
v5
o2
n0.0377975808
o2
v5
v5
n10035.2
n0
C5
o1
o54
3
o1
o0
o2
o2
n1
o2
v4
v6
o46
o0
o2
n1
v3
n-0.25
o2
o2
n1
o2
v5
v6
o46
o54
3
o2
n-1
v2
o2
n1
v3
n-0.25
o2
n1.9378248434212895
o2
v6
v6
o2
n0.0377975808
o2
v6
v6
n1150.937088
n0
C6
o0
o2
n-1
o2
v0
v0
o2
n-1
o2
v7
v7
C7
o0
o2
n-1
o2
v1
v1
o2
n-1
o2
v8
v8
C8
n0
C9
n0
O0 0
o54
4
o2
n3
v0
o2
n5.22074e-7
o5
v1
n3
o2
n2
v1
o2
n1.0e-6
o5
v0
n3
x9
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
r
4 0
4 0
4 0
4 0
4 0
4 0
2 -2250000
2 -2250000
2 -0.55
2 -0.55
b
2 0
2 0
0 -0.55 0.55
0 -0.55 0.55
0 196 252
0 196 252
0 196 252
0 -400 800
0 -400 800
k8
2
4
12
20
26
32
38
40
J0 6
0 0
2 0
3 0
4 0
5 0
6 0
J1 6
1 0
2 0
3 0
4 0
5 0
6 0
J2 5
2 0
3 0
4 0
5 0
6 0
J3 6
2 0
3 0
4 0
5 0
6 0
7 0
J4 6
2 0
3 0
4 0
5 0
6 0
8 0
J5 5
2 0
3 0
4 0
5 0
6 0
J6 2
0 0
7 0
J7 2
1 0
8 0
J8 2
2 -1
3 1
J9 2
2 1
3 -1
G0 2
0 0
1 0
@cvanaret cvanaret self-assigned this Oct 26, 2024
@cvanaret cvanaret added bug Something isn't working improvement and removed bug Something isn't working labels Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants