CES513 - Notes - Topic 1
CES513 - Notes - Topic 1
CES513 - Notes - Topic 1
1. Analyze, identify, formulate and solve related civil engineering problems using the Bisection
Method (CO1:PO2)
2. Use the Newton-Raphson to solve civil engineering method according to the required absolute
relative error or true error (CO1:PO2)
MOTIVATION
Roots of equations.
The values calculated with Eq. (1-1) are called the “roots” of Eq. (1-2) as they represent the values of
x that make Eq. (1-2) equal to zero. For this reason, roots are sometimes called the zeros of the
equation. Although the quadratic formula is handy for solving Eq. (1-2), there are many other functions
for which the root cannot be determined so easily. For these cases, the use of numerical methods
could provide efficient means to obtain the answer.
Before the advent of digital computers, there were several ways to solve for roots of algebraic and
transcendental equations. These includes:
1. Direct method
As the above example, Eq. (1-2) can be solved directly using the quadratic formula, Eq. (1-1).
Although there were equations that could be solved directly, there were many more that
could not. For example, even an apparently simple function such as f(x) = e−x cannot be
solved analytically. In such instances, the only alternative is an approximate solution
technique.
2. Graphical technique
One method to obtain an approximate solution is to plot the function and determine where
it crosses the x axis. This point, which represents the x value for which 𝑓𝑓 (𝑥𝑥 ) = 0, is the root.
Although graphical methods are useful for obtaining rough estimates of roots, they are limited
because of their lack of precision.
3. Trial and error.
This technique consists of guessing a value of x and evaluating whether 𝑓𝑓 (𝑥𝑥 ) is zero. If not (as
is almost always the case), another guess is made, and 𝑓𝑓(𝑥𝑥 ) is again evaluated to determine
NW | Mac-July 2020
CES513 | Topic 1
whether the new value provides a better estimate of the root. The process is repeated until a
guess is obtained that results in an 𝑓𝑓(𝑥𝑥 ) that is close to zero.
Such unsystematic methods are obviously inefficient and inadequate for the requirements of
engineering practice. The techniques described later in this topic represent alternatives that are also
approximate but employ systematic strategies to focus on the true root. The combination of these
systematic methods and computers makes the solution of most applied roots-of-equations problems
a simple and efficient task.
Revision.
Use the graphical approach to determine the drag coefficient, c needed for a parachutist of mass, m
= 68.1 kg to have a velocity of 40 m/s after freefalling for time t = 10s. Note: The acceleration due to
gravity is 9.81 m/s2.
Solution:
Various values of c can be substituted into the right-hand side of this equation to compute the f(c).
NW | Mac-July 2020
CES513 | Topic 1
These points are plotted in the figure below. The resulting curve
crosses the c axis between 12 and 16. Visual inspection of the
plot provides a rough estimate of the root of 14.75.
The validity of the graphical estimate can be checked by
substituting it into Eq. (1-3) to yield:
9.81(68.1)
𝑓𝑓(14.75) = �1 − 𝑒𝑒 −0.146843(14.75) � − 40 = 0.100
14.75
9.81(68.1)
𝑣𝑣 = �1 − 𝑒𝑒 −(14.75⁄68.1)10 � = 40.100
14.75
NW | Mac-July 2020
CES513 | Topic 1
The bisection method, which is alternatively called binary chopping, interval halving, or Bolzano’s
method, is one type of incremental search method in which the interval is always divided in half. If a
function changes sign over an interval, the function value at the midpoint is evaluated. The location
of the root is then determined as lying at the midpoint of the subinterval within which the sign change
occurs. The process is repeated to obtain refined estimates. The method is based on the following
theorem.
Theorem
a. has at least one root between 𝑥𝑥𝑙𝑙 and 𝑥𝑥𝑢𝑢 if [𝑓𝑓 (𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑢𝑢 ) < 0] - (See Figure 2)
b. there may or may not be any root between 𝑥𝑥𝑙𝑙 and 𝑥𝑥𝑢𝑢 if [𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓 (𝑥𝑥𝑢𝑢 ) > 0] - (Figure 3 and Figure 4)
c. there may be more than one root between 𝑥𝑥𝑙𝑙 and 𝑥𝑥𝑢𝑢 if [𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑢𝑢 ) < 0] - (Figure 5)
Figure 2 - At least one root exists between the two Figure 3 – If the function f(x) does not change sign between
points if the function is real, continuous and changes the two points, roots of the equation f(x)=0 may still be exists
sign. between the two points.
NW | Mac-July 2020
CES513 | Topic 1
Use bisection method to solve the same problem approached graphically in Example 1
Solution.
1st iteration.
The first step in bisection is to guess two values of the unknown that give values for 𝑓𝑓(𝑥𝑥 ) with different
signs. From Figure 1, we can see that the function changes sign between values of 12 and 16, that is
the lower bound, 𝒙𝒙𝒍𝒍 and upper bound, 𝒙𝒙𝒖𝒖 respectively. Figure 6 shows the graphical depiction of the
bisection method for this example.
NW | Mac-July 2020
CES513 | Topic 1
Therefore, the initial estimate of the root 𝒙𝒙𝒓𝒓 lies at the midpoint of the interval:
𝑥𝑥𝑙𝑙 + 𝑥𝑥𝑢𝑢 12 + 16
𝑥𝑥𝑟𝑟 = → 𝑥𝑥𝑟𝑟 = = 14
2 2
This estimate represents a true percent relative error of 𝜀𝜀𝑡𝑡 = 5.4% (note that the true value of the
root is 14.8011).
𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 − 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 14.8011 − 14
𝜀𝜀𝑡𝑡 = 100% → 𝜀𝜀𝑡𝑡 = 100% = 5.4%
𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 14.8011
Next we compute the product of the function value at the lower bound and at the midpoint:
9.81(68.1) −�
12
𝑓𝑓(𝑥𝑥𝑙𝑙 ) = 𝑓𝑓(12) = �1 − 𝑒𝑒 68.1�10 � − 40 = 6.114
12
9.81(68.1) −�
14
𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓 (14) = �1 − 𝑒𝑒 68.1�10 � − 40 = 1.611
14
𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓(12)𝑓𝑓(14) = 6.114(1.611) = 𝟗𝟗. 𝟖𝟖𝟖𝟖𝟖𝟖
9.850 > 0, and hence no sign change occurs between the lower bound and the midpoint.
Consequently, the root must be located between 14 and 16.
2nd iteration.
Therefore, new interval created by redefining the lower bound as 14 and determining a revised root
estimate as
14 + 16
𝑥𝑥𝑟𝑟 = = 15
2
which represents a true percent error of 𝜀𝜀𝑡𝑡 = 1.3%. The process can be repeated to obtain refined
estimates. For example,
3rd iteration.
The upper bound is redefined as 15, and the root estimate for the third iteration is calculated as
14 + 15
𝑥𝑥𝑟𝑟 = = 14.5
2
which represents a percent relative error of 𝜀𝜀𝑡𝑡 = 2.0%. The method can be repeated until the result
is accurate enough to satisfy your needs.
NW | Mac-July 2020
CES513 | Topic 1
The steps in Bisection Method can be repeated until the result is accurate enough and a refined
estimation of the root is obtained. Thus, an objective criterion is needed for deciding when to
terminate the method.
An initial suggestion might be to end the calculation when the true error falls below some prespecified
level. This strategy is flawed because the error estimates in the example were based true root of the
function. This would not be the case in an actual situation because there would be no point in using
the method if we already knew the root.
Therefore, an estimated error that is not dependent on the actual root of the function (which we don’t
exactly know). One is called as an approximate percent relative error 𝜀𝜀𝑎𝑎 which can be calculated as
𝑥𝑥𝑟𝑟𝑛𝑛𝑛𝑛𝑛𝑛 − 𝑥𝑥𝑟𝑟𝑜𝑜𝑜𝑜𝑜𝑜
𝜀𝜀𝑎𝑎 = � � 100% (1-4)
𝑥𝑥𝑟𝑟𝑛𝑛𝑛𝑛𝑛𝑛
Where,
When 𝜀𝜀𝑎𝑎 becomes less than a prespecified stopping criterion, 𝜺𝜺𝒔𝒔 or ( |𝜀𝜀𝑎𝑎 | < 𝜀𝜀𝑠𝑠 ) the computation is
terminated.
It is also convenient to relate these errors to the number of significant figures in the approximation. It
can be shown that if the following criterion is met, we can be assured that the result is correct to at
least n significant figures.
Continue Example 2 until the approximate error falls below a prespecified stopping criterion of 𝜺𝜺𝒔𝒔 =
𝟎𝟎. 𝟓𝟓%.
Solution.
The results of the first two iterations for Example 2 were 14 and 15. Substituting these values into Eq.
(1-4) yields
15 − 14
𝜀𝜀𝑎𝑎 = � � 100% = 6.667%
15
Recall that the true percent relative error for the root estimate of 15 was 1.3%. Therefore, 𝜀𝜀𝑎𝑎 is greater
than 𝜀𝜀𝑡𝑡 . This behavior is manifested for the other iterations as in the table below:
NW | Mac-July 2020
CES513 | Topic 1
Thus, after six iterations 𝜀𝜀𝑎𝑎 finally falls below 𝜀𝜀𝑠𝑠 = 0.5%, and the computation can be terminated.
These results are summarized in the above table. The “ragged” nature of the true error is due to the
fact that, for bisection, the true root can lie anywhere within the bracketing interval.
The true and approximate errors are far apart when the interval happens to be centered on the true
root. They are close when the true root falls at either end of the interval.
A float ball in a flush toilet shown in Figure 7 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:
Solution (a).
From the physics of the problem, the ball would be submerged between 𝑥𝑥 = 0 and 𝑥𝑥 = 2𝑅𝑅 , where
NW | Mac-July 2020
CES513 | Topic 1
Hence
𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑢𝑢 ) = 𝑓𝑓(0)𝑓𝑓(0.11) = 3.993 × 10−4 (−2.662 × 10−4 ) = −1.0629 × 10−7 [ < 0 ]
Meaning that, at least one root exists between 𝑥𝑥𝑙𝑙 and 𝑥𝑥𝑢𝑢 , that is between 0 and 0.11.
1st iteration.
𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓(0)𝑓𝑓(0.055) = 3.993 × 10−4 (6.655 × 10−4 ) = 2.6573 × 10−8 [ > 0 ]
At this point, the relative approximate error 𝜀𝜀𝑎𝑎 cannot be calculated as we do not have a previous
approximation.
2nd iteration.
𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓(0.055)𝑓𝑓(0.0825) = 6.655 × 10−5 (−1.622 × 10−4 ) = −1.0794 × 10−7 [ < 0 ]
3rd iteration.
NW | Mac-July 2020
CES513 | Topic 1
0.055 + 0.0825
𝑥𝑥𝑟𝑟 = = 0.06875
2
𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓 (0.06875) = (0.06875)3 − 0.165(0.06875)2 + 3.993 × 10−4 = −5.563 × 10−5
𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑟𝑟 ) = 𝑓𝑓(0.055)𝑓𝑓(0.06875) = 6.655 × 10−5 (−5.563 × 10−5 ) = −3.702 × 10−9 [ < 0 ]
Solution (b).
Eq. (1-5) can be employed to determine the error criterion that ensures a result is correct to at least
two significant figures:
1. The bisection method is always convergent. Since the method brackets the root, the method
is guaranteed to converge.
2. As iterations are conducted, the interval gets halved. So one can guarantee the error in the
solution of the equation.
1. The convergence of the bisection method is slow as it is simply based on halving the interval.
2. If one of the initial guesses is closer to the root, it will take larger number of iterations to reach
the root.
3. If a function of 𝑓𝑓(𝑥𝑥) that just touches the x-axis as in Figure 8, where 𝑓𝑓(𝑥𝑥 ) = 𝑥𝑥 2 = 0, the
lower and upper bound (𝑥𝑥𝑙𝑙 and 𝑥𝑥𝑢𝑢 ) would be impossible to guess.
NW | Mac-July 2020
CES513 | Topic 1
Figure 8 - The equation 𝑓𝑓(𝑥𝑥) = 𝑥𝑥 2 = 0 has a single root at 𝑥𝑥 = 0 that cannot be bracketed
4. For functions 𝑓𝑓(𝑥𝑥 ) where there is a singularity and it reverses sign at the singularity, the
bisection method may converge on the singularity. An example as in Figure 9 where,
1
𝑓𝑓(𝑥𝑥 ) =
𝑥𝑥
where 𝑥𝑥𝑙𝑙 = −2 and 𝑥𝑥𝑢𝑢 = 3 are valid initial guesses which satisfy 𝑓𝑓(𝑥𝑥𝑙𝑙 )𝑓𝑓(𝑥𝑥𝑟𝑟 ) < 0
However, the function is not continuous and the theorem for a root to exists is also not
applicable.
[*A singularity in a function is defined as a point where the function becomes infinite. For
example, for a function such as 1⁄𝑥𝑥 , the point of singularity is 0 = 𝑥𝑥 as it becomes infinite.]
1
Figure 9 – The equation 𝑓𝑓(𝑥𝑥) = 𝑥𝑥 = 0 has no root but changes sign.
A column is subjected to end moments, M and compressive force, N at its both ends. Under the
bending moments and compressive forces, the column experiences a lateral deflection by 𝜈𝜈 and
reached its maximum central lateral deflection, 𝜈𝜈𝑚𝑚𝑚𝑚𝑚𝑚 . The governing equation of the column’s lateral
deflection is given as follows:
𝑀𝑀 𝜋𝜋 𝑁𝑁
𝜈𝜈𝑚𝑚𝑚𝑚𝑚𝑚 = 𝑠𝑠𝑠𝑠𝑠𝑠 � � − 1�
𝑁𝑁 2 𝑃𝑃𝐸𝐸
where 𝑃𝑃𝐸𝐸 is the maximum compressive force that can be applied at the column’s ends.
By using the Bisection Method, determine the value of the compressive force, N to produce 0.0236m
maximum central deflection. Given that M = 20Nm and PE = 1000N. The stopping criteria is set as 1
percent of absolute relative error. Use the lower and upper guesses of the compressive forces
between 1100N and 1400N.
NW | Mac-July 2020
CES513 | Topic 1
Answer.
20 𝜋𝜋 𝑁𝑁
𝜈𝜈𝑚𝑚𝑚𝑚𝑚𝑚 = 0.0236 = 𝑠𝑠𝑠𝑠𝑠𝑠 � � − 1�
𝑁𝑁 2 1000
20 𝜋𝜋 𝑥𝑥
𝑓𝑓(𝑥𝑥 ) = 0.0236 − 𝑠𝑠𝑠𝑠𝑠𝑠 � � − 1� = 0
𝑥𝑥 2 1000
Thus, the value of applied compressive force, N that could cause a maximum deflection of 0.0236m
is 1269.8N. The calculation was terminated by considering the approximate error, 𝜀𝜀𝑎𝑎 of 0.72% which
lies below the specified error of 𝜀𝜀𝑠𝑠 = 0.5%.
NW | Mac-July 2020