Finding a single global solution

조회 수: 1 (최근 30일)
fizzy
fizzy 2020년 8월 24일
댓글: Alan Weiss 2020년 8월 25일
I am trying to find optimum(minimum) value of a 3 variable function using simulannealbnd. Using the default parameters, optimization ends with exit flag 1. However, the x and fval output values are different based on the starting point, x0. What option should I modify to make it compute a single global solution irrespective of starting point?
x0 = [10.5,380,200]; % Different x and fval outputs based on x0
lb = [ 10;
10;
10];
ub = [ 50;
400;
300];
fnc = @(x) fun(x);
% options = optimoptions('simulannealbnd','StallIterLimit',4000,'TolFun',1e-20,''); <- this results in exit flag 0
rng default
[x,fval,exitflag,output] = simulannealbnd(fnc,x0,lb,ub,options)
Sample Output for different x0 and same lb,ub
1. x0 = [10.5,380,200] and using default options
> ANS: x =
   10.4875
  360.1725
  204.0897
    fval =
   0.1719 
2. x0 = [25,100,100] and using default options
> ANS: x =
10.3225
399.9853
116.3712
fval =
0.1673

채택된 답변

Alan Weiss
Alan Weiss 2020년 8월 24일
The answer is that you are using the wrong solver, and might have a wrong idea about what is possible.
For almost all problems, simulannealbnd is not the solver of choice. If your problem is smooth, you should use MultiStart combined with fmincon to solve your problem. If your problem is nonsmooth, you should use patternsearch with several initial points. See Table for Choosing a Solver. And for why your solution can depend on the initial point, irrespective of the solver, see What Is Global Optimization?
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 2
fizzy
fizzy 2020년 8월 25일
I was following information given here: https://in.mathworks.com/help/gads/improving-optimization-by-choosing-another-solver.html. The simulannealbnd is also in the category of "single global solution for smooth objective and constraints" (although it is recommended to use as last resort 😅).
The reason I went to it is because "global search with fmincon" was taking >=90 minutes to to complete while simulannealbnd does it it ~10 minutes (and the result from both solvers depend on starting point 🤷‍♂️). I will try MultiStart now to see if it's any better.
And just to be clear, if my function has many many local minima then does it mean that any of the solvers might not ever converge to a single global solution?
Alan Weiss
Alan Weiss 2020년 8월 25일
Alan Weiss
MATLAB mathematical toolbox documentation

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by