Professional Documents
Culture Documents
am "J&
"
)9
−𝑏 ± 𝑏 − 4𝑎𝑐
𝑥 = -61k¥
←
,
2𝑎
ji 0%14%1,61685
At 6, ? How
But what about polynomial of higher degrees or more complex functions? Is
it possible to find an analytical solution? If not, how to find the roots?
numercial methods )lKñj
In this chapter and the next chapter we will learn how to apply
different numerical algorithms to find the roots of different
types of equations
Engr310 – Numerical Methods for Engineers Majdi Adel 2
1
09/12/2021
Open methods • •
① Fixed point iteration, Newton-Raphson and secant methods
Roots
Roots problems occur when some function f can be written in terms of one or
more dependent variables x, where the solutions to f(x) = 0 yields the solution
to the problem
2
09/12/2021
•
✗ us ✗ iiia # , # 3- a-
IN ☆
ntsb Hibs.NU#r.sXuWQlt-&I&WoX-sw1d-&-w-ss ☆
Xugx # How -
Bracketing Methods
They are based on making two initial
guesses that bracket the root
Brackets are formed by finding two guesses xl
and xu where the sign of the function changes;
that is, where f(xl) f(xu) < 0
ojc.YIW8.ms
Engr310 – Numerical Methods for Engineers Majdi Adel 5
✗ us ✗ e) 41
f(xl) f(xu) > 0,
No roots – No
problem
f(xl) f(xu) < 0,
But we have i.HN
→
Xu three roots – Atlas #
That is another MÑl >
↑ xr
problem Wal - g
3
09/12/2021
Xr 791g Xi Xu f. I'M j§
☆ Number of itte rations : .
g ,
☆
'S 1092 Lo Xu Xi
To / ✗ -1×4
-
-
-
v19 - avarice
✗r
I
i-j@I1MGEiIEwiEa.d.Es
.Ñ4é 100
% '
is
④
91481
Whips ,
=
2
Tolarancetl ① I Ea
The Bisection
a
Method
☆ we should also find :-
Et=×% / ✗
rtrue
✗ 100%
Bisection Method
Is a variation of the incremental search method in which the interval is always divided
in half Pick xl and xu that they Calculate the relative
bound the root, check if Evaluate the value of the approximate error εa if
f(xl) f(xu) < 0 function at the midpoint xr εa < εs stop
1 3 5
2 4
If f(xl) f(xr) < 0 If f(xl) f(xr) > 0
The root xr is located at then the root is located OR then the root is located
the mid between xl and xu between xl and xr between xu and xr
Engr310 – Numerical Methods for Engineers Majdi Adel 8
↓
4
The Bisection Method
☆ Step ① : .
g ✗ dip .w1 Xu ÷d g × , d . . - I
f- ( ✗ 4. f( ✗ a) < 0
☆ step ② : -
☆ Step ③ : .
.
:
logical condition JI ☆ w ,# I & @ s - l
① f- ( ✗ ↳ fcxr ) ( 0 : -
✗r im XL
"
'
Xu = g
• • I •
✗ L Xr Xr Xu
d
Xu × ? #
2 fcxisfcxr ) >0 : -
th
XL = ✗r Xu " 9
×: % 1. %
✗ LA ? Aid
upper interval
f- ( ✗e) fcxrko
f- (X1 ) sik Xi , Xu ? × , #
# fcxu )
I 1 I
g①g
✗ ✗ fcxcsfcxr) > 0 ✗u
,
9 XLJI EX , #
lower d
is Xu ×"
×,
interval
Eajl £ ! Aid's Ea {
t.wizljob-sg.ES
r
g
A&t
Approximates
relative
error
-
True
relative
error
09/12/2021
Note that
𝑥 +𝑥
𝑥 =
2
𝑥 −𝑥
𝜀 = × 100%
𝑥
Pros Cons
Easy Slow
Always find root You must know xl and xu that
Number of iterations required to bound the root
attain an absolute error can be Multiple roots!
computed a priori (we will see this No account is taken of f(xl) and
in the next slide) f(xu). If f(xl) is closer to zero, it is
likely that the root is closer to xl
5
09/12/2021
XI
particular approximate error can be calculated log
based on the initial guesses: 𝐸 ,
𝑛=
log 2
iterations) I is Klug
Desired approximate error
j g- -61 1- a # Ea = εs / 100%
I e
☆To find ✗r : .
✗r = ✗a -
Éu)
fcx , ) - fcxu)
The False-
Position
Method
Regula-Falsi ☆ we should also find :-
Et=×É/ ✗
r
true
✗ too %
6
09/12/2021
•
iterations JI ↳ & is I root N bg I :# I ☆
False-Position Method
Another bracketing method that
determines the next guess not by
splitting the bracket in half but by
connecting the endpoints with a straight
line and determining the location of the
intercept of the straight line xr
𝑓 𝑥 𝑥 −𝑥 ☆
𝑥 =𝑥 −
𝑓 𝑥 −𝑓 𝑥
7
False Position Method
☆ Step ① : .
f ( ✗ 4. f( ✗ a) < 0
☆ step ② : -
ji
"
↳ É MI - Xu g Xi "& Xr is &
i.
04 01 10 g
faut CK ✗§
Xr
-
= ✗u -
fcxi ) fcxul
-
☆ Step ③ : .
.
:
logical condition JI µ w ,# I & @ so I
① f- ( ✗ ↳ fcxr ) ( 0 : -
✗r im XL &
"
'
Xu = g
• • I •
✗ L Xr Xr Xu
d
Xu × ? #
2 fcxisfcxr ) >0 : -
th
XL = ✗r Xu " 9
× : % 1. %
XLX ? Aid
upper interval
f- ( ✗e) fcxrko
f- (X1 ) sik Xi , Xu ? × , #
# fcxu )
I 1 I
¥É ¥
" fcxcsfcxr) > 0 Xu
9 XL JI ×, #
lower sima ×.
,
I g
☆Step ④ : -
q.im /
M .
Eg Ñ 1
Approximates
relative
error
/
True
relative
error
Assisi "
° # Iwi #
f.
b-# 901%61*1 As by :b %
Example : .
i. WI 661 Jsu 2% .
I -1 I - I 3 0 L - ve -
2 - I 0 - I 1 -0.5 0.375 -
ve look
3 -
I -0.5 -
I 0.375 -0.75 -0.171 + Ve 33.33%
4 -0.75 -0.5 -0.171 0.375 -0.625 0.13086 - Ve 20%
' /
' ^ 7 f
, , ,
'
I 1 I 1 I
,
1 I 1
l
I 1 ' I
1 I
1
I
I 1 1
1 I I 1
1
I 1 I [
1 I
! I
HJ4@g1bqrqwGiXugX.H.G ☆
fcxi ) -13-1 C- 1) + I
= = - 1 ,
fcxy) 13+1+1
= =
3
- ← I f. I Ñ
@ v. . & job ! Xr Mi g
I -13 0
Xr
-
= =
2
- :
✗r w JI Ñ go ↳
&
f- (Xr ) = 023+0-1 I = I
:@to co
µ.
# Xi g Xu M I & ¥ . ¥1
It -0,481 :&!
t.is#Jg1&Ea.-i6.WLW.W1iibIlIfcxr.Ifcxyo.H
.
4 g-
i ji µ ☆
- ✗a % ✗ r AJ g
6 É Xi É
±Érdd_ ✗
Ea =
/ ✗ rnew / 100
=/
5
✗ roid-s.IQ
°
100%
/ ✗ 100
- ◦ • -
-
O - 5
WI ai
#JI & fcxr) & fcxyu.is ⇐ t it & ☆
'd Is
"
WI %.sk ! V11 OH I
I jlb-511 is
g HWI ji ⑥ I &
09/12/2021
Example
Find the roots of the following function using (five iterations):
Bisection method
False position method
And calculate the number of iterations for the bisection method to have εs = 0.1%
Also calculate true relative error (true root is 1.000) and approximate relative error (εt and εa)
Use: xl = 0, xu = 1.3
𝑓 𝑥 =𝑥 −1
Bisection method
𝑓 1 = 0 − 1 = −1.000 𝑥 −𝑥
𝜀 = × 100%
𝑓 1.3 = 1.300 − 1 = 12.786 𝑥
𝑥 +𝑥 𝑥 −𝑥 ,
𝑥 = 𝜀 = × 100%
2 𝑥
0 + 1.300 1.000 − 0.650
= = 0.650 = × 100% = 35.000%
2 1.000
8
09/12/2021
9
€6s &.ws old ☆
Hit # 1 is
it# is
µ ";jµjl JIM # rest d
on
i am
⇐ ☆ to :&@ I Ishi is
☆
i -wid.com.bd?e--w1Xr+rue
n
→ A > W &
Significant
" "
Bisection method : _
1516
2%9 ! ,
I ]
fcxi ) fco) O' I -1.000
°
= = - =
f- ( ✗a) f- ( 1. 3) =L 3%1=12.786
= .
✗r =
1-3-10
= 0.650 → fcxr )=f(o 6501=0.650 .
"
-1=-0.987
2
Et =
/ €650
I
/ ✗ too = 35.000%
✗I = Xr = 0.650 Xu =L -3000
Ñ WI .
I
#I É # g
I
@ AN old# g- Wig
i.
ji I ↳ Em ; . iterations JI is Mi is Ii !
n =
#Hadj É = = 10.34 ≈ 11
log 2 1 09 mating
.jp His § it # if
09/12/2021
Example
Determine the positive real root of ln (x4) = 0.7, using three iteration with xl = 0.5 and xu = 2 by:
Bisection method lncx ) -0-7=0 ← 9%0 A Wi # 148
"
>
Example
For the function below, determine the roots, analytically, using bisection method and false position
method, with xl = 1 and xu = 3. Compute the approximate error εa and the true error εt after each
iteration. Is there a problem with the result?
𝑓 𝑥 = 0.8 − 0.3𝑥 𝑥
Bisection method i xl xu f(xl) f(xu) xr f(xr) f(xl) f(xr) εa εt
1 1.000 3.000
2
3
↓
10
:..Ñ -61 . ÑJXr+ruÑ÷bso↳
Ig ) ! Ñ ↳I>
£941
0.8-0-3 ✗
✗
*
0.8-0.37=0
→ ✗i. 2.66667
0=◦;? true
Xr -
_
1+-23=2 fcxr
)=_É= 0.1
Et :/ É
2. 66667
/ ✗
100=25 -000%
✗ v.
2+2-3=2.5 far )= -0.025
Et
=/ 2-6666-7-21
2.66667 / ✗ 100=6.258
fcxrt.IE#=-o.oo9
✗ r=
-2%3=2.75 275
Ea
:/ 2--72%-51×100=9.090%0
0.5 -0.033 2- 875 -0.0217 - ve -
7.8125%
✗ rjéGJ ! Wig
09/12/2021
Example
The velocity v of a falling parachutist is given by the equation below, where g = 9.8 m/s2. For a
parachutist with a drag coefficient C = 15 kg/s, compute the mass m so that the velocity is v = 35 m/s
at t = 9 s. Use the false-position method to determine m to a level of εs = 0.1%
𝑔𝑚 ⁄
𝑣= 1−𝑒
𝐶
i xl xu f(xl) f(xu) xr f(xr) f(xl) f(xr) εa
1 50.000 70.000
2
3
4
5
11