フィルターのクリア

Setting properly the step tolerence of fmincon

2 ビュー (過去 30 日間)
Alberto Belvedere
Alberto Belvedere 2020 年 12 月 17 日
編集済み: Matt J 2020 年 12 月 19 日
I want fmincon to optimize my function using a step for my variables of 0.1. Setting step tolerance to 0.1 does not work.
According to fmincon description, step tolerance is a relative measurement and not an absolute one.
How can i make it work the way i want?
Example:
X=0.0 --> obj=5
X=0.1 --> obj=7
X_sol=0.0
I want the solver to skip all the values in between 0.0 and 0.1
PS Since the algorithm runs in a loop on a system with Ts=0.1 (almost smooth system since its dynamics are slower), i got situations in which i get X_sol_time_k=0.05 and X_sol_time_k+1=-0.05, which causes unwanted noise in the final solution.
So, not only solutions in between rounded intervals can cause the algorithm to make useless calculations, but also i get that unwanted noise
  2 件のコメント
Mario Malic
Mario Malic 2020 年 12 月 19 日
Can you evaluate your function from lower bound to upper bound with the step size of 0.1? If you have only one variable to optimize, then try it this way
x = lb:0.1:ub;
fval = zeros(length(x), 1)
for ii = 1 : length(x)
fval(ii) = objfun(x(ii)))
end
fmin = min(fval)
Alberto Belvedere
Alberto Belvedere 2020 年 12 月 19 日
Unfortunately, i have more than 10 variables and each one depends on the previous one...

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

回答 (1 件)

Matt J
Matt J 2020 年 12 月 19 日
編集済み: Matt J 2020 年 12 月 19 日
There is no way to make fmincon restrict its search to a discrete set of values.
  2 件のコメント
Alberto Belvedere
Alberto Belvedere 2020 年 12 月 19 日
Is there any other optimizer that does the job?
Matt J
Matt J 2020 年 12 月 19 日
編集済み: Matt J 2020 年 12 月 19 日
If you make a change of variables so that your the discrete space of feasible values are integers, then you can use an integer-constrained solver. If your problem is linear, then intlinprog() would be the thing to use. Otherwise, you would have to use ga().
That said, you should carefully consider whether you really need a discrete search. Discrete optimization is generally more difficult than continuous optimization.

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

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by