Powell's Algorithm not obeying Upper Bound (UB)

1 回表示 (過去 30 日間)
Debapriya Sengupta
Debapriya Sengupta 2022 年 5 月 18 日
コメント済み: Debapriya Sengupta 2022 年 5 月 21 日
Hello,
I am running Powell's algorithm with Golden Section method, to find the minimum of a function. My function call statement is as follows:
Q=pi/180;
S=Q*-8.5;
L=Q*-10;
U=Q*-8;
[xo,Ot,nS]=powell('My_Func',S,0,1,L,U,[],[],300);
My_Func is a user defined function. I am getting xo = -0.0727 as output, which is greater than U. Please explain why Powell's algorithm is not obeying boundaries.
  5 件のコメント
Jan
Jan 2022 年 5 月 18 日
@Debapriya Sengupta: How can we solve the problem without having your code and data? We cannot debug the function provided by Giovani Tonel 15 years ago - but you can. Use the debugger to step through the code line by line.
Debapriya Sengupta
Debapriya Sengupta 2022 年 5 月 19 日
I have already done a step run. I could not find a check for L or U anywhere in the code.

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

回答 (1 件)

Jan
Jan 2022 年 5 月 19 日
編集済み: Jan 2022 年 5 月 19 日
Yes, this is the documented behavior:
% Lb, Ub: lower and upper bound vectors to plot (default = x0*(1+/-2))
Lb and Ub are used for the graphics only.
Summary: You are using a function provided 15 years ago with a limited quality. It does not do, what you need and this is mentioned in the lean documentation. Then you explain in the forum, that this function does not do, what you need, but do not mention initially, which function you actually mean.
"Please explain why Powell's algorithm is not obeying boundaries."
Because this implementation of Powell's algorithm is not designed to consider the boundries for finding the result.
Sorry, you made it as hard as possible to find this trivial answer. You even found this answer by your own already: "I could not find a check for L or U anywhere in the code."
  8 件のコメント
Torsten
Torsten 2022 年 5 月 20 日
編集済み: Torsten 2022 年 5 月 20 日
The time when Powell's method became popular was FORTRAN time in software development. I guess you will find FORTRAN code for your problem in the internet.
Here is a link:
Debapriya Sengupta
Debapriya Sengupta 2022 年 5 月 21 日
Thank you.

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

カテゴリ

Help Center および File ExchangeFortran with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by