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

5 ビュー (過去 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.
  2 件のコメント
Torsten
Torsten 2025 年 2 月 14 日
編集済み: Torsten 2025 年 2 月 14 日
This question is too specific to be answered in the forum. You should address it directly to the developers:
Most probably it's necessary to have direct access to the source code to answer without speculating.
재현
재현 2025 年 2 月 15 日
Thank you.
I will contact the developer.

サインインしてコメントする。

採用された回答

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).
재현
재현 2025 年 2 月 19 日
Thank you again.
I learned exactly what I wanted.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver 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