MATLAB: Does “fmincon” evaluate the objective function at points that don’t meet the constraints

constraintfminconinterior-pointOptimization Toolbox

I have a function that is undefined for certain inputs, and I would like to minimize it. If I use "fmincon" and constrain the solver to avoid the areas where the function is undefined, will this guarantee that the objective function will not be evaluated at any points where the function is undefined?

Best Answer

No, “fmincon” can evaluate the objective function at points where the constraints are not met. The default interior-point algorithm used by "fmincon" implements constraints using an augmented Lagrangian method, which applies a “weight” to the results of the objective function for points outside the constraints to ensure that they are not optimal, but may still evaluate them. More details can be found here: