# Adaptive barrier method for constrained optimization

**URL:** https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150
**Category:** Optimization (Mathematical)
**Tags:** diffeq, optimization, sciml
**Created:** [November 26, 2025, 7:09pm UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150 "2025-11-26T19:09:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![slwu89](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slwu89/32/217323_2.png) [@slwu89](https://discourse.julialang.org/u/slwu89)
#### Post date: [November 26, 2025, 7:09pm UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/1 "2025-11-26T19:09:34Z")

</div>

Hi all, I’m refactoring some old R code into Julia. In R I was using [constrOptim: Linearly Constrained Optimization](https://rdrr.io/r/stats/constrOptim.html) which lets us use constraints like U \theta - c \geq 0, where \theta is our parameters to be optimized, U is a matrix and c is a vector. The objective function involves an ODE solve within it, so I’m not able to use JuMP to specify the model structure. I see Optim.jl has [Interior point Newton · Optim](https://julianlsolvers.github.io/Optim.jl/stable/examples/generated/ipnewton_basics/) but it requires a Hessian evaluation as well. Are there any adaptive barrier methods available that would let me use something like BFGS but including linear equality/inequality constraints conveniently without the JuMP modeling language?

---

<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 26, 2025, 7:33pm UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/2 "2025-11-26T19:33:12Z")

</div>

There are lots of libraries out there for nonconvex local optimization with inequality constraints that only require you to supply gradients, and don’t require you to use JuMP. For example, Ipopt.jl, NLopt.jl, Nonconvex.jl, and more…

(They don’t necessarily work by the specific barrier algorithm you mentioned, but do you care?)

---

<div class="post-metadata">

### Author: ![slwu89](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slwu89/32/217323_2.png) [@slwu89](https://discourse.julialang.org/u/slwu89)
#### Post date: [November 26, 2025, 11:15pm UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/3 "2025-11-26T23:15:28Z")

</div>

Thanks for the suggestions. You’re right I don’t specifically care about this barrier method, though I may reimplement it in Julia just for comparison with others. I think something like Nonconvex.jl is what I’m looking for: an abstract interface where I can test out different solvers.

I’m having a hard time debating the merits of the various interfaces though, I also found:

- [Optimization.jl](https://docs.sciml.ai/Optimization/stable/): my differential equations are in the SciML-verse already, not sure if that means there’s some advantage to differentiating through a call to the ODE solver when I stay in the ecosystem.
- [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl): this one is interesting to me because I also found that [UnoSolver.jl](https://github.com/cvanaret/Uno/tree/main/interfaces/Julia) implements its interface, although I would need to dig more to see if its the right route for me to take. Maybe @cvanaret would be able to comment.

---

<div class="post-metadata">

### Author: ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)
#### Post date: [November 27, 2025, 11:17am UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/4 "2025-11-27T11:17:28Z")

</div>

> [@slwu89](#):
>
> The objective function involves an ODE solve within it

I think this is understandable to some extent, but not completely.

I’m not sure if you mean “the objective function is defined as the solution of some ODE”.

---

<div class="post-metadata">

### Author: ![cvanaret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cvanaret/32/11594_2.png) [@cvanaret](https://discourse.julialang.org/u/cvanaret)
#### Post date: [November 27, 2025, 7:14pm UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/5 "2025-11-27T19:14:56Z")

</div>

To be honest, I only know that UnoSolver.jl has an interface to NLPModels.jl (and to MathOptInterface.jl), but I’m not really familiar with the package.

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [November 28, 2025, 9:01am UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/6 "2025-11-28T09:01:54Z")

</div>

You could have a look at InfiniteOpt.jl ?

---

<div class="post-metadata">

### Author: ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)
#### Post date: [December 1, 2025, 8:57am UTC](https://discourse.julialang.org/t/adaptive-barrier-method-for-constrained-optimization/134150/7 "2025-12-01T08:57:32Z")

</div>

@slwu89 I suggest to implement your own `NLPModels`, the API is quite simple: [GitHub - JuliaSmoothOptimizers/NLPModels.jl: Data Structures for Optimization Models](https://github.com/JuliaSmoothOptimizers/NLPModels.jl)  
We have examples here:

- [NLPModelsTest.jl/src/nlp/problems/hs14.jl at main · JuliaSmoothOptimizers/NLPModelsTest.jl · GitHub](https://github.com/JuliaSmoothOptimizers/NLPModelsTest.jl/blob/main/src/nlp/problems/hs14.jl)
- [How to create a model from the function and its derivatives](https://jso.dev/tutorials/create-a-manual-model/)

After you can provide your model to Ipopt, KNITRO, Uno (with the interfaces `NLPModelsIpopt.jl` / `NLPModelsKnitro.jl`, `UnoSolver.jl`) and specify that you want a Quasi-Newton approximation.

Example with Ipopt: [Tutorial · NLPModelsIpopt.jl](https://jso.dev/NLPModelsIpopt.jl/dev/tutorial/#Example:-Using-L-BFGS-(limited-memory)-Hessian-approximation-with-Ipopt)
