What happens if the termination condition is satisfied before the constraint in matlab's fmincon?

4 次查看(过去 30 天)
I'm doing optimization using fmincon.
I used ObjectiveLimit to terminate the optimization when the size of the objective function is less than 0.2,
As I was writing the code, it seems that if the nonlinear constraints are satisfied, the termination condition is also satisfied.
However, when I run the code, the optimization is performed several times and then the code terminates.
I don't understand this part.
Doesn't fmincon perform optimization for cases that satisfy the constraints?
What happens if the termination condition is satisfied before the constraint in matlab's fmincon?
Below is the output when optimization is finished.
fmincon stopped because the objective function value 6.018404e-04 is less than options.ObjectiveLimit = 2.000000e-01 and the relative maximum constraint violation 2.039171e-13 is less than options.ConstraintTolerance = 1.000000e-06
Thank you.

采纳的回答

Matt J
Matt J 2025-2-15
编辑:Matt J 2025-2-15
The only time fmincon will stop without satisfying the constraints (within ConstraintTolerance) is if the MaxItertions or MaxFunctionEvaluations limits are exceeded.
  27 个评论
Matt J
Matt J 2025-2-19
编辑:Matt J 2025-2-19
Even if I give an initial value that is outside the boundary lb, ub, it will immediately fall within lb, ub when the first iteration is executed, right?
When using sqp or interior-point, yes.
Nonlinear constraints may not be like that.
Nonlinear constraints are never like that, nor are linear ones (that aren't bounds).

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by