Min max Ipopt opti : error in step computation

Hi @baroqueuse, welcome to the forum :smile:

Here’s how I would write your model. You’ll see that there are number of things that are different. As Charlie says, you have some repeated constraints, and there are also other issues with your algebraic expressions, like (... * u[2*i]) / (... * u[2*i]). In the JuMP side, sum(A + B) is just A + B, you can use linear algebra like A * x .== u, and it’s always better to provide explicit variable bounds.

This code finds your analytical solution:

using JuMP, Ipopt
A = [6.6 -3.0; -3.0 6.6]
nc = div(size(A, 2), 2)
tol, ub = 1e-6, 1e9
model = Model(Ipopt.Optimizer)
@variables(model, begin
    -1 <= x[i in 1:2nc] <= 1, (start = 1)
    tol <= u[i in 1:2nc] <= sqrt(ub)
    ratio[1:nc]
    t
end)
fix.(u[1:2:2nc], 0.0; force = true)  # [i in 1:nc], u[2i-1] == 0
@constraints(model, begin
    sum(x.^2) == 1
    [i in 1:nc], tol <= x[2i-1]^2 + x[2i]^2 <= 1
    A * x .== u
    [i in 1:nc], ratio[i] == x[2i] / sqrt(x[2i-1]^2 + x[2i]^2)
    [t; ratio] in MOI.NormInfinityCone(nc + 1)
end)
@objective(model, Min, t)
optimize!(model)
objective_value(model)
value.(x)