Finding Maximum Iterations for False Position Method

13 ビュー (過去 30 日間)
Ronnie Walker
Ronnie Walker 2021 年 3 月 7 日
回答済み: Sarfo 2023 年 6 月 26 日
Hey everyone. I'm a second year ME student currently in a computing techniques class. We just finished discussing Closed and Open methods for root estimation (Bisection, False Postion, etc.). I have to write a code that estimates the root of a function on a given interval using the Bisection Method and the False Postion Method. I know that for the Bisection Method, there's a formula for determining the minimum iterations required to estimate a root with an error below a specified tolerance. I also know that there isn't a formula like that for the False Postion Method. However, in my code I'm running a while loop with two conditons. While the approximate error is greater than the specified tolerance OR when the number of iterations becomes greater than the maximum number of iteration, perform the calculations. My question: is there a way for someone to come up with a reasonable number of iterations to go through before terminating the calculations? Again, I know there isn't a mathematical formula you can use, I'm just looking for a "rule of thumb" so to speak.
I won't be linking my code, unless someone really want's to see it, because this is more a question about a method than how to implement that method into code.
Thanks!
  1 件のコメント
Jan
Jan 2021 年 3 月 7 日
Note: This is not twitter - no # before the tags. Thanks.

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

回答 (2 件)

Jan
Jan 2021 年 3 月 7 日
The rule of thumb is to limit the runtime to a duration, the user can bear. So waiting for an hour to detect, that the algorithm does not converge, is brute. For problems in homework questions 1000 iterations are save. For very complicated problems 1000 iterations can take some days already.

Sarfo
Sarfo 2023 年 6 月 26 日
b) Use the program to determine roots of these functions on the intervals indicated: f(x)=x²+x²-x-1 g(x)= x³ - 2 sinx h(x) = lnx\x on [1, 2] on [0.5, 2] on [3, 4]

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by