230 likes | 506 Views
Engineering Computation. Lecture 4. Open Methods (Newton-Raphson Method). Error Analysis for N-R : Recall that Taylor Series gives:. where x r x x i and f(x r ) = 0. Open Methods (Newton-Raphson Method). Dividing through by f '(x i ) yields. OR.
E N D
EngineeringComputation Lecture 4 E. T. S. I. Caminos, Canales y Puertos
Open Methods (Newton-Raphson Method) Error Analysis for N-R : Recall that Taylor Series gives: where xr x xi and f(xr) = 0 E. T. S. I. Caminos, Canales y Puertos
Open Methods (Newton-Raphson Method) Dividing through by f'(xi) yields OR Ei+1 is proportional to Ei2==>quadratic rate of convergence. E. T. S. I. Caminos, Canales y Puertos
Open Methods (Newton-Raphson Method) • Summary of Newton-Raphson Method: • Advantages: • Can be fast • Disadvantages: • May not converge • 2. Requires a derivative E. T. S. I. Caminos, Canales y Puertos
Open Methods (Secant Method) Secant Method Approx. f '(x) with backward FDD: Substitute this into the N-R equation: to obtain the iterative expression: E. T. S. I. Caminos, Canales y Puertos
Open Methods (Secant Method) Secant Method f(x) f(x) f(xi-1) f(xi) f(xi-1) f(xi) x xi+1 xi+1 xi-1 xi-1 x xi xi xi = xi+1 E. T. S. I. Caminos, Canales y Puertos
Open Methods (Secant Method) 1) Requires two initial estimates: xi-1 and xi These do NOT have to bracket root ! 2) Maintains a strict sequence: Repeated until: a. | f(xi+1) | < k with k = small number b. c. Max. number of iterations is reached. 3. If xi and xi+1 were to bracket the root, this would be the same as the False-Position Method. BUT WE DON'T! E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) • Fixed point Method • predict a value of xi+1 as a function of xi. • Convert f(x) = 0 to x = g(x) • iteration steps: xi+1 = g(xi ) x(new) = g(x(old) ) E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) Example II: x = sin(x) –> xi+1 = sin(xi) OR x = arcsin(x) –> xi+1 = arcsin(xi) Example I: E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) • Convergence: • Does x move closer to real root (?) • Depends on: • 1. nature of the function • 2. accuracy of the initial estimate • Interested in: • 1. Will it converge or will it diverge? • 2. How fast will it converge ? • (rate of convergence) E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) • Convergence of the Fixed pointMethod: • Root satisfies: xr = g(xr) • The Taylor series for function g is: • xi+1 = g(xr) + g'(x)(xi - xr) xr< x < xi • Subtracting the second equation from the first yields • (xr – xi+1) = g'(x) (xr – xi) or • 1. True error for next iteration is smaller than the true error in the previous iteration if |g'(x)| < 1.0 (it will converge). • 2. Because g'(x) is almost constant, the new error is directly proportional to the old error (linear rate of convergence). E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) • Further Considerations: • Convergence depends on how f(x) = 0 is • converted into x = g(x) • So . . . • Convergence may be improved • by recasting the problem. E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) • Convergence Problem: • For slowly converging functions • can be small, even though xnew is not close to root. • Remedy: • Do not completely rely on ea to ensure that the problem is solved. • Check to make sure |f(xnew) | < k . E. T. S. I. Caminos, Canales y Puertos
Open Methods (Fixed point method) E. T. S. I. Caminos, Canales y Puertos
Open Methods E. T. S. I. Caminos, Canales y Puertos
Open Methods Why do open methods fail? Function may not look linear. Remedy: recast into a linear form. For example, Is a poorly constrained problem in that there is a large, nearly flat zone for which the derivative is near zero. Recast as: i f(i) = 0 = 7,500 i - 1000 [ 1 - (1+i)-20 ] E. T. S. I. Caminos, Canales y Puertos
Open Methods Recast as: i f(i) = 0 = 7,500 i - 1000 [ 1 - (1+i)-20 ] • The recast function, "i f(i) will have the same roots as f(i) plus an additional root at i = 0. • It will not have a large, flat zone, thus: h(i) = i f(i) = 7,500 i – 1000 [ 1 – (1+ i)–20] • To apply N-R we also need the first derivative: h'(i) = 7,500 - 20,000 (1+ i)-21 E. T. S. I. Caminos, Canales y Puertos
Open Methods Cases of Multiple Roots Multiple Roots: f(x) = (x – 2)2 (x – 4) x = 2 represents two of the three roots. E. T. S. I. Caminos, Canales y Puertos
Open Methods Problems and Approaches: Cases of Multiple Roots 1.Bracketing Methods fail locating x = 2. Note that f(x) f(xr) > 0. 2. At x = 2, f(x) = f'(x) = 0. • Newton-Raphson and Secant methods may experience problems. • Rate of convergence drops to linear. • Luckily, f(x) 0 faster than f'(x) 0 3. Other remedies, recasting problem: Find x such that u(x) = 0 where: Note that u(x) and f(x) have same roots. E. T. S. I. Caminos, Canales y Puertos
Summary -- Rates of Convergence m = 1: linear convergence m = 2: quadratic convergence Method m Bisection 1 False Position 1 Secant, mult. root 1 NR, mult. root 1 Secant, single root 1.618 "super linear" NR, single root 2 Accel. NR, mult. root (f(x)/f'(x)=0) 2 E. T. S. I. Caminos, Canales y Puertos
Three Phase Rootfinding Strategy A real rootfinding problem can be viewed as having three phases: 1) Opening moves: One needs to find the region of the parameter space in which desired root can be found. Understanding of problem, physical insight, and common sense are valuable. 2) Middle Game: Use robust algorithm to reduce initial region of uncertainty. 3) End game: Generate a highly accurate solution in a few iterations. E. T. S. I. Caminos, Canales y Puertos