You are on page 1of 3

BI11-271, Đỗ Quốc Trọng, SA

Numerical Methods
Homework 1

Exercise 5.2b (page 139 Book S.C Chapra et al., "Numerical methods for
Engineers“, 6th Edition, MacGraw-Hill, 2006).

Determine the real root of f (x)=4 x 3−6 x 2 +7 x−2.3:


b. Using bisection to locate the root. Employ initial guesses of x l=0 and x u=1 and iterate
until the estimated error ε a falls below a level of ε s=10 % .

Solve:
Choose x l=0 and x u=1.
Calculate the function value at x l and x u:
f (x l)=f (0)=4 ¿ 0 3−6 ¿ 02 +7∗0−2.3=−2.3

f (x u)=f (1)=4 ¿ 13−6 ¿ 12 +7∗1−2.3=2.7

 f (x l)∗f ( x u ) <0.
 Satisfy.
x l + xu
Calculate the midpoint: x r= =0.5
2
Calculate the function value at midpoint:
f (x r )=f (0.5)=4 ¿ 0.53−6 ¿ 0.52 +7∗0.5−2.3=0.2

Because f( x r) is positive, x u=1 is replaced with x u=x r =¿ 0.5 for the next iteration to ensure
that f( x l) and f( x u) have opposite signs.
Repeat until the estimated error ε a falls below a level of ε s=10 % .
The table of iteration:
xl xu f (x l) f (x u) x l + xu f (x r ) εa
x r=
2
0 1 -2.3 2.7 0.5 0.2
0 0.5 -2.3 0.2 0.25 -0.8625 100%
0.25 0.5 -0.8625 0.2 0.375 -0.3078 33.33%
0.375 0.5 -0.3078 0.2 0.4375 -0.0510 14.29%
0.4375 0.5 -0.0510 0.2 0.46875 0.0749 6.67%

Conclusion:
The real root of f (x)=4 x 3−6 x 2 +7 x−2.3 is x=0.46875, with initial guesses of x l=0 and
x u=1 and iterate until the estimated error ε a falls below a level of ε s=10 % .

Exercise 5.4b (page 139 Book S.C Chapra et al., "Numerical methods for
Engineers“, 6th Edition, MacGraw-Hill, 2006).

Determine the root of f (x)=−13−20 x +19 x 2−3 x 3.


b. Determine the first root of the function with bisection, use initial guesses of x l=−1 and
x u=0 , and a stopping criterion of 1%.

Solve:
Choose x l=−1∧xu =0.
Calculate the function value of x l∧x u :
f (x l)=f (−1)=−13−20∗(−1)+19 ¿(−1)2−3 ¿(−1)3=29

f (x u)=f (0)=−13−20∗0+19 ¿ 02 −3 ¿ 03=−13

 f (x l)∗f ( x u )< 0
 Satisfy.
x l + xu
Calculate the midpoint: x r= =−0.5
2
Calculate the function value at the midpoint:
f (x r )=f (0 .5)=−13−20∗(−0 .5)+19 ¿ (−0 .5)2 −3 ¿(−0 .5)3=2.125

Because f( x r) is positive, x l=−1 is replaced with x l=x r =¿ -0.5 for the next iteration to
ensure that f( x l) and f( x u) have opposite signs.
Repeat until the estimated error ε a falls below a stopping criterion of 1%.

The table of iteration:


xl xu f ( x l) f ( x u) x l + xu f (x r ) εa
x r=
2
-1 0 29 -13 -0.5 2.125
-0.5 0 2.125 -13 -0.25 -6.7656 100%
-0.5 -0.25 2.125 -6.7656 -0.375 -2.6699 33.33%
-0.5 -0.375 2.125 -2.6699 -0.4375 -0.3621 14.29%
-0.5 -0.4375 2.125 -0.3621 -0.46875 0.8588 6.67%
-0.46875 -0.4375 0.8588 -0.3621 -0.453125 0.2427 3.45%
-0.453125 -0.4375 0.2427 -0.3621 -0.4453125 -0.0611 1.75%
-0.453125 -0.4453125 0.2427 -0.0611 -0.44921875 0.0905 0.87%

Conclusion:
The root of f (x)=−13−20 x +19 x 2−3 x 3 is x=-0.44921875, with initial guesses of x l=−1 and
x u=0 , and a stopping criterion of 1%.

You might also like