Professional Documents
Culture Documents
Numerical Methods
Homework 1
Exercise 5.2b (page 139 Book S.C Chapra et al., "Numerical methods for
Engineers“, 6th Edition, MacGraw-Hill, 2006).
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 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).
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 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%.
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%.