フィルターのクリア

convergence of fsolve solution stepsize

16 ビュー (過去 30 日間)
sarah
sarah 2015 年 6 月 1 日
コメント済み: Star Strider 2021 年 8 月 1 日
Any tips on convergence for fsolve function? My solution provides reasonable guesses based on inputs however it doesn't converge i.e. keeps giving error fsolve stopped because the relative size of the current step is less than the default value of the step size tolerance.
Is it possible to improve stepsize so it doesn't terminate?

採用された回答

Star Strider
Star Strider 2015 年 6 月 1 日
You can set the step size tolerance and other performance characteristics to different values by creating an options structure with the optimoptions function. Pass the structure to your fsolve call as the third parameter.
For instance, your code might change to:
opts = optimoptions('fsolve', 'TolFun', 1E-8, 'TolX', 1E-8);
[B,fval] = fsolve(@(b) myfun(b,x,y), b0, opts);
and whatever other options you want to change, although the default value for 'FinDiffRelStep' is likely as low as it should go. Experiment with the others to get the result you want.

その他の回答 (1 件)

Alan Weiss
Alan Weiss 2015 年 6 月 2 日
The exit message that you report does not indicate an error or a problem. fsolve is simply telling you why it stopped. See the documentation on exit flags and exit messages, and I suggest that you read the exit message part especially carefully.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
Swarn Kalsi
Swarn Kalsi 2021 年 8 月 1 日
I have a set of equations that MathCad solves effortlessley. But, MATLAB can't. What's i am missing?
Star Strider
Star Strider 2021 年 8 月 1 日
@Swarn Kalsi Most likely the Symbolic Math Toolbox.

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by