Need help solving this problem with newtons method

2 件のコメント

James Tursa
James Tursa 2020 年 5 月 4 日
Newton's Method or Euler's Method?
Rena Berman
Rena Berman 2020 年 5 月 14 日
(Answers Dev) Restored edit

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

回答 (1 件)

James Tursa
James Tursa 2020 年 5 月 4 日
編集済み: James Tursa 2020 年 5 月 4 日

0 投票

To match how you are calling it, you need to switch the order of the arguments in this function handle:
F = @(p, t) k*p*(L-p)-a*sin((2*pi*t)/b);
to this
F = @(t, p) k*p*(L-p)-a*sin((2*pi*t)/b);
Also, you should strongly consider decreasing your step size by quite a bit. Maybe you could experiment with N in the 100's to see what works well. E.g., start with N = 100, then N = 200, etc. until you get answers that seem to be stable.

1 件のコメント

T
T 2020 年 5 月 4 日
Thanks for the help!!

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

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

質問済み:

T
T
2020 年 5 月 4 日

コメント済み:

2020 年 5 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by