Finding x & y-values that maximize an expression!!!!

7 ビュー (過去 30 日間)
Selen
Selen 2014 年 5 月 27 日
編集済み: Roger Stafford 2014 年 5 月 27 日
Hi all,
I want to find the x and y values that maximize the following expression.
Delta_i's are numeric values and R_i's are in terms of x and y.
Thank you!
  1 件のコメント
Selen
Selen 2014 年 5 月 27 日
Actually, I am looking for x and y values that maximize this expression. All r's and BS's are known. Is there any equivalent function of fminsearch for finding max values?
Thanks a lot!

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

採用された回答

Roger Wohlwend
Roger Wohlwend 2014 年 5 月 27 日
You can use the fminsearch function because maximizing J is the same as minimizing -J. That is why there is no optimizing function in MATLAB that finds maximas, there are only functions that find minimas.

その他の回答 (3 件)

Selen
Selen 2014 年 5 月 27 日
I already tried that but it gives me the error: Maximum number of function evaluations has been exceeded!
Should the argument of fminsearch be something else than -F?
Thanks.

George Papazafeiropoulos
George Papazafeiropoulos 2014 年 5 月 27 日
編集済み: George Papazafeiropoulos 2014 年 5 月 27 日
The expression for J does not have any maxima. This can be seen easily by geometric interpretation of the formula. J can be minimized according to he following:
BS=rand(7,2);
r=rand(7,1);
F=@(xy)(2*r(1).*hypot(xy(1)-BS(1,1),xy(2)-BS(1,2))+(hypot(xy(1)-BS(1,1),xy(2)-BS(1,2))).^2 ...
+2*r(2).*hypot(xy(1)-BS(2,1),xy(2)-BS(2,2))+(hypot(xy(1)-BS(2,1),xy(2)-BS(2,2))).^2 ...
+2*r(3).*hypot(xy(1)-BS(3,1),xy(2)-BS(3,2))+(hypot(xy(1)-BS(3,1),xy(2)-BS(3,2))).^2 ...
+2*r(4).*hypot(xy(1)-BS(4,1),xy(2)-BS(4,2))+(hypot(xy(1)-BS(4,1),xy(2)-BS(4,2))).^2 ...
+2*r(5).*hypot(xy(1)-BS(5,1),xy(2)-BS(5,2))+(hypot(xy(1)-BS(5,1),xy(2)-BS(5,2))).^2 ...
+2*r(6).*hypot(xy(1)-BS(6,1),xy(2)-BS(6,2))+(hypot(xy(1)-BS(6,1),xy(2)-BS(6,2))).^2 ...
+2*r(7).*hypot(xy(1)-BS(7,1),xy(2)-BS(7,2))+(hypot(xy(1)-BS(7,1),xy(2)-BS(7,2))).^2);
out=fmincon(F,[1,1],[1,1],inf)
  2 件のコメント
Selen
Selen 2014 年 5 月 27 日
Thank you.
Does this give me the minimizing x&y values or the maximizing ones?
George Papazafeiropoulos
George Papazafeiropoulos 2014 年 5 月 27 日
It gives the minimizing values....

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


Roger Stafford
Roger Stafford 2014 年 5 月 27 日
編集済み: Roger Stafford 2014 年 5 月 27 日
Revised statement: J has no maximum value. It could have local maxima points, depending on the locations of the points (xi,yi) and the delta values. However it is obvious that it can always be made arbitrarily large by moving the point (x,y) sufficiently far from the origin in any direction in the x-y plane.
For example, if there is only a single point (x1,y1), by locating (x,y) at that point, J would be at a local maximum - that is, it is greater there than at any point in its immediate neighborhood. If we draw a circle around the point (x1,y1) of radius delta1, J continues to decrease as (x,y) is moved away from (x1,y1) until reaching the circle where it would be zero. Beyond that, J increases again and it is clear that it can be made arbitrarily large by moving sufficiently far outside the circle. This also remains true with many points rather than one. There can be many local maxima points, but no absolute maximum is possible.

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by