Professional Documents
Culture Documents
CES513 - Notes - Topic 1.2
CES513 - Notes - Topic 1.2
1.2 Newton Raphson Method
Learning Outcomes.
At the end of this lecture, you should be able to:
3. Analyze, identify, formulate and solve related civil engineering problems using the Newton‐
Raphson Method (CO1:PO2)
4. Use the Newton‐Raphson to solve civil engineering method according to the required absolute
relative error or true error (CO1:PO2)
Background
For the Bisection Method which in the category of a ‘bracketing methods’, the root is located within
an interval prescribed by a lower and an upper bound (Figure 10(a)). Repeated application of these
methods always resulting in closer estimates of the true value of the root. Such methods are said to
be convergent because they move closer to the truth as the computation progresses.
In contrast, the open methods described in this chapter are based on formulas that require only a
single starting value of x or two starting values that do not necessarily bracket the root. As such, they
sometimes diverge or move away from the true root as the computation progresses (Figure 10(b)).
However, when the open methods converge (Figure 10(c)), they usually do so much more quickly than
the bracketing methods.
Figure 10 ‐ Graphical depiction of the fundamental difference between the (a) bracketing and (b) and (c) open methods for
root location.
NW | Mac‐July 2020 P a g e | 13
CES513 | Topic 1
Newton‐Raphson formula
The Newton‐Raphson method can be derived based on the geometrical interpretation that, if the
initial guess at the root is 𝑥 , a tangent can be extended from the point 𝑥 , 𝑓 𝑥 . From Figure 11, a
tangent to the function of 𝑥 which is 𝑓 𝑥 is extrapolated down to the x axis to provide an estimate
root at 𝑥 . The point where this tangent cross the 𝑥 axis usually represents an improved estimate of
the root.
Figure 11 ‐ Graphical depiction of the Newton‐Raphson method.
As in Fig. 6.5, the first derivative at 𝑥 is equivalent to the slope:
𝑓 𝑥 0
𝑓′ 𝑥 (1‐6)
𝑥 𝑥
which can be rearranged to yield:
𝑓 𝑥
𝑥 𝑥 (1‐7)
𝑓′ 𝑥
which is called the Newton‐Raphson formula.
Steps.
1. Evaluate 𝑓′ 𝑥 symbolically.
2. Use an initial guess of the root 𝑥 , to estimate the new value of the root 𝑥 , as
𝑓 𝑥
𝑥 𝑥
𝑓′ 𝑥
3. Determine the absolute relative error, 𝜀 or the true error 𝜀 if the true value of the root is
known.
4. Compare the error with the pre‐specified relative error tolerance, 𝜀 and check if the
number of iterations has exceeded the maximum number of iterations allowed.
5. Stop the iterations if the prespecified relative error and the maximum number of iterations
allowed has been exceeded, or else repeat step 2.
NW | Mac‐July 2020 P a g e | 14
CES513 | Topic 1
Example 5. Newton‐Raphson Method.
Use the Newton‐Raphson method to estimate the root of 𝑓 𝑥 𝑒 𝑥 employing an initial guess
of 𝑥 0. Note that the true value of the root is 0.56714329.
Solution.
The first derivative of the function can be evaluated as
𝑓 𝑒 1
which can be substituted along with the original function to give
𝑒 𝑥
𝑥 𝑥
𝑒 1
Starting with an initial guess of 𝑥 0, this iterative equation can be applied to compute:
i xi ɛt (%)
0 0 100
1 0.5 11.839
2 0.566311003 0.147
3 0.567143165 2.20E‐05
4 0.567143290 ‐7.23E‐08
Thus, the approach rapidly converges on the true root. Notice the fast decreasing pattern of the true
percent relative error.
Derivation of the Newton‐Raphson Method using Taylor series
Aside from the geometric derivation of Eq. (1‐6) and (1‐7) the Newton‐Raphson method may also be
developed from the Taylor series expansion. This alternative derivation is useful in that it also
provides insight into the rate of convergence of the method.
The Taylor series expansion can be represented as:
𝑓′′ 𝜉
𝑓 𝑥 𝑓 𝑥 𝑓′ 𝑥 𝑥 𝑥 𝑥 𝑥
2!
where 𝜉 lies somewhere in the interval from 𝑥 to 𝑥 . An approximate version is obtainable by
truncating the series after the first derivative term:
𝑓 𝑥 ≅𝑓 𝑥 𝑓′ 𝑥 𝑥 𝑥
At the intersection with the 𝑥 axis, 𝑥 would be equal to zero, or:
0 𝑓 𝑥 𝑓′ 𝑥 𝑥 𝑥 and can be solved for:
𝑓 𝑥
𝑥 𝑥
𝑓′ 𝑥
which is identical to Eq. (1‐7). Thus, we have derived the Newton‐Raphson formula using a Taylor
series.
NW | Mac‐July 2020 P a g e | 15
CES513 | Topic 1
Example 6. Newton‐Raphson Method
This problem is similar to Example 2 which used the Bisection Method to solve the problem.
Figure 12 – Float ball problem.
A float ball in a flush toilet shown in Figure 12 has a specific gravity of 0.6 and a radius of 5.5 cm. You
are asked to find the depth to which the ball is submerged when floating in water. The depth 𝑥 to
which the ball is submerged under water is expressed as:
𝑥 0.165𝑥 3.993 10 0
Use the Newton‐Raphson method of finding roots of equations for:
a) the depth 𝑥 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 least number of significant digits, 𝑛 that the answer can be considered correct for each
iteration.
Solution.
𝑓 𝑥 𝑥 0.165𝑥 3.993 10
𝑓′ 𝑥 3𝑥 0.33𝑥
Let us assume the initial guess of the root is 𝑥 0.05m. This is a reasonable guess, as the extreme
values of the depth 𝑥 would be 0 and the 0.11m (diameter of the ball). Discuss why these two values
of 𝑥 0 and 𝑥 0.11m is not a good choice.
1st iteration.
The estimated is:
𝑓 𝑥
𝑥 𝑥
𝑓′ 𝑥
0.05 0.165 0.05 3.993 10
𝑥 0.05
3 0.05 0.33 0.05
𝑥 0.0624222m
NW | Mac‐July 2020 P a g e | 16
CES513 | Topic 1
The absolute relative error 𝜀 at the end of the 1st iteration is:
𝑥 𝑥 0.0624222 0.05
𝜀 100 100 19.90%
𝑥 0.0624222
Referring to Eq. (1‐5), the number of significant figures that the result assured to be correct can be
determined from:
𝜀 0.5 10 %
19.90 0.5 10
39.8 10
𝑙𝑜𝑔 39.8 2 𝑛
𝑛 2 𝑙𝑜𝑔 39.8
𝑛 0.4
The number of significant figures for the result assured to be correct is 0.
By calculation, to get a result that correct to at least 1 significant figure, an absolute relative
approximate error, 𝜀 of 5% or less is needed.
2nd iteration.
The estimated root is:
𝑓 𝑥
𝑥 𝑥
𝑓′ 𝑥
0.0624222 0.165 0.0624222 3.993 10
𝑥 0.0624222
3 0.0624222 0.33 0.0624222
𝑥 0.0623776m
The absolute relative error 𝜀 at the end of the 2nd iteration is:
𝑥 𝑥 0.0623776 0.0624222
𝜀 100 100 0.07157%
𝑥 0.0623776
The number of significant figures that the result assured to be correct:
0.07157 0.5 10
0.14314 10
𝑙𝑜𝑔 0.14314 2 𝑛
𝑛 2.844
Thus, the result is correct to at least 2 significant figures.
NW | Mac‐July 2020 P a g e | 17
CES513 | Topic 1
3rd iteration.
The estimated root is:
𝑓 𝑥
𝑥 𝑥
𝑓′ 𝑥
0.062377577 0.165 0.062377577 3.993 10
𝑥 0.062377577
3 0.062377577 0.33 0.062377577
𝑥 0.062377582m
The absolute relative error 𝜀 at the end of the 3rd iteration is:
𝑥 𝑥 0.062377582 0.062377577
𝜀 100 100 0.00001%
𝑥 0.062377582
The number of significant figures that the result assured to be correct:
0.00001 0.5 10
𝑙𝑜𝑔 0.00002 2 𝑛
𝑛 6.798
Thus, the result is correct to at least 6 significant figures.
*Conduct the iterations in Excel for a faster process and more accurate results.
Pitfalls (drawbacks) of the Newton‐Raphson Method
Although the Newton‐Raphson method is often very efficient, there are situations where it performs
poorly. Even when dealing with simple roots, difficulties can also arise, as in the following example.
1. Example of a slowly converging function with Newton‐Raphson.
Initial guess of root, 𝑥 0.5.
𝑓 𝑥 𝑥 1
𝑓 𝑥 10𝑥
𝑥 1
𝑥 𝑥
10𝑥
Thus, after the first poor prediction, the technique is converging on the true root of 1, but at
a very slow rate.
NW | Mac‐July 2020 P a g e | 18
CES513 | Topic 1
2. Divergence at inflection points.
Figure 13 depicts the case where an inflection point (that is 𝑓′′ 𝑥 0) occurs in the vicinity
of a root. Notice that iterations beginning at 𝑥 progressively diverge from the root.
Figure 13
An Inflection Point is where a curve changes from Concave upward to Concave
downward (or vice versa)
The second derivative tells us if the slope increases or decreases.
When 𝑓′′ 𝑥 0, the function is concave upward.
When 𝑓 0, is where the inflection point.
When 𝑓′′ 𝑥 0, the function is concave downward.
3. Oscillation around a local maximum or minimum.
Figure 14 illustrates the tendency of the Newton‐Raphson technique to oscillate around a
local maximum or minimum. Such oscillations may persist, or as in Figure 14, a near‐zero slope
is reached, whereupon the solution is sent far from the area of interest.
Figure 14
NW | Mac‐July 2020 P a g e | 19
CES513 | Topic 1
4. Root jumping
Figure 15 shows how an initial guess that is close to one root can jump to a location several
roots away. This tendency to move away from the area of interest is because near zero slopes
are encountered.
Figure 15
5. Zero slope.
Obviously, a zero slope [ 𝑓′ 𝑥 0 ] is truly a disaster because it causes division by zero in the
Newton‐Raphson formula in Eq. (1‐7). Graphically from Figure 16, shows that the solution
shoots off horizontally and never hits the x axis.
Figure 16
Exercise 2.
A bookshelf was made to carry books with the height range from 8.5” to 11”. The shelf length is 29”
with a thickness of 3/8” and a width of 12”. The vertical deflection of a bookshelf in Figure 17 is
given by:
where 𝑥 is the position along the length of the bookshelf.
Figure 17 – A loaded bookshelf
NW | Mac‐July 2020 P a g e | 20
CES513 | Topic 1
Use the Newton‐Raphson method to find the position 𝒙 where the deflection is maximum. Conduct
three iterations to estimate the root of the above equation. Find the absolute relative approximate
error at the end of each iteration, and the least number of significant digits, n that the answer can be
considered correct for each iteration.
Answer.
Deflection equation:
Maximum deflection occurs at 𝑓 𝑥 0, that is:
Thus, the position 𝑥 where the deflection is maximum deflection occurs is 14.57253”. The result
obtained is correct to at least 7 significant numbers.
NW | Mac‐July 2020 P a g e | 21