MATH 2140 Numerical Methods
In this course on Numerical Methods led by Dr. Mohamed El-Shazly, students delve into the application of Newton-Raphson Method for root approximation. The stepwise process involves symbolic evaluation, initial guess estimation, error calculation, and iteration comparisons. Practical examples and convergence discussions enrich the learning experience. Get ready to master these essential computational techniques in the Mechanical Engineering Department.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Faculty of Engineering Mechanical Engineering Department MATH 2140 Numerical Methods Instructor: Dr. Mohamed El-Shazly Associate Prof. of Mechanical Design and Tribology melshazly@ksu.edu.sa Office: F072
Newton-Raphson Method ( ) f x = i x x + 1 i i ( ' ) f x i 2
Step 1 f (x ) Evaluate symbolically. http://numericalmethods.eng.usf.edu 3
Step 2 ix Use an initial guess of the root, , to estimate the new value of the root, , as 1 + ix ( ) ( ) x f x i x = x - +1 i i f i http://numericalmethods.eng.usf.edu 4
Step 3 Find the absolute relative approximate error as a x - x + 10 0 1 = i i a x + 1 i http://numericalmethods.eng.usf.edu 5
Step 4 Compare the absolute relative approximate error with the pre-specified relative error tolerance . s Go to Step 2 using new estimate of the root. Yes Is ? a s No Stop the algorithm Also, check if the number of iterations has exceeded the maximum number of iterations allowed. If so, one needs to terminate the algorithm and notify the user. http://numericalmethods.eng.usf.edu 6
Derivation Example Convergence Final Remarks Newton s Method Example 2: Fixed-Point Iteration & Newton s Method Consider the function f(x) = cosx x = 0 Approximate a root of f using (a) a fixed-point method, and (b) Newton s Method Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires
Derivation Example Convergence Final Remarks Newton s Method & Fixed-Point Iteration (a) Fixed-Point Iteration for f(x) = cosx x Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 15 / 33
Derivation Example Convergence Final Remarks Newton s Method & Fixed-Point Iteration (a) Fixed-Point Iteration for f(x) = cosx x A solution to this root-finding problem is also a solution to the fixed-point problem x = cosx and the graph implies that a single fixed-point p lies in [0, / 2]. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 15 / 33
Derivation Example Convergence Final Remarks Newton s Method & Fixed-Point Iteration (a) Fixed-Point Iteration for f(x) = cosx x A solution to this root-finding problem is also a solution to the fixed-point problem x = cosx and the graph implies that a single fixed-point p lies in [0, / 2]. The following table shows the results of fixed-point iteration with p0 = / 4. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 15 / 33
Derivation Example Convergence Final Remarks Newton s Method & Fixed-Point Iteration (a) Fixed-Point Iteration for f(x) = cosx x A solution to this root-finding problem is also a solution to the fixed-point problem x = cosx and the graph implies that a single fixed-point p lies in [0, / 2]. The following table shows the results of fixed-point iteration with p0 = / 4. The best conclusion from these results is that p 0.74. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 15 / 33
Derivation Example Convergence Final Remarks Newton s Method & Fixed-Point Iteration Fixed-Point Iteration: x = cos(x), x0= pn 1 4 en/en 1 pn|pn pn 1| 0.0782914 0.053138 0.035577 0.024052 0.016159 0.010903 0.007336 n 1 0.7853982 2 0.707107 3 0.760245 4 0.724667 5 0.748720 6 0.732561 7 0.743464 0.7071068 0.760245 0.724667 0.748720 0.732561 0.743464 0.736128 0.678719 0.669525 0.676064 0.671826 0.674753 0.672816 Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires
Derivation Example Convergence Final Remarks Newton s Method (b) Newton s Method for f(x) = cosx x Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 17 / 33
Derivation Example Convergence Final Remarks Newton s Method (b) Newton s Method for f(x) = cosx x T o apply Newton s method to this problem we need ft(x) = sinx 1 Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 17 / 33
Derivation Example Convergence Final Remarks Newton s Method (b) Newton s Method for f(x) = cosx x T o apply Newton s method to this problem we need ft(x) = sinx 1 Starting again with p0= / 4, we generate the sequence defined, for n 1, by f(pn 1) n 1) cospn 1 pn 1 sinpn 1 1. pn = pn 1 f(pt = pn 1 Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 17 / 33
Derivation Example Convergence Final Remarks Newton s Method (b) Newton s Method for f(x) = cosx x T o apply Newton s method to this problem we need ft(x) = sinx 1 Starting again with p0= / 4, we generate the sequence defined, for n 1, by f(pn 1) n 1) cospn 1 pn 1 sinpn 1 1. pn = pn 1 f(pt = pn 1 This gives the approximations shown in the following table. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 17 / 33
Derivation Example Convergence Final Remarks Newton s Method Newton s Method for f(x) = cos(x) x, x = pn 1 f (pn 1) 1 0.78539816 -0.078291 2 0.73953613 -0.000755 3 0.73908518 -0.000000 4 0.73908513 -0.000000 4 0 f1(pn 1) -1.707107 -1.673945 -1.673612 -1.673612 pn |pn pn 1| 0.04586203 0.00045096 0.00000004 0.00000000 n 0.73953613 0.73908518 0.73908513 0.73908513 Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 18 / 33
Derivation Example Convergence Final Remarks Newton s Method Newton s Method for f(x) = cos(x) x, x = pn 1 f (pn 1) 1 0.78539816 -0.078291 2 0.73953613 -0.000755 3 0.73908518 -0.000000 4 0.73908513 -0.000000 4 0 f1(pn 1) -1.707107 -1.673945 -1.673612 -1.673612 pn |pn pn 1| 0.04586203 0.00045096 0.00000004 0.00000000 n 0.73953613 0.73908518 0.73908513 0.73908513 An excellent approximation is obtained with n = 3. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 18 / 33
Derivation Example Convergence Final Remarks Newton s Method Newton s Method for f(x) = cos(x) x, x = pn 1 f (pn 1) 1 0.78539816 -0.078291 2 0.73953613 -0.000755 3 0.73908518 -0.000000 4 0.73908513 -0.000000 4 0 f1(pn 1) -1.707107 -1.673945 -1.673612 -1.673612 pn |pn pn 1| 0.04586203 0.00045096 0.00000004 0.00000000 n 0.73953613 0.73908518 0.73908513 0.73908513 An excellent approximation is obtained with n = 3. Because of the agreement of p3and p4we could reasonably expect this result to be accurate to the places listed. Numerical Analysis (Chapter 2) Newton s Method R L Burden & J D Faires 18 / 33
Example 3 You are working for DOWN THE TOILET COMPANY that makes floats for ABC commodes. The floating ball has a specific gravity of 0.6 and has a radius of 5.5 cm. You are asked to find the depth to which the ball is submerged when floating in water. Figure 3 Floating ball problem. 24
Example 3 Cont. The equation that gives the depth x in meters to which the ball is submerged under water is given by ( ) 165 0 x . - x x f = 3 2 4 - 3 993 . 10 + Figure 3 Floating ball problem. Use the Newton s 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) 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. http://numericalmethods.eng.usf.edu 25
Example 1 Cont. Solution To aid in the understanding of how this method works to find the root of an equation, the graph of f(x) is shown to the right, where ( ) x = 3 2 4 - 0 165 . 3 993 . 10 f x - x + Figure 4 Graph of the function f(x) http://numericalmethod s.eng.usf.edu 26
Example 1 Cont. ( ) x f ' Solve for ( ) ( ) x ' = 3 2 4 - . 165 0 3 993 10 f x x 3 - x + . = 2 - . 0 33 f x x ( ) x = 0 f Let us assume the initial guess of the root of is . This is a reasonable guess (discuss why and are not good choices) as the extreme values of the depth x would be 0 and the diameter (0.11 m) of the ball. 0= x 0 = . 0 05 m x = . 0 11 m x http://numericalmethod s.eng.usf.edu 27
Example 1 Cont. Iteration 1 The estimate of the root is ( ) ( ) ( . 0 f x = 0 x x 1 0 ' f x 0 ) ( . 0 2 ) 33 3 2 + 4 05 . 0 165 05 3 .993 10 = . 0 05 ( . 0 3 ) ( . 0 ) 05 . 0 05 4 . 1 118 10 0.05 = 3 9 10 ( ) = 0.05 = . 0 01242 . 0 06242 http://numericalmethod s.eng.usf.edu 28
Example 1 Cont. Figure 5 Estimate of the root for the first iteration. http://numericalmethod s.eng.usf.edu 29
Example 1 Cont. The absolute relative approximate error at the end of Iteration 1 is a x x x = 1 0 100 a 1 . 0 06242 . 0 05 = 100 . 0 06242 = 19 . 90 % The number of significant digits at least correct is 0, as you need an absolute relative approximate error of 5% or less for at least one significant digits to be correct in your result. http://numericalmethod s.eng.usf.edu 30
Example 1 Cont. Iteration 2 The estimate of the root is ( ) ( ) ' x f f x = 1 x x 2 1 1 ( . 0 ) ( . 0 3 ( . 0 2 ) 3 2 + 4 06242 . 0 165 06242 .993 3 10 = . 0 06242 ) ( . 0 ) 06242 . 0 33 06242 7 . 3 97781 10 06242 . 0 = 90973 . 8 3 10 5 ( . 4 ) = 06242 . 0 = 4646 10 . 0 06238 http://numericalmethod s.eng.usf.edu 31
Example 1 Cont. Figure 6 Estimate of the root for the Iteration 2. http://numericalmethod s.eng.usf.edu 32
Example 1 Cont. The absolute relative approximate error at the end of Iteration 2 is a x x x = 100 2 1 a 2 . 0 06238 . 0 06242 = 100 . 0 06238 = . 0 0716 % 2 m 5 . 0 10 The maximum value of m for which is 2.844. Hence, the number of significant digits at least correct in the answer is 2. a http://numericalmethod s.eng.usf.edu 33
Example 1 Cont. Iteration 3 The estimate of the root is ( ) ( ) ' x f f x = 2 x x 3 2 2 ( . 0 ) ( 10 ( . 0 2 ) 3 2 + 4 06238 . 0 165 06238 3 .993 10 = 06238 . 0 ) ( . 0 ) 3 06238 . 0 . 0 33 06238 11 . 4 44 06238 . 0 = 3 . 8 91171 10 ( ) = 9 06238 . 0 = . 4 9822 10 06238 . 0 http://numericalmethod s.eng.usf.edu 34
Example 1 Cont. Figure 7 Estimate of the root for the Iteration 3. http://numericalmethod s.eng.usf.edu 35
Example 1 Cont. The absolute relative approximate error at the end of Iteration 3 is a x x x = 100 2 1 a 2 . 0 06238 . 0 06238 = 100 . 0 06238 = 0 % The number of significant digits at least correct is 4, as only 4 significant digits are carried through all the calculations. http://numericalmethod s.eng.usf.edu 36