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

lecture 4

The document discusses methods for finding roots of equations, focusing on bracketing methods such as the Bisection Method and the False-Position Method. It outlines the advantages and disadvantages of these methods, including the need for initial guesses and the computation of iterations required to achieve a desired error tolerance. Additionally, it provides strategies for selecting good initial guesses to improve the efficiency of the root-finding process.

Uploaded by

pmaldio866
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

lecture 4

The document discusses methods for finding roots of equations, focusing on bracketing methods such as the Bisection Method and the False-Position Method. It outlines the advantages and disadvantages of these methods, including the need for initial guesses and the computation of iterations required to achieve a desired error tolerance. Additionally, it provides strategies for selecting good initial guesses to improve the efficiency of the root-finding process.

Uploaded by

pmaldio866
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

EEE-228 Numerical Methods

Lecture 4
Roots of Equations, Bracketing Methods

1
Roots of Equations

• Easy

2 − b ∓ b 2 − 4ac
ax + bx + c = 0 ⇒ x =
2a

• But, not easy


ax 5 + bx 4 + cx 3 + dx 2 + ex + f = 0 ⇒ x=?

• How about these?


sin x + x = 0 ⇒ x=?
cos(10 x) + sin(3x) = 0 ⇒ x = ?
2
Graphical Approach
• Make a plot of the Using MATLAB, plot f(x)=sin(10x)+cos(3x)
function f(x) and
observe where it
crosses the x-axis,
i.e. f(x) = 0

• Not very practical


but can be used to
obtain rough
estimates for roots
Two distinct
• These estimates can roots between
be used as initial
x= 4.2 and 4.3
guesses for
numerical methods need to be careful
that we’ll study here.
Bracketing:
exceptions

Odd and even


number of roots

4
Bisection Method

xrnew − xrold
Relative error estimate : ε= new
100%
x r

Termination criteria: ε < Epsilon OR Max.Iteration is reached


How Many Iterations will It Take?
• Length of the first Interval Lo= xu- xl
• After 1 iteration L1=Lo/2
• After 2 iterations L2=Lo/4
….. …..
• After k iterations Lk=Lo/2k

• Then we can write:

Lk
≤ error _ tolerance
xl
L0
k
≤ xl * ε es
2
k L0 ⎛ L0 ⎞
2 ≥ ⇒ k ≥ log 2 ⎜⎜ ⎟⎟
xl * ε es ⎝ xl * ε es ⎠
6
Bisection Method

Pros Cons

• Easy • Slow
• Always finds a root • Need to find initial
• Number of iterations guesses for xl and xu
required to attain an • No account is taken
absolute error can be of the fact that if f(xl)
computed a priori. is closer to zero, it is
likely that root is
closer to xl .

7
The False-Position Method (Regula-Falsi)

• We can approximate the


solution by doing a
linear interpolation
between f(xu) and f(xl)

• Find xr such that


l(xr)=0, where l(x) is the
linear approximation of
f(x) between xl and xu

• Derive xr using similar


triangles

xl f u − xu f l
xr =
fu − fl
8
The False-Position Method
Works well, but not always!
çç Here is a pitfall L

Modified False-Position
One way to mitigate the “one-sided”
nature of the false position (i.e. the
pitfall case) is to have the algorithm
detect when one of the bounds is
stuck.

If this occurs, then the original


formula xr = (xl + xu)/2 can be used
How to find good initial guesses?

• Start at one end of the region of interest (xa) and evaluate


f(xa), f(xa+Δx), f(xa+2Δx), f(xa+3Δx), ........

• Continue until the sign of the result changes.


If that happens between f(xa+k*Δx) and f(xa+(k+1)*Δx)

then pick xl= xa+k*Δx and xu= xa+(k+1)*Δx

Problem:
if Δx is too small è search is very time consuming
if Δx is too large è could jump over two closely spaced roots

Ultimate solution:
Know the application and plot the function to see the location of the
roots, and pick xl and xu accordingly to start the iterations.
10

You might also like