# Specifying the Hessian for some (but not all) user-defined operators

**URL:** https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741
**Category:** Optimization (Mathematical)
**Tags:** jump, ipopt
**Created:** [May 6, 2025, 1:11am UTC](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741 "2025-05-06T01:11:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![franckgaga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/franckgaga/32/218241_2.png) [@franckgaga](https://discourse.julialang.org/u/franckgaga)
#### Post date: [May 6, 2025, 1:11am UTC](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741/1 "2025-05-06T01:11:13Z")

</div>

In ModelPredictiveControl.jl, I build the nonlinear optimization problem of `NonLinMPC` using multiple user-defined operators in JuMP.jl. One operator is for the objective function, the other operators appear in the nonlinear equality and inequality constraint functions.

My question is: without relying on the experimental `Ipopt._VectorNonlinearOracle` feature, is it possible to provide an exact Hessian for only one user-defined operator but not for the others?

I would like to allow providing an exact hessian for the objective function, but not for the nonlinear constraints (since it’s a bit more tricky, needing the Lagragian to be efficient and all). I tried to implement it, but the provided Hessian callback for my objective function was never called. I figured out that since it needs an LBFGS approximation for the nonlinear constraint, JuMP probably ignores my callback and use the approximation for the whole NLP problem.

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [May 6, 2025, 2:18am UTC](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741/2 "2025-05-06T02:18:42Z")

</div>

No. If you are missing the Hessian of any operator, JuMP disables Hessians for the entire model.

---

<div class="post-metadata">

### Author: ![franckgaga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/franckgaga/32/218241_2.png) [@franckgaga](https://discourse.julialang.org/u/franckgaga)
#### Post date: [May 6, 2025, 11:41am UTC](https://discourse.julialang.org/t/specifying-the-hessian-for-some-but-not-all-user-defined-operators/128741/3 "2025-05-06T11:41:35Z")

</div>

Alright thanks. I will need to try the new experimental set.
