Question: A false position function of your own. Note that if you get the bisection routine running, you only need one line to change it to
A false position function of your own. Note that if you get the bisection routine running, you only need one line to change it to a false position routine. The matlab function fzero() OR the python function scipy.optimize.fsolve() For the first two of these (bisection, false position), compare how many iterations it takes to find the root to a stopping criterion of 1e-6, using the same starting guesses for each method (but different guesses for each equation f1, f2). Comment on this.
I need help with part 3 and 4 that was written in top of the question.
For the equations: f1(x) = -452.736 - 180.389 x + 188.285 x^2 + 12.4001 x^3 - 12.28 x^4 + x^5 f2(x) = x - cos(2 x/pi) + 2 exp(-x/3) - (x/10)^2 1. Create anonymous functions for each of f1, f2. 2. Plot the equations over the interval [0, 100). This will enable you to get good starting guesses to find the roots. 3. Find the first positive root of each equation above using 1. A bisection function of your own. 2. A false position function of your own. Note that if you get the bisection routine running, you only need one line to change it to a false position routine. 3. The matlab function fzero(). 4. For the first two of these (bisection, false position), compare how many iterations it takes to find the root to a stopping criterion of 1e-6, using the same starting guesses for each method (but different guesses for each equation f1, f2). Comment on this. For the equations: f1(x) = -452.736 - 180.389 x + 188.285 x^2 + 12.4001 x^3 - 12.28 x^4 + x^5 f2(x) = x - cos(2 x/pi) + 2 exp(-x/3) - (x/10)^2 1. Create anonymous functions for each of f1, f2. 2. Plot the equations over the interval [0, 100). This will enable you to get good starting guesses to find the roots. 3. Find the first positive root of each equation above using 1. A bisection function of your own. 2. A false position function of your own. Note that if you get the bisection routine running, you only need one line to change it to a false position routine. 3. The matlab function fzero(). 4. For the first two of these (bisection, false position), compare how many iterations it takes to find the root to a stopping criterion of 1e-6, using the same starting guesses for each method (but different guesses for each equation f1, f2). Comment on this