0% found this document useful (0 votes)
22 views

The Newton-Raphson Method

The document discusses the Newton-Raphson method for finding the roots of nonlinear equations. It provides the graphical representation and mathematical formulation of the Newton-Raphson method. The algorithm is presented along with two examples showing its application and sensitivity to initial guesses. The Newton-Raphson method converges faster than bisection but requires a good initial guess and function/derivative evaluations at each step.

Uploaded by

rayan alkurdi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

The Newton-Raphson Method

The document discusses the Newton-Raphson method for finding the roots of nonlinear equations. It provides the graphical representation and mathematical formulation of the Newton-Raphson method. The algorithm is presented along with two examples showing its application and sensitivity to initial guesses. The Newton-Raphson method converges faster than bisection but requires a good initial guess and function/derivative evaluations at each step.

Uploaded by

rayan alkurdi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

University of Baghdad Numerical Methods and Reservoir Simulation

Department of Petroleum Engineering 2020

2. The Newton-Raphson Method


Newton’s Method, also called the Newton–Raphson Method, usually converges
much faster than the linearly convergent methods. The geometric picture of
Newton’s Method is shown in Figure 2. To find a root of f (x) = 0, a starting guess
x0 is given, and the tangent line to the function f at x0 is drawn. The tangent line
will approximately follow the function down to the x-axis toward the root. The
intersection point of the line with the x-axis is an approximate root, but probably
not exact if f curves. Therefore, this step is iterated.

Figure 2 – The graphical representation of Newton-Raphson method

The equation of a straight line is given by the equation:


𝑦 𝑎 𝑏𝑥

where b is called the slope of the line.


If we know the slope b and one point (xo, yo) (initial guess) on the line, the above
equation becomes
𝑦 𝑦 𝑏 𝑥 𝑥

To converge to the solution, the new solution is x1, therefore assume that
𝑏 𝑓 𝑥
𝑦 𝑓 𝑥
𝑓 𝑥
𝑥 𝑥

The slope crosses the x-axis at x = x1 and y=0. Since this point (x1, f(x1)) = (x1,0)
lies on the slope line, it satisfies the above equation. By substitution,
0 𝑓 𝑥 𝑓 𝑥 . 𝑥 𝑥

17
University of Baghdad Numerical Methods and Reservoir Simulation
Department of Petroleum Engineering 2020

𝑓 𝑥
𝑥 𝑥
𝑓 𝑥
and in general,
𝑓 𝑥
𝑥 𝑥
𝑓 𝑥

Newton-Raphson Algorithm
1- Assume the initial guess of the root (xn)
2- Apply the following equation to calculate the new guess of the root (xn+1):
𝑓 𝑥
𝑥 𝑥
𝑓 𝑥
3- Calculate the absolute difference between the old and the new guesses of root
|𝒙𝒏 𝟏 𝒙𝒏 |, and then if
|𝒙𝒏 𝟏 𝒙𝒏 | 𝜀
Then, xn+1 is the final solution and the solution procedure should STOP.
Otherwise, if
|𝒙𝒏 𝟏 𝒙𝒏 | 𝜀
Then,
𝒙𝒏 𝟏 𝒙𝒏 , and go back to STEP 2.
where, ε is allowable error difference

Example (1)
Use Newton’s method to approximate the positive root of
𝑥 𝑥 1 0
Accurate to within ε=0.001.
Assume the initial guess = 1

Solution

𝑓 𝑥 𝑥 𝑥 1 0

𝑓 𝑥 6𝑥 1

18
University of Baghdad Numerical Methods and Reservoir Simulation
Department of Petroleum Engineering 2020

Apply Newton-Raphson to solve the equation

n xn f(xn) f'(xn) xn+1 |𝒙𝒏 𝟏 𝒙𝒏 |

1 1 -1 5 1.2 0.2
2 1.2 0.785984 13.92992 1.143576 0.056424
3 1.143576 0.093032 10.73481 1.134909 0.008666
4 1.134909 0.001907 10.29685 1.134724 0.000185

Note that after 4 steps we have |𝒙𝒏 𝟏 𝒙𝒏 | = 0.000185 < 0.001 hence the required
root approximation is xn+1 = 1.1349.

Note that Newton-Raphson method converges to the root of a nonlinear equation


faster than the bisection method. Where that the solution is done within 10 steps
using Bisection method, while Newton-Raphson reaches the final solution after
four steps only.

Comparison between Newton-Raphson method and Bisection method leads to:


 Newton’s method converges much faster, but has limitations based upon the
derivative of the function in question.
 The bisection method is slow, but has no limitations and will always get you
to the same answer eventually.
 The method you use will depend upon whether Newton’s runs into problems
with the function in question. In most cases, Newton’s is going to be
preferable. On the other hand, Newton’s method requires one function and
the derivative evaluation per iteration. It is often difficult to estimate the cost
of evaluating the derivative in general (if it is possible).

19
University of Baghdad Numerical Methods and Reservoir Simulation
Department of Petroleum Engineering 2020

Example (2)
Resolve Example (1) using initial guess = 5
n  xn  f(xn)  f'(xn)  xn+1  |𝒙𝒏 𝟏 𝒙𝒏 | 
1 5 15619 18749 4.166942 0.833058
2 4.166942 5229.691 7536.697 3.473045 0.693897
3 3.473045 1750.469 3030.82 2.895489 0.577556
4 2.895489 585.3982 1220.128 2.415705 0.479784
5 2.415705 195.3142 492.5949 2.019204 0.396501
6 2.019204 64.75765 200.3967 1.696057 0.323147
7 1.696057 21.10754 83.20801 1.442385 0.253672
8 1.442385 6.562686 36.45909 1.262384 0.180001
9 1.262384 1.784755 18.2357 1.164512 0.097871
10 1.164512 0.329302 11.84906 1.136721 0.027791
11 1.136721 0.020639 10.38728 1.134734 0.001987
12 1.134734 9.86E-05 10.28811 1.134724 9.59E-06

As noted, Newton-Raphson is sensitive to the value of the initial guess as shown in


Example (1) and Example (2).

Newton-Raphson method (key points)


Advantages and disadvantages of Newton’s method:
 The error decreases rapidly with each iteration.
 Newton’s method is very fast. (Compare with bisection method!)
 Unfortunately, for bad choices of x0 (the initial guess) the method can fail to
converge! Therefore, the choice of x0 is very important.
 Each iteration of Newton’s method requires two function evaluations, while
the bisection method requires only one.

20

You might also like