KIL1005: NUMERICAL METHODS FOR ENGINEERING
SEMESTER 2, SESSION 2021/2022
LECTURE 2: FINDING ROOTS OF EQUATIONS
21 MARCH 2023
Department of Chemical Engineering
Faculty of Engineering
Universiti Malaya
ROOTS OF EQUATIONS
Root of quadratic formula for f(x)=0
b b 2
4ac
ax bx c 0 x
2
Known 2a
But
ax5 bx4 cx 3 dx2 ex f 0 x ?
sin x x 0 x ?
2
Nonlinear Equation
Solvers
Graphical Bracketing Open Methods
Bisection Newton Raphson
False Position
(Regula-Falsi) Secant
All Iterative
3
BRACKETING METHODS
• Two initial guesses for the root are
required. These guesses must “bracket” or
be on either side of the root.
== > Fig. 5.1
• If one root of a real and continuous
function, f(x)=0, is bounded by values
x=xl, x =xu then
f(xl) . f(xu) <0. (The function changes
sign on opposite sides of the root)
4
GRAPHICAL METHOD: EXAMPLE 1
Use the graphical approach to determine the drag coefficient needed for a
parachutist with mass m = 68.1 kg to have a velocity of 40 m/s after the free-
falling for t = 10 s. The acceleration due to gravity is 9.81 m/s2. Show step where
you check the answer by substituting c into the original equation.
𝑔𝑚
𝑓 𝑐 = 1−𝑒 −𝑣
𝑐
Tip: Start with c = 0 and increase the value by 2, i.e. 0, 2, 4, 6,..,20
5
6
THE BISECTION METHOD
For the arbitrary equation of one variable, f(x)=0
1. Pick xl and xu such that they bound the root of interest, check if f(xl).f(xu)
<0.
2. Estimate the root by evaluating f[(xl+xu)/2].
3. Find the pair
• If f(xl). f[(xl+xu)/2]<0, root lies in the lower interval, then xu=(xl+xu)/2 and
go to step 2.
7
• If f(xl). f[(xl+xu)/2]>0, root lies in the upper
interval, then xl= [(xl+xu)/2, go to step 2.
• If f(xl). f[(xl+xu)/2]=0, then root is (xl+xu)/2
and terminate.
4. Compare s with a
5. If a< s, stop. Otherwise repeat the
process.
8
EVALUATION OF METHOD
Pros Cons
• Easy • Slow
• Always find root • Know a and b that bound root
• Multiple roots
9
TERMINATION CRITERIA
• Without a termination criteria, the iteration will continue infinitely.
• Stopping criterion, εs – decide when to terminate the iteration.
• Happen when
εs = approximate relative error , εa
𝑥 −𝑥
𝜀 = 100%
𝑥
𝑥 = root for the present iteration
𝑥 = root for previous iteration
10
11
EXERCISE 1
1. Determine the root of:
𝑓 𝑥 = −0.5𝑥 + 2.5𝑥 + 4.5
(a) Graphically
(b) Using quadratic formula
(c) Using three iteration of the bisection method. Employ initial guesses of xl=5 and xu=10. Compute the
approximate relative error after each iteration.
1. 2. Determine the root of:
𝑓 𝑥 = 5𝑥 − 5𝑥 + 6𝑥 − 2
(a) Graphically
(b) Using the bisection method. Employ initial guesses of xl=0 and xu=1. Iterate until the approximate relative
error after each iteration falls below a stopping criterion of 10%.
12