What is the meaning of -10 exit flag in optimization toolbox?

3 ビュー (過去 30 日間)
Stefan
Stefan 2012 年 4 月 6 日
I am doing some optimization using the global optimization toolbox and am getting a lot of -10 exit flags from the local runs of MultiStart. While, the documentation says that this means an error in the user supplied functions, this does not help me much in trying to figure out what is going on.
Could this be a result of the fact that my problem might not be guaranteed to be smooth? I do get a solution in at least 1 of the local runs that terminates with a flag of 1.
I am currently using MultiStart and fmincon, should I change to patternsearch instead?
Any help is appreciated.

採用された回答

Walter Roberson
Walter Roberson 2012 年 4 月 6 日
An error in the user defined function could mean that your function went complex, inf, or NaN. If you had been using fzero() instead of fmincon() then it could indicate the supplied endpoints did not have different signs when evaluated for the function.
Other possibilities include that your user function generated an error, such as if you made an assumption about vector sizes that turned out not to be true under some conditions (a horzcat or vertcat error), or if you accidentally coded matrix multiplication or matrix division or matrix power where you wanted element-by-element calculations.
  3 件のコメント
Walter Roberson
Walter Roberson 2012 年 4 月 7 日
An error does get thrown in that case, but fmincon() is catching the error and smoothly returning an error flag result that the multistart routine is turning into its own error flag result.
If your quest at this point is to find out what error is being generated, use
dbstop if caught error
You might also want to try
dbstop if naninf
Stefan
Stefan 2012 年 6 月 8 日
Sorry for the late reply, thanks for the advice, I managed to clear things up!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by