Finding Roots of Equations Bracketing Methods
Finding Roots of Equations Bracketing Methods
I
I
T
Dc
Lecture 04
E Finding Roots of equations
L Bracketing Methods
H
I
Bracketing Methods
1
1/18/2015
I Nonlinear Equation
I Solvers
T
D Bracketing Graphical Open Methods
E
L Bisection Newton Raphson
H False Position
(Regula-Falsi) Secant
I
All Iterative
3
Graphical Method
The real number x=x0 is a root of the polynomial
I f(x) if and only if f(x)=0
I
T
D
E
L
H
At least one root exists between two bounds xu
I
(upper) and xl (lower) if the function is real,
continuous, and changes sign.
2
1/18/2015
3
1/18/2015
Incremental Search
This method is based on the observation that when a real
continuous function f(x) changes sign there exists a root between
I them, i.e f ( x l ) f ( x u )<0
I
T Problem: The choice of the increment length. If the length is too
small, the search can be very time consuming. On the other
hand, if the length is too great, there is a possibility that closely
D spaced roots might be missed
E
L
H
I
Bisection Method
I
I
T
D
E
L
H
I
4
1/18/2015
Bisection Method
The Algorithm:
1. For the arbitrary equation of one variable, f(x)=0
I
2. Pick xl and xu such that they bound the root of interest, check
I if f(xl).f(xu) <0.
T
D 3. Estimate the root by evaluating f[(xl+xu)/2].
E
L 4. 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.
H
I
5
1/18/2015
I
I
T
D
E
L
H
I
Error Estimation
• To estimate the relative error, we can base it on
I the true value of root. If our guess is in doubt
I the error estimate may not be appropriate.
T • Therefore, we require an error estimate that is
not contingent on prior knowledge of the root.
D One way to do this is by estimating an
E approximate percent relative error as in
L
H
I
6
1/18/2015
I
I
T
D
E
L
H
I
7
1/18/2015
Estimation of Iteration
Length of the first Interval Lo=b-a
I After 1 iteration L1=Lo/2
I After 2 iterations L2=Lo/4
T After k iterations Lk=Lo/2k
D • When εa becomes less than a prespecified stopping
E criterion εs , the computation is terminated.
Lk
L εa ≤ ×100% εa ≤ εs
H x
I If the absolute magnitude of the error is E and Lo=2, how many
iterations will you have to do to get the required accuracy in the
solution?
2
E= 10 − 4 = ⇒ 2 k = 2 × 10 4 ⇒ k ≅ 14.3 = 15
2k
8
1/18/2015
D f ( xu )( xu − xl )
E xu − xr =
f ( xu ) − f ( xl )
L
H
I
f ( xu )( xl − xu ) xl f ( xu ) − xu f ( xl )
xr = xu − =
f ( xl ) − f ( xu ) f ( xl ) − f ( xu )
17
9
1/18/2015
10
1/18/2015
2 f ( xu ) − f ( xl )
1
I
xl f ( xu ) − 12 xu f ( xl )
• Or xr =
f ( xu ) − 12 f ( xl ) 21
11