julia> using JuMP, Ipopt
julia> m=Model(solver=IpoptSolver())
Feasibility problem with:
* 0 linear constraints
* 0 variables
Solver is Ipopt
julia> @variable(m, 0 <= x <= π / 2)
x
julia> c = @constraint(m, x >= π / 3)
x >= 1.0471975511965976
julia> @NLobjective(m, Min, sin(x))
julia> solve(m)
This is Ipopt version 3.12.8, running with linear solver mumps.
... lines omitted ...
julia> getdual(c)
0.5000000071047659
julia> cos(π/3)
0.5000000000000001
Note that if the starting points was JuMP.set_start_value(x, π/2 - 0.05), then Ipopt would fail to converge to the π / 3 local minimum, which is not as expected. This suggests that the outcomes (the resulting local minimum) might differ, if you write an algorithm yourself.
I don’t know how Ipopt compute the Lagrangian multiplier of x >= b, e.g. (b = pi / 3).
I guess that it will first reformulate this constraint as x == y + b, where y >= 0 is an additional ancillary variable. Then it can associate a multiplier m, which is free, to x == y + b.
If the final solution suggests that y == 0 (or almost zero), then it can returns the value of m, as the multiplier of x >= b. Otherwise, if y > 0 strictly, then it can returns 0, as the multiplier of x >= b.
If there is anyone who knows this interior-point-method procedure, please tell me🙂
Hi @WalterMadelim, we generally discourage commenting on long dead posts. If we updated every post from 2018 that’d be too much work and people will get unexpected emails.
Your idea for the dual is more or less correct. Theres a paper on Ipopt if you want to go find the details.