Baixe o app para aproveitar ainda mais
Prévia do material em texto
03.05 Newton-Raphson Method of Solving Nonlinear Equations After reading this chapter, you should be able to: 1. Understand how to use the Newton-Raphson method for solving nonlinear equations. What is the Newton-Raphson method and how does it differ from other methods to solve nonlinear equations? Methods such as bisection method and the false position method of finding roots of a nonlinear equation f(x=0 require bracketing of the root by two guesses. Such methods are called bracketing methods. These methods are always convergent since they are based on reducing the interval between the two guesses to zero in on the root. 03.05.1 03.05.2 Chapter 03.05 In the Newton-Raphson method, the root is not bracketed. Only one initial guess of the root is needed to get the iterative process started to find the root of an equation. Hence, the method falls in the category of open methods. Newton-Raphson method is based on the principle that if the initial guess of the root of f(x)=0 is at xi, then if one draws the tangent to the curve at f(xi), the point xi+1 where the tangent crosses the x-axis is an improved estimate of the root (Figure 1). Using the definition of the slope of a function, at ixx = θ) = (xf i tan′ 1 0 +− −′ ii i i xx )f(x) = = (xf which gives )f'(x )f(x - = xx i i ii 1+ (1) Equation (1) is called the Newton-Raphson formula for solving nonlinear equations of the form . So starting with an initial guess, xi, one can find the next guess, xi+1, by using equation (1). One can repeat this process until one finds the root within a desirable tolerance. ( ) 0=xf Algorithm The steps to apply Newton-Raphson method to find the root of an equation f(x) = 0 are 1. Evaluate f′(x) symbolically 2. Use an initial guess of the root, xi, to estimate the new value of the root xi+1 as Newton-Raphson Method 03.05.3 )f'(x )f(x - = xx i i ii 1+ 3. Find the absolute relative approximate error, a∈ as 010 1 1 x x - xx = i ii a + +∈ 4. Compare the absolute relative approximate error, a∈ with the pre- specified relative error tolerance, s∈ . If a∈ > s∈ , then go to step 2, else stop the algorithm. Also, check if the number of iterations has exceeded the maximum number of iterations. f(x) f(xi) f(xi+1) xi+2 xi+1 xi X θ ( )[ ]ii xfx , Figure 1. Geometrical illustration of the Newton-Raphson method 03.05.4 Chapter 03.05 Example 1 You are working for ‘DOWN THE TOILET COMPANY’ that makes floats for ABC commodes. The ball has a specific gravity of 0.6 and has a radius of 5.5 cm. You are asked to find the distance to which the ball will get submerged when floating in water. Figure 2. Floating ball problem The equation that gives the depth ‘x’ to which the ball is submerged under water is given by 010993.3165.0 423 =×+− −xx Use the Newton-Raphson method of finding roots of equations to find a) the depth ‘x’ to which the ball is submerged under water. Conduct three iterations to estimate the root of the above equation. b) find the absolute relative approximate error at the end of each iteration, and c) the number of significant digits at least correct at the end of each iteration. Solution ( ) 423 10993.31650 −×+−= x.xxf Newton-Raphson Method 03.05.5 ( ) x.xxf 3303 2 −=′ Let us assume the initial guess of the root of ( ) 0=xf is ..x 0500 = Iteration #1 The estimate of the root is ( ) ( )0 0 01 xf xfxx ′−= ( ) ( )( ) ( )0503300503 10993.30501650050050 2 423 ... .... − ×+−−= − 3 4 109 10118.1050 − − ×− ×−= . ( )01242.0050 −−= . 062420.= The absolute relative approximate error, a∈ at the end of Iteration #1 is 100 1 01 ×−=∈ x xx a 100 062420 050062420 ×−= . .. = 19.89% The number of significant digits at least correct is 0, as you need a absolute relative approximate error of less than 5% for one significant digit to be correct in your result. Iteration #2 The estimate of the root is ( ) ( )1 1 12 xf xfxx ′−= 03.05.6 Chapter 03.05 ( ) ( )( ) ( )0624203300624203 10993.30624201650062420062420 2 423 ... .... − ×+−−= − 3 7 1090973.8 10977813062420 − − ×− ×−−= .. ( )5104645.4062420 −×−= . 062380.= The absolute relative approximate error, a∈ at the end of Iteration #2 is 100 2 12 ×−=∈ x xx a 100 062380 062420062380 ×−= . .. %06410.= The number of significant digits at least correct is 2. Iteration #3 The estimate of the root is ( ) ( )2 2 23 xf xfxx ′−= ( ) ( )( ) ( )0623803300623803 10993.30623801650062380062380 2 423 ... .... − ×+−−= − 3 11 1091171.8 1042937.4062380 − − ×− ×−= . ( )9109703.4062380 −×−−= . 062380.= The absolute relative approximate error, a∈ at the end of Iteration #3 is Newton-Raphson Method 03.05.7 100 062380 062380062380 ×−=∈ . .. a 0= The number of significant digits at least correct is 4, as only 4 significant digits are carried through in all the calculations. 03.05.8 Chapter 03.05 Drawbacks of Newton-Raphson Method 1. Divergence at inflection points: If the selection of a guess or an iterated value turns out to be close to the inflection point of f(x), that is, near where f”(x)=0, the roots start to diverge away from the root. For example, to find the root of ( ) ( ) .01 3 =−= xxf Table 1. Divergence at inflection point Iteration Number xi a∈ % f(xi) 0 1 2 3 4 5 6 7 8 -1 -0.33333 0.11111 0.40741 0.60494 0.73663 0.82442 0.88294 0.92196 200 400 72.73 32.65 17.88 10.65 6.629 4.232 -8 -2.3704 -0.70233 -0.2081 -0.06166 -0.01827 -5.4132x10-3 -1.60389x10-3 -4.75226x10-3 -20 -15 -10 -5 0 5 10 -2 -1 0 1 2 1 2 3 f(x) x Figure 3: Divergence at inflection point for ( ) ( ) 01 3 =−= xxf . Newton-Raphson Method 03.05.9 What is an inflection point? For a function f(x) where the concavity changes from up-to-down or down-to-up are called inflection points of the graph. For example in the function, , the concavity changes at x=1. In fact, it also changes sign at x=1 and thus brings up the Inflection Point Theorem for a function f(x) that states : “If f’(c) exists and f’’(c) changes sign at x = c , then the point (c, f(c)) is an inflection point of the graph of f. ( ) ( )31−= xxf 2. Division of zero or near zero: The formula of Newton-Raphson method is )(xf )f(xxx i i ii ′−=+1 Consequently if an iteration value, is such that ix ( ) 0≅′ ixf , then one can face division by zero or a near-zero number. This will give a large magnitude for the next value, xi+1. An example is finding the root of the equation ( ) 623 1042030 −×+−= .x.xxf in which case ( ) x.xxf 0603 2 −=′ For or , division by zero occurs (Figure 4). For an initial guess close to0.02, of , even after 9 iterations, the Newton-Raphson method is not converging. 00 =x 02.00 =x 01999.00 =x Table 2. Division by near zero in Newton Raphson method Iteration Number xi a∈ f(xi) 0 1 2 3 4 5 0.019990 -2.6480 -1.7620 -1.1714 -0.77765 -0.51518 100.75 50.282 50.422 50.632 50.946 -1.6000 x 10-6 -18.778 -5.5638 -1.6485 -0.48842 -0.14470 03.05.10 Chapter 03.05 6 7 8 9 -0.34025 -0.22369 -0.14608 -0.094490 51.413 52.107 53.127 54.602 -0.042862 -0.012692 -0.0037553 -0.0011091 -1.00E-05 -7.50E-06 -5.00E-06 -2.50E-06 0.00E+00 2.50E-06 5.00E-06 7.50E-06 1.00E-05 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04 x f(x) 0.02 Figure 4. Pitfall of division by zero or a near zero number. 3. Root jumping: In some case where the function f(x) is oscillating and has a number of roots, one may choose an initial guess close to a root. However, the guesses may jump and converge to some other root. For example for solving the equation 0sin =x if you choose ( 539822.74.20 == )πx as an initial guess, it converges to the root of x=0 as shown in Table 3. However, one may have chosen this an initial guess to converge to π2=x . 28318536.= Table 3. Root jumping in Newton Raphson method Iteration Number ix f(xi) a∈ 0 1 7.539822 4.461 0.951 -0.969 68.973 Newton-Raphson Method 03.05.11 2 3 4 5 0.5499 -0.06303 6.376x10-4 -1.95861x10-13 0.5226 -0.06303 8.375x10-4 -1.95861x10-13 711.44 971.91 7.54x104 4.27x1010 -1.5 -1 -0.5 0 0.5 1 1.5 -2 0 2 4 6 8 10 x f(x) -0.06307 0.5499 4.461 7.539822 Figure 5. Root jumping from intended location of root for ( ) 0sin == xxf 03.05.12 Chapter 03.05 Oscillations near local maximum and minimum: Results obtained from Newton- Raphson method may oscillate about the local maximum or minimum without converging on a root but converging on the local maximum or minimum. Eventually, it may lead to division to a number close to zero and may diverge. For example for ( ) 022 =+= xxf the equation has no real roots Table 4. Oscillations near local maxima and minima in Newton Raphson method. Iteration Number ix f(xi) a∈ 0 1 2 3 4 5 6 7 8 9 -1.0000 0.5 -1.75 -0.30357 3.1423 1.2529 -0.17166 5.7395 2.6955 0.9770 3.00 2.25 5.062 2.092 11.874 3.57 2.029 34.942 9.268 2.954 _____ 300.00 128.571 476.47 109.66 150.80 829.88 102.99 112.927 175.96 Newton-Raphson Method 03.05.13 -1 0 1 2 3 4 5 6 -2 -1 0 1 2 3 f(x) x 3 4 2 1 -1.75 -0.3040 0.5 3.142 Figure 6: Oscillations around local minima for ( ) 22 += xxf Derivation of Newton Raphson method from Taylor series Newton-Raphson method can also be derived from Taylor series. For a general function f(x), the Taylor series is ( ) ( ) ( )( )iiiii xxxfxfxf −′+= ++ 11 + ( ) L+++ 212 iii xx! )f"(x As an approximation, taking only the first two terms of the right hand side, ( ) ( ) ( )( )iiiii xxxfxfxf −′+≈ ++ 11 and we are seeking a point where f(x) = 0, that is, if we assume ( ) ,xf i 01 =+ ( ) ( )( )iiii xxxfxf −′+≈ +10 which gives 03.05.14 Chapter 03.05 . )f'(x )f(xxx i i ii −=+1 This is the same Newton-Raphson method formula series as derived previously using the geometric method. NONLINEAR EQUATIONS Topic Newton-Raphson Method of Solving Nonlinear Equations Summary Text book notes of Newton Raphson method of finding roots of nonlinear equation, including convergence and pitfalls. Major General Engineering Authors Autar Kaw Date June 25, 2007 Web Site http://numericalmethods.eng.usf.edu Newton-Raphson Method of Solving Nonlinear Equations What is the Newton-Raphson method and how does it differ from other methods to solve nonlinear equations? Algorithm Example 1 Solution Drawbacks of Newton-Raphson Method What is an inflection point? Table 2. Division by near zero in Newton Raphson method Table 3. Root jumping in Newton Raphson method Table 4. Oscillations near local maxima and minima in Newton Raphson method. Derivation of Newton Raphson method from Taylor series This is the same Newton-Raphson method formula series as derived previously using the geometric method. Topic
Compartilhar