KIE3005: Numerical Analysis
Root finding - Method of False PositionRoot finding : The method of False Position
= The method of False Position is another “bracketing” method
for finding roots of f(x) = 0
= Like Bisection, an essential starting point
is knowing two values of x at which the
function has opposite sign
fe)
— Alower bound x, and an upper bound x, as|
= Because the function changes sign in the interval as / xy
[x x,], there MUST be a root in between 3
"There might be more than one asInstead of using the midpoint as a guess,
in the method of False Position we draw
the chord between the two points
(SG) and (x, .f(&,))
The estimate of the root (x,) is where this
chord crosses the x-axis
What is this x-value?Root finding : The method of False Position
= Simplifying the figure gives us the following geometry
= Fundamentally it is two similar triangles
= Hence f(s,)-0 o-S(s)
ok OH
= Solving for x, gives x, = LE)%= SO),
F(%,)- F%)
= This can also be written as
x,ex-
OS fQ)- FO)
FDL)
PoDe-%) __ Sd(x-™)
So)Root finding : The method of False Position
= As with Bisection, for the next iteration, we choose a new interval
— Thus we replace either x) or x, with x,
= If f(x) and /(x,) have the same sign:
S(%)* f(%,)>0
— The root must lie between x, and x,
— We set the "new" x; = x,
= If f(x) and f(x,) have different signs:
F(%)* FH) <0
— The root must lie between x, and x,
— We set the "new" x, = x,Root finding : The method of False Position
= Regardless of which limit we change, make
the next guess for the root equal to the
where the chord crosses the axis
x LO Ss,
" £A)-£R)
= Continue iterating until /(x,) is close
enough to zero
= Often, we will approach the root mostly from
one side using this method
fe)
%= Psuedocode (or “Algorithm”) for False Position
— Assume we have the function AND values for the brackets, x, and x,
1. Calculate the chord crossing value of x
2. Calculate /(x,) and f(x)
3. Check subinterval for root, f(x) x f(x,)
Reset interval bounds
4. Repeat Step 1 to 3, if f(x,) is not close enough to zeroPre-compute fil=f(x), fru =f(x,) (just once)
Then iterate on Steps 1-3 if /(x,) is not close enough to zero
1. Calc. chord crossing x, BpACAL ee AGnLe
LR )- FR)
2. Calculate f(x.) frr=f(x,)
3. Check subinterval for root and reset interval bounds
IF fil * fer > 0
x, becomes the lower limit (i.e. x;= x,)
Al = far
ELSE
x, becomes the upper limit (i.e. x, x,)
fru = for
ENDRoot finding : The method of False Position
fil = f(x), fru =f%)
WHILE /(x,)| > precision
x, = (feu xx; ~ fel*x,)/ (four fal)
fr =f)
IF fal x far > 0
x, becomes the lower limit (i.e. x;=.x,)
fel = far
ELSE
x, becomes the upper limit (i.e. x, = x,)
fu = fer
END
END
fil =f (x), ) s feu = f(x) 5 fer
WHILE fir] > precision
x, = (Pru x, — fil *x,)/ (feu fil)
Ser =f(%,)
IF fal x fer > 0
x =X,
fl = fer
ELSE
x,=%,
fou = fir
END
END
(a big number)Root finding : The method of False Position
Some important points (same as Bisection):
= You must “bracket” the root
— Else False Position cannot choose which
subinterval to use next
« False Position is guaranteed to find a root
— If there is more than one root, which you
find is down to luck
« In testing for convergence, you MUST use
abs( f (x,))
— If f(,)is negative, it will be less than any (small)
precision, but not close to the root
10Bisection and the method of False Position are “identical” from the
algorithmic viewpoint
The only difference is how they make the next guess for the root
‘ Xt,
— Midpoint uses x =
~ False Positionuses x, = 2) SG) %,
"FG )- FR)
If you can code one, you can code the other .....
"1ENDRoot finding : The method of False Position