Closed ogencoglu closed 11 months ago
DFO-LS is naturally designed to handle the bound constraints (e.g. -2 <= x[0] <= 1.1), so I would always recommend encoding them this way.
For the last constraint, I would not recommend modifying your objective function (e.g. it returns a very large value if the constraint is violated), because DFO-LS uses interpolation to function values to make progress. When you encode the constraint like this - by giving a projection function - DFO-LS is able to know a lot about the geometric structure of your constraint and uses that to adapt the optimization process. So, it would be my recommended approach for solving.
Following your constrained optimization example in docs:
Is this the most efficient way of performing the optimization or would it be better to incorporate the same constraint into the objective function (with an if clause that returns inf or very large value)? What are the fundamental differences of these two methods in terms of computation and the way optimization works?