Course Instructor Dr. Ramond C. Rump Oice: A 337 Phone: (915) 747 6958 E Mail: rcrump@utep.edu Topic 4b Open Methods or Root Finding EE 4386/5301 Computational Methods in EE Outline Open Methods or Root Finding Newton Raphson Method Secant Method Multiple Roots 2 1
Newton Raphson Method 3 We Start with An Function 4 2
We Make an Initial Guess or the Position o the Root 1 1 5 Evaluate the Function at 1 1 1 6 3
Calculate the Equation o the Line Tangential to the Point on () 1 1 1 m1 1 1 1 7 Calculate Where the Line Crosses the Ais 1 2 1 2 1 1 1 2 1 1 0 1 8 4
Evaluate the Function at 2 2 2 1 9 Calculate the Equation o the Line Tangential to the Point on () 2 2 1 2 m2 2 2 2 10 5
Calculate Where the Line Crosses the Ais 2 3 2 1 3 2 2 2 3 2 2 0 2 11 Evaluate the Function at 3 3 3 2 1 12 6
And so on 5 4 3 2 1 Converged in ive iterations. 13 Algorithm 1. Derive analtical epressions or () and (), or ()/ (). 2. Determine a good initial guess i. 3. Iterate until converged 1. Calculate i. i i i 2. Calculate new estimate or root i+1. i 1 i i 3. I i < tolerance, Done! 14 7
Poor or Unstable Convergence 15 Notes on Newton Raphson Method Does not require bounds. Requires a good initial guess. Requires () and () to be analtical. Converges etremel ast or unctions that are near linear. Algorithm vulnerable to instabilit Can converge to the wrong root i multiple roots eist. Newton Raphson s Method Newton s Method NRM is or root inding, whereas NM is or optimization. 16 8
Eample #1 Let () = sin. What is the root o () in the proimit o = 4? Step 1 Derive analtical epression or ()/ () sin sin sin tan d sin cos d This means our update equation is i 1 i i i tan i Step 2 MATLAB code r = 4; tol = 1e-6; d = in; Converges to 3.1416 while abs(d) > tol ater 4 iterations. d = tan(r); r = r - d; end Slide 17 Secant Method 18 9
We Start with Some Function 19 We Make Two Initial Guesses or the Position o the Root, 1 and 2 1 2 20 10
Evaluate the Function at 1 and 2 1 2 1 2 21 Calculate the Equation o the Line Connecting ( 1, 1 ) and ( 2, 2 ) rise slope m run 2 1 2 1 2 1 1 2 m 2 2 2 1 2 2 2 1 22 11
Calculate Where the Line Crosses the Ais 2 1 2 2 2 1 2 1 0 2 r 2 2 1 r 2 2 2 1 2 1 1 2 1 2 r 2 2 2 1 2 1 23 Evaluate the Function at the New Point r 1 2 r r 1 2 24 12
Adjust Points to 1 and 2 1 2 1 2 2 2 r r 1 2 2 1 25 Calculate Where the New Line Crosses the Ais 1 2 2 1 r 2 2 2 1 2 1 26 13
Evaluate the Function at the New Point r 1 2 r r 2 1 27 Adjust Points to 1 and 2 1 2 2 1 28 14
And so on 1 2 2 1 29 Algorithm 1. Determine two good initial guesses: 1 and 2. 2. Evaluate the unction at 1. 1 1 3. Iterate until converged 1. Evaluate unction at 2. 2. Calculate. 2 2 1 3. Make new irst point the old second point. 4. Calculate new 2. 2 2 2 2 2 1 and 1 2 1 2 5. I < tolerance, Done! 30 15
Notes on Secant Method Does not require bounds. Does not require () or () to be analtical Requires two good initial guesses Full numerical version o Newton s method Same weaknesses as Newton Raphson method Algorithm vulnerable to instabilit Can converge to the wrong root 31 Eample #1 Let () = sin. What is the root o () in the proimit o = 4? 1. Determine two good initial guesses: 1 =4.0 and 2 =3.9. 2. Evaluate the unction at 1. 1 1 3. Iterate until converged a. Evaluate unction at 2. 2 2 b. Calculate. 2 2 1 2 1 % DASHBOARD unc = @sin; 1 = 4.0; 2 = 3.9; tol = 1e-6; % IMPLEMENT SECANT METHOD 1 = unc(1); d = in; while abs(d) > tol 2 = unc(2); d = (2-1)*2/(2-1); 1 = 2; 1 = 2; 2 = 2 - d; end r = 2; c. Make new irst point the old second point. 1 2 and 1 2 d. Calculate new 2. 2 2 e. I < tolerance, Done! Converges to 3.1416 ater 5 iterations. Slide 32 16
Multiple Roots 33 Problem with Multiple Roots Our update equation or both Newton Raphson method and secant method involve ()/ (). When we have multiple roots, both () and () can go to zero at the root. This causes a divide b zero problem. single root 0 undeined 0 double root triple root Slide 34 17
A Useul Propert We can deine an auiliar unction u() that will have the same roots as () but who s derivative u () will not go to zero at the roots. u u This is the same auiliar unction we used or bracketing methods. Slide 35 The Fi I () has multiple roots, perorm root inding on the auiliar unction u() instead. u i u i i1 i i1 i i We can write our new update equation completel in terms o () and its derivatives as ollows. i i i1 i 2 i i i i Slide 36 18