Explanation for formula calculating step size for finite difference used in fmincon

12 ビュー (過去 30 日間)
Hainan Wang
Hainan Wang 2021 年 4 月 10 日
編集済み: Matt J 2021 年 4 月 11 日
When I view the page of ‘fmincon’, one option in optimset is ‘FiniteDifferenceStepSize’. The descriptions are copied below:
FiniteDifferenceStepSize to a vector v, the forward finite differences delta are
delta = v.*sign(x).*max(abs(x),TypicalX);
where sign(x) = sign(x) except sign(0) = 1. Central finite differences are
delta = v.*max(abs(x),TypicalX);
What's the meaning of v, x and typicalX in formula?
For example, I want to calculate the step size ‘delta’ for obtaining the gradient of objective function J with respect to variables u_i by forward finite difference method, i.e., for forward finite difference, partial J/partial u_i= [J(u1,u2,…,u_i + deltau_i,…, uend)-J(u1,u2,...,u_i,...,uend)]/deltau_i. I guess 'v' in formula is the u vector [u1, u2,...,uend]?? But what does x and TypicalX mean?
Thank you in advance!

採用された回答

Matt J
Matt J 2021 年 4 月 10 日
編集済み: Matt J 2021 年 4 月 11 日
  • v is the value assigned to the optimoptions parameter FiniteDifferenceStepSize.
  • TypicalX is another optimoptions parameter whose default is a vector of ones.
  • x is the current vector of unknown optimization variables (you seem to be calling it u).

その他の回答 (0 件)

カテゴリ

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