how to find minimumvalue in discontinuous function??

3 ビュー (過去 30 日間)
Seong Ik Kim
Seong Ik Kim 2017 年 11 月 30 日
コメント済み: Seong Ik Kim 2017 年 12 月 1 日
In this function,
absohandle=@(t)-abs(exp(t).*(1.0./2.0)-2.0)
I want to find minimum function value in the range 0<=t<=2.... so i used fminbnd like this.
[minimumposition, minimumfunctionvalue]=fminbnd(absohandle,0,2)
But the result is false.
In matlab's result is minimumposition=4.8379e-05 minimumfunctionvalue=-1.5000
but the true result is minimumposition=2 minimumfunctionvalue=-1.6945
In this situation, how to modify my code???

採用された回答

Cam Salzberger
Cam Salzberger 2017 年 11 月 30 日
Hello Seong,
If you check the documentation for fminbnd, it says that it only looks for a local minimum. It can't guarantee that this is the correct global minimum across the boundary.
On the other hand, the Global Optimization Toolbox is made for finding the global solution instead of local solutions. Since this is a simple 1-D problem, you can easily solve it with a GlobalSearch object, simply following the example on the doc page.
problem = createOptimProblem('fmincon', ...
'objective', absohandle, ...
'x0', 1, 'lb', 0, 'ub', 2);
gs = GlobalSearch;
[x, f] = run(gs, problem)
Alternatively, you could iterate over the range in small increments with fminbnd, then pick the lowest point out of those results. Or do an initial spread of a 100 points or something and calculate the values, picking the bounds based on the lowest points discovered there. But global optimization methods are far more likely to produce the correct result.
-Cam
  1 件のコメント
Seong Ik Kim
Seong Ik Kim 2017 年 12 月 1 日
Thank you for your answer!! From now on i didn't read docu entirely. And i don't know globalsearch..... Again, Thank you...

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!