Finding Maximum Iterations for False Position Method

27 views (last 30 days)
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!

Answers (2)

Jan
Jan on 7 Mar 2021
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 on 26 Jun 2023
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]

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!