Is it possible to have fmincon terminate once a function value of a certain number is reached?
3 ビュー (過去 30 日間)
古いコメントを表示
I have a function of 6 variables that returns a sum of squares differences from some ideal values. I would like fmincon to find me a local minimum that has a function value lower than a STATIC sum of squared differences value. Is this possible? From what I understand, the 'TolFun' and 'TolX' options will not do this for me. Here is what my function call looks like. The function, optimize_myfunc, is the function that returns a sum of squared differences.
lb = [x1_min, x2_min, x3_min, x4_min, x5_min, x6_min];
ub = [x1_max, x2_max, x3_max, x4_max, x5_max, x6_max];
anon_func = @(x)optimize_myfunc(x, other_var1, other_var2, other_var3);
options = optimset('Display','iter');
x_opt = fmincon(anon_func, [x1_0; x2_0; x3_0; x4_0; x5_0; x6_0], [], [], [], [], lb, ub, [], options);
0 件のコメント
回答 (1 件)
Walter Roberson
2014 年 3 月 13 日
Yes, you can add termination criteria by adding an options structure that has OutputFcn set
Structure of the Output Function
The function definition line of the output function has the following form:
stop = outfun(x, optimValues, state)
stop is a flag that is true or false depending on whether the optimization routine should quit or continue. See Stop Flag for more information.
参考
カテゴリ
Help Center および File Exchange で Problem-Based Optimization Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!