Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
(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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started