# Which optimization package to use for constrained least squares?

**URL:** <https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710>\
**Category:** Optimization (Mathematical)\
**Created:** [November 1, 2021, 4:20am UTC](https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710 "2021-11-01T04:20:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Itzi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/itzi/32/46136_2.png) [@Itzi](https://discourse.julialang.org/u/Itzi)\
**Post date:** [January 23, 2023, 11:46am UTC](https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710/5 "2023-01-23T11:46:06Z")

</div>

Hi @robsmith11, I am new to Julia and I could not find out how to use the package Optim.jl (or any) to solve the problem you mention (but without the sum constraint)

I want to minimize `(A*x - b)^2` subject to `x ∈ [lower, upper]`

With Optim.jl, I can easily solve this problem with the box constraints

I see that you figured out a way to use Optim.jl for it could you please share the syntax you used?

If you want to know more about the problem I have posted a question here: [Is there any way to emulate MATLAB's Isqlin in Julia?](https://discourse.julialang.org/t/is-there-any-way-to-emulate-matlabs-isqlin-in-julia/93394)

Thank you!

---

_[View the full topic](https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710)._
