0% found this document useful (0 votes)
60 views

Tutorial 2

This document contains three problems involving determining real roots of functions using various numerical methods like the bisection method, Newton-Raphson method, and secant method. Tables with iteration steps and error calculations are provided for each problem. Real roots and relative errors are determined for each function.

Uploaded by

ng ee zoe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Tutorial 2

This document contains three problems involving determining real roots of functions using various numerical methods like the bisection method, Newton-Raphson method, and secant method. Tables with iteration steps and error calculations are provided for each problem. Real roots and relative errors are determined for each function.

Uploaded by

ng ee zoe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TMS3133

Tutorial 2

1. Determine the roots of f (x) = 12 21x + 18x2 2.75x3 graphically using MATLAB. In
addition, determine the first root of the function with bisection. Use initial guesses of xl = 1
and xu = 0 and a stopping criterion of 1%.
2. Determine the real roots of f (x) = 0.5x2 + 2.5x + 4.5:
(a) Using quadratic formula
(b) Using three iterations of the bisection method to determine the highest roots. Employ
initial guesses of xl = 5 and xu = 10. Compute the estimated error "a and the true error
"t after each iteration.
3. Determine the highest real root of
f (x) = 2x3 11.7x2 + 17.7x 5
(a) Newton-Raphson method (three iterations, x0 = 3)
(b) Secant method (three iterations, x 1 = 3, x0 = 4)
Compute the approximate percent relative errors for your solutions.

Answer:
1. (a) i xl f (xl ) xu f (xu ) xr f (xr ) |"a |
1 1 29.75 0 12 0.5 3.34375
2 0.5 3.34375 0 12 0.25 5.5820313 100.00%
3 0.5 3.34375 0.25 5.5820313 0.375 1.4487305 33.33%
4 0.5 3.34375 0.375 1.4487305 0.4375 0.8630981 14.29%
5 0.4375 0.863098 0.375 1.4487305 -0.40625 0.3136673 7.69%
6 0.4375 0.863098 0.40625 0.3136673 0.421875 0.2694712 3.70%
7 0.42188 0.269471 0.40625 0.3136673 0.414063 0.0234052 1.89%
8 0.42188 0.269471 0.41406 0.0234052 0.417969 0.1227057 0.93%
(b) i. x1 = 1.405125, x2 = 6.405125
ii. iteration xl xu xm "t "a
1 5 10 7.5 -0.1709
2 5 7.5 6.25 0.0242 -0.20
3 6.25 7.5 6.875 0.0734 0.0909
(c) iteration, i xi "a %
0 3
1 5.1333 41.6
2 4.2698
_
-20.2
3 3.7929 -12.6
(d) iteration, i xi "a %
1 3.3265 -20.2
2 3.4813 4.4
3 3.5863 2.9

2022 Page 1 of 1
f- 1711=-12-2171+18712-2.75713

✗1=-1 Xn=0

i Xi Xu Xm FIX ) . flxn ) tlxml Error


I I 0 -0,5 29.75 -12 3.34375
-

2 -0,5 0 -0.25 3.34375 -12 -5.58203 100%

3 -

0.5 -0.25 -0.375 3.34375 -5.58203 -1.44873 33.33%

4 -0.5 -
0.375 -

0.4375 3.34375 -1.44873 0.863098 14.286%


5 -0.4375 -0.375 -0.40625 0.863098 -1.44873 -
0.313667 7.692%

6 -0.4375 -0.40625 -0.421875 0.863098 -0.313667 0.269471 3.704%


7 -0.421875 -0.40625 -0.41406 0.269471 -0.313667 -

0.0235 1.887.7 .

8 -0.421875 -0.41406 -

0.41798 0.269471 -0.0235 0.12313 0.9378%

2 / Ea =
-0.25-1-0.5 ) =/ 00% 6 Eat =
-0.421875-(-0.4062-5)=3.7047 ,

0.25 -0.421875

3 Ea = -

0.375
-

l -
0.25) =
33.33%
-

0.375 ⑦ Eat =
-0.41406-1-0.421875 ) =
1.88770
4 Ea =
-0.4375-1-0.375 ) =
14.286% -0.41406

0.4375
-

5
/ Eat =
-0.40625-1-0.43751=7.6921 ⑧ / Eat =
-0.41798-1-0.41406 ) =
0,9378%
-

0.40625 -0.41798

(a) -0.5712+2.5×+4.5

9=-0.5 10=2.5 1=4.5

✗ =
-

b ± ] b. 2-
4ac

Za

= -
( 2. 5) ± / 12.512-41-0.57/4.5 )
21-0.5 )

= -

2.5 ± 3.905125

-1

✗ 1=-1.405125 ✗2=6.405125

(b) i × Xu Xm FIX ) flxu ) flxm) Ea Et Et -_


6.405125
-
75
/
, ,

1 5 10 7.5 4.5 -20.5 -4.875 -0.1709 6.405125

2 5 75 6.25 4.5 -4.875 0.59375 -0.2 0,0242


=
-0.1709

3 6.25 7.5 6.875 0,59375 -4.875 -1.9453 0.0909 -0.07334

2
Et =
6.405125-6.25=0.0242 3 E -1=6.405125-6.875 =
-0.07334

6. 405125 6.405125

Ea =
6.25-7.5 =
-0.2 ④ Ea= 6.875-6.25=0,0909
6.25 6.875
3 a). f 1) =
C713-11.794+17.77)-5
f'l) 679-23.47)
= 17.7
+ j Xi f (Xi) f'(xi) Sa To
O 3 -

3.2 1.5

I 5.1333 ↑ 8.0882 35.6854 41.56%


I 4.2697 12.9349 27.171 20.23%

Xi+ =xi-2713-11.7914+
3 3. 7929 2.9471 15.2627
1.771-5 12.57%
6712-23.47) + 17.7

① 297 =5.1333-3x100%= 41.5587


5. 1333

2 897 4.2697-5.1333 x100%


= =
-20,226%

4.269]

⑤ 9T 3.7929-4.2697 x1007
= =
-12.37%
3.7929

f 11) =
C713-11.794+17.77)-5
7- 1 =
3 Do 4
=

7) f 1c) Error

3 -

3.2

4 6.6

3. 32653 -1.968857 20.245%


3.4813 0.79567 4.445%
-

3.58 63 0.24814 2.9 To

You might also like