# Derivative-free optimization of bounded nonlinear least squares

**URL:** <https://discourse.julialang.org/t/derivative-free-optimization-of-bounded-nonlinear-least-squares/137302>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package\
**Created:** [May 27, 2026, 10:32pm UTC](https://discourse.julialang.org/t/derivative-free-optimization-of-bounded-nonlinear-least-squares/137302 "2026-05-27T22:32:26Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [May 28, 2026, 4:58pm UTC](https://discourse.julialang.org/t/derivative-free-optimization-of-bounded-nonlinear-least-squares/137302/9 "2026-05-28T16:58:56Z")

</div>

> [@claudiop21](#):
>
> The number of variables n is around 30, so is a relatively high number.

This is not too terrible for derivative-free optimization (or finite differences) — probably at least an order of magnitude slower than if you had the gradient analytically, but you can afford an order of magnitude if your solver is fast enough (e.g. it is a 2d BEM problem). Gradients only become indispensable when you have thousands to millions (or more) of parameters, as in topology optimization.

---

_[View the full topic](https://discourse.julialang.org/t/derivative-free-optimization-of-bounded-nonlinear-least-squares/137302)._
