# Get Lagrange multipliers from Ipopt with Optimization.jl

**URL:** <https://discourse.julialang.org/t/get-lagrange-multipliers-from-ipopt-with-optimization-jl/134074>\
**Category:** General Usage\
**Tags:** optimization, ipopt\
**Created:** [November 24, 2025, 11:32am UTC](https://discourse.julialang.org/t/get-lagrange-multipliers-from-ipopt-with-optimization-jl/134074 "2025-11-24T11:32:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nico/32/211667_2.png) [@nico](https://discourse.julialang.org/u/nico)\
**Post date:** [November 24, 2025, 11:32am UTC](https://discourse.julialang.org/t/get-lagrange-multipliers-from-ipopt-with-optimization-jl/134074/1 "2025-11-24T11:32:10Z")

</div>

Hi everyone!

I’m working with the Julia packages `Optimization.jl` and `Ipopt.jl` to solve a nonlinear programming (NLP) problem.

I’m successfully solving the problem, but I need to extract the final Lagrange multipliers (dual variables) associated with the constraints.

Specifically, how can I retrieve the duals (\lambda) for the general nonlinear constraints, defined as:  
l\_c \le c(\mathbf{x}) \le u\_c

The solution object (`sol`) from `Optimization.solve()` doesn’t have a direct `dual()` function like JuMP.

Could anyone provide a concise example of how to access these dual values from the sol object?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 24, 2025, 1:41pm UTC](https://discourse.julialang.org/t/get-lagrange-multipliers-from-ipopt-with-optimization-jl/134074/2 "2025-11-24T13:41:53Z")

</div>

See [How can you get the Lagrange/KKT multipliers out of JuMP when using Ipopt? - #3 by stevengj](https://discourse.julialang.org/t/how-can-you-get-the-lagrange-kkt-multipliers-out-of-jump-when-using-ipopt/123432/3) and [Lagrangian Function - #19 by stevengj](https://discourse.julialang.org/t/lagrangian-function/38287/19)
