MATH-352
Numerical Methods
Atifa Kanwal
[email protected]
Office # 303, Faculty Block, SEECS, NUST
1. Bisection Method
If a function changes
sign over an interval
then the function
value at the
midpoint is
evaluated. The
location of the root
is then determined
as lying at the
midpoint of the
subintervals within
which the sign
change occurs.
Algorithm
1. Choose lower and upper guesses for the root
such that the function changes sign over the
interval. i.e,
2. An estimate of the root is determined by
3. Make the following evaluations to determine in
which subinterval the root lies.
a. If then root lies in then set and and repeat step
2.
b. If then root lies in then set and and repeat step
2.
c. If the is root of the equation .
Stopping/Termination Criterion
Answer is correct to means perform
calculations upto n dp and answer must be
accurate to dp. For example
Error bound
Error bound
If result is correct to at least significant digits
then
Instructions about Calculations in this
course
If calculations has to perform up to decimal
places then truncate the result after nth
decimal place(dp). Do not round off.
If not mentioned in the question, perform
calculations upto 4 dp.
Use RAD mode in calculators.
Graphical Calculators will not be allowed in
exam.
Example 1:
Show that has root in the interval . Use bisection method
to determine approximation to the root that is accurate to
at least within .
Solution:
Since changes sign over the interval so root lies in this
interval.
Answer must be correct to i.e we have to perform
calculations up to 3 decimal places (dps)
Example 1: Solution
1 1 2 1.5 0.018(+ve)
2 1.5 2 1.75 -0.504(-ve)
3 1.5 1.75 1.625 -0.203(-ve)
4 1.5 1.625 1.562 -0.082(-ve)
5 1.5 1.562 1.531 -0.029(-ve)
6 1.5 1.531 1.515 -0.004(-ve)
The root of the equation is .
Theorem: Error Bound for Bisection Method
Suppose be a continuous function over the interval ,
and . The bisection method generates a sequence
approximating a zero of with
Example 2:
Determine the number of iterations necessary to achieve an
approximation with accuracy to the solution of lying in the
interval .
Advantages of Bisection Method
Advantages:
It is always convergent.
Error can be controlled.
Drawbacks:
Convergence is generally slow.
Choosing one of the initial guess close to the root
results in requiring many iteration to converge.
In the case, does not change sign over the interval,
bisection method can’t approximate the root.
The False Position Method
In this method we approximate the curve by a straight
line between and . The intersection of this line with
represents the improved estimate of the root of the
equation .
The fact that, the replacement of the curve by a straight
line gives a false position of the root, is the origin of the
name, “Method of false Position” or in Latin “ Regula-
Falsi Method”
False Position Method Graphically
𝑓 ( 𝑏1 )
𝑝1
𝑎1 𝑏1
𝑓 ( 𝑝1 )
𝑓 ( 𝑎1 )
Derivation of Formula
Let and be initial approximation such that . Equation of
the straight line by joining and is,
Let the line intersects at the point then
Or
Algorithm
1. Choose lower and upper guesses for the root such
that
2. An estimate of the root is determined by or
3. Make the following evaluations to determine in which
subinterval the root lies.
a. If then root lies in then set and and repeat step 2.
b. If then root lies in then set and and repeat step 2.
c. If the is root of the equation .
Example 3
You are designing a spherical tank to hold water for a small
village in a developing country. The volume of liquid it can hold
can be computed as
,
,
.
If , to what depth must the tank be filled so that it holds ? Use
three iterations of False Position method to determine the
answer using initial guess and . Calculate after each iteration.
Perform calculations up to 3 decimal places.
Home Exercise:
Approximate such that
Advantages:
It is always convergent.
Error can be controlled.
Drawbacks:
In some cases convergence is slow.
In the case, does not change sign over the interval,
false position method can’t approximate the root.