Professional Documents
Culture Documents
Week 2
Week 2
2a
• But
ax 5 bx 4 cx 3 dx 2 ex f 0 x ?
sin x x 0 x ?
4
Roots of Equations
5
Graphical Methods
• This is a simple method to get an estimate of the root of the
equation f(x) =0.
6
Example
Use the graphical approach to determine the drag coefficient c needed
for a parachutist of mass m = 68.1kg to have a velocity of 40m/s after free
falling for time t=10s. Note: acceleration due to gravity is 9.8 m/s2.
Solution
From equation that derived Inserting all the known
from Newton’s second law parameters:
for the parachutist’s velocity:
667.38
f (c ) (1 e 0.146843c ) 40
c
7
The resulting curve crosses
the c axis between 12 and 16.
8
f(x) f(x)
*
* * *
x x
Xl Xu Xl Xu
a. f(xl) and f(xu) have the same sign, no c. f(xl) and f(xu) have the same sign, there
roots or even number of roots in interval are roots or even number of roots in interval
f(x)
f(x)
Xu
* Xl
*
x
x
* Xl
*
Xu
b. Function has different signs at the end d. Function has different signs at the end
points, there will be an odd number of points, there will be an odd number of
roots in the interval roots in the interval
Bisection Method
From the graphical method, we found that when a function f(x) is continuous
and real in the interval from xl to xu , and f(xl) and f(xu) have opposite signs,
f(xl) f(xu) < 0
then there is at least one real root between xl and xu.
10
Procedure for bisection method
• If f(xl) f(xr) <0 the root lies in the lower subinterval, then
set xr as xu, and repeat to find new xr
If f(xl) f(xr) >0 the root lies in the upper subinterval, then
set xr as xl, and repeat to find new xr
12
Calculate new xr,
xl xu 14 16
xr 15
2 2
Compare εa with εs.
xrnew xrold 15 14
εa 100 % 100 % 6.667% ε s
xrnew 15
Compute the product of function value at lower bound and at midpoint,
f ( xl ) f ( xr ) f (14) f (15) 1.569(0.425) 0.667 0
The root is between 14 and 15. Set xl = 14 and xu = 15.
13
Repeat the calculation until termination criteria is met.
14
Exercise
Find the root of the 3rd-order polynomial using bisection
f ( x) x3 x 2 10 x 8 0
in the interval [3.75,5]. The tolerance εs is 0.5%.
15
False Position Method
The false-position method takes into account the
magnitudes of the function at the lower and upper
bounds, f(xl) and f(xu).
16
If a real root is bounded by xl
and xu of f(x) = 0, then we can
approximate the solution by
doing a linear interpolation
between the points [xl, f(xl)] and
[xu, f(xu)] to find the xr value l(xr)
such that l(xr) = 0, l(x) is the
linear approximation of f(x).
Thus, using similar triangle we
can write,
f ( xl ) f ( xu )
xr xl xr xu
Solving for xr ,
f ( xu )( xl xu )
xr xu
f ( xl ) f ( xu )
xl 12 f ( xl ) 6.0669
xu 16 f ( xu ) 2.2688
2.2688(12 16)
x r 16 14.9113
6.0669 ( 2.2688)
19
Second iteration
xl 12 f ( xl ) 6.0669
0.2543(12 14.9113)
x r 14.9113 14.7942
6.0669 ( 0.2543)
14.7942 14.9113
a 100% 0.79%
14.7942
20
Third iteration
xl 12 f ( xl ) 6.0669
0.0273(12 14.7942)
x r 14.7942 14.7817
6.0669 ( 0.0273)
14.7817 14.7942
a 100% 0.0846%
14.7817
21
Exercise
Find the root of the 3rd-order polynomial using FP
f ( x) x3 x 2 10 x 8 0
in the interval [3.75,5]. The tolerance εs is 0.5%.
22
Lets try
Use both the bisection and false-position method to find the
root of
f ( x) x 4 2 0
23
Exercise
(5.4) Determine the roots of f(x) = -12 – 21x +18x2 – 2.75x3
with
a) Bisection
b) False position
Using initial guess of xl = -1 and xu = 0 and stopping criterion
of 1%.
24