Question: use Python (1) There are many ways to reach f(x) = 0, to find Ir. We can use iteration on f(en) to decide on the

use Python

use Python (1) There are many ways to reach f(x) = 0,to find Ir. We can use iteration on f(en) to decide onthe next approximation: In+1 = F(x) = In - c. f(x) The

(1) There are many ways to reach f(x) = 0, to find Ir. We can use iteration on f(en) to decide on the next approximation: In+1 = F(x) = In - c. f(x) The choice of c is critical. Suppose in converges to Ir. Then, the limit of the above equation is: 2. = 2, -Cf() This gives f(x) = 0! Just what we want. But, is there a perfect value for c? Consider the linear equation f(x) = ar b. It has a zero at I, = b/a. Use the iteration In+1 = In - carn - b)(Early computers could not divide. They used such an iteration). Subtracting Iy from both sides: In+1 Ir = In - Ir carn b), Notice that In - Ir = en, the error in step n. OR en+1 = (1 - c:a)en, So at every step the error is multiplied by: (1 - c.a), which is F'. The error goes to zero IF |F"| tolerance and max iterations not exceeded, f(x) Calculate x = xo- f'(o) Set Xo = 21, fo = f(20) increase iteration count. when loop terminates, report Il as the approximation and the number of iteratio (each time you evaluate Also print the number of function evaluations: f or f = df da (1) There are many ways to reach f(x) = 0, to find Ir. We can use iteration on f(en) to decide on the next approximation: In+1 = F(x) = In - c. f(x) The choice of c is critical. Suppose in converges to Ir. Then, the limit of the above equation is: 2. = 2, -Cf() This gives f(x) = 0! Just what we want. But, is there a perfect value for c? Consider the linear equation f(x) = ar b. It has a zero at I, = b/a. Use the iteration In+1 = In - carn - b)(Early computers could not divide. They used such an iteration). Subtracting Iy from both sides: In+1 Ir = In - Ir carn b), Notice that In - Ir = en, the error in step n. OR en+1 = (1 - c:a)en, So at every step the error is multiplied by: (1 - c.a), which is F'. The error goes to zero IF |F"| tolerance and max iterations not exceeded, f(x) Calculate x = xo- f'(o) Set Xo = 21, fo = f(20) increase iteration count. when loop terminates, report Il as the approximation and the number of iteratio (each time you evaluate Also print the number of function evaluations: f or f = df da

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!