Gauss-Seidel Method
Problem:
6X X X3 Gauss-Seidel method to find approximate solutions to:
Apply
1 2 the
3x1 - x2 + x3 = 25
3x1 + 6x2 + 2x3 = 5
3x1 + 3x2 + 7x3 = 17
With an initial guess of [x1 , x2 , x3 ] = [1 , 0 , 1]
Equation:
X1 X2 X3 k Iteration X1
3 -1 1 = 25 0 1
3 6 2 = 5 1 8
3 3 7 = 17 2 7
3 7.1746032
4 7.1352986
5 7.1417414
6 7.1401765
7 7.1404088
8 7.1403453
9 7.1403534
10 7.1403507
11 7.1403510
12 7.1403509
13 7.1403509
14 7.1403509
15 7.1403509
Therefore the three signinificant digits to th
x1 = 7.1403509
x2 = -2.9473684
x3 = 0.6315789
X2 X3
0 1
-3.5 0.5
-2.8333333 0.6428571
-2.9682540 0.6258503
-2.9429327 0.6318432
-2.9481517 0.6313187
-2.9471945 0.6315791
-2.9473974 0.6315666
-2.9473615 0.6315784
-2.9473695 0.6315783
-2.9473681 0.6315789
-2.9473685 0.6315789
-2.9473684 0.6315789
-2.9473684 0.6315789
-2.9473684 0.6315789
-2.9473684 0.6315789
e signinificant digits to the solution are:
Jacobi Method
Problem:
Apply the Jacobi method to the system
10x1 + 2x2 - x3 = 46
x1 + 8x2 + 3x3 = -89
-2x1 - x2 + 10x3 = 12
Use x1, x2, and x3 equal to zero as initial guess
Equation:
X1 X2 X3 k Iteration X1
10 2 -1 = 46 0 0.00
1 8 3 = -89 1 4.6000000
-2 -1 10 = 12 2 7.0600000
3 7.1865000
4 7.2125375
5 7.2477166
6 7.2500053
7 7.2497935
8 7.2502730
9 7.2503233
10 7.2503124
11 7.2503183
12 7.2503195
13 7.2503192
14 7.2503193
15 7.2503193
16 7.2503193
17 7.2503193
Therefore the three signinificant digits to th
x1 = 7.2503193
x2 = -12.5542784
x3 = 1.394636
X2 X3
0.00 0.00
-11.7000000 1.2000000
-12.4575000 0.9500000
-12.3795625 1.3662500
-12.5389109 1.3993438
-12.5557185 1.3886164
-12.5519818 1.3939715
-12.5539635 1.3948029
-12.5543352 1.3945624
-12.5542513 1.3946211
-12.5542719 1.3946395
-12.5542796 1.3946353
-12.5542782 1.3946357
-12.5542783 1.3946361
-12.5542784 1.3946360
-12.5542784 1.3946360
-12.5542784 1.3946360
-12.5542784 1.3946360
e signinificant digits to the solution are:
Bisection Method
Problem: Use twenty iterations of bisection method to determine the root of f(x)= - 0.4
guesses XL= 5 and XU = 10. Compute the approximate percent relative error, ɛ a and true
iteration.
i XL Xu Xr
1 5 10 7.5
2 5 7.5 6.25
3 6.25 7.5 6.875
4 6.875 7.5 7.1875
5 6.875 7.1875 7.03125
6 7.03125 7.1875 7.109375
7 7.109375 7.1875 7.1484375
8 7.109375 7.1484375 7.12890625
9 7.12890625 7.1484375 7.138671875
10 7.138671875 7.1484375 7.1435546875
11 7.1435546875 7.1484375 7.14599609375
12 7.1435546875 7.14599609375 7.144775390625
13 7.1435546875 7.144775390625 7.1441650390625
14 7.1441650390625 7.144775390625 7.14447021484375
15 7.14447021484375 7.144775390625 7.14462280273438
16 7.14447021484375 7.14462280273438 7.14454650878906
17 7.14454650878906 7.14462280273438 7.14458465576172
18 7.14458465576172 7.14462280273438 7.14460372924805
19 7.14458465576172 7.14460372924805 7.14459419250488
20 7.14459419250488 7.14460372924805 7.14459896087647
Therefore, after twenty iterations, the approximate root of f(x)= - 0.4x2 + 2.2x + 4.7 is Xr =
7.144598961 with ɛt = 0.000015% and ɛa = 0.000067%
determine the root of f(x)= - 0.4x2 + 2.2x + 4.7. Employ initial
ercent relative error, ɛ a and true relative error, ɛt after each
f(XL) f(Xu) f(Xr) F(XL)*f(Xr) t
5.7000000000 -13.3000000000 -1.3000000000 42.750000
5.7000000000 -1.3000000000 2.8250000000 35.625000
2.8250000000 -1.3000000000 0.9187500000 19.421875
0.9187500000 -1.3000000000 -0.1515625000 6.603516
0.9187500000 -0.1515625000 0.3933593750 6.459961
0.3933593750 -0.1515625000 0.1233398438 2.796539
0.1233398438 -0.1515625000 -0.0135009766 0.881687
0.1233398438 -0.0135009766 0.0550720215 0.879278
0.0550720215 -0.0135009766 0.0208236694 0.393141
0.0208236694 -0.0135009766 0.0036708832 0.148755
0.0036708832 -0.0135009766 -0.0049126625 0.026232
0.0036708832 -0.0049126625 -0.0006202936 0.026228
0.0036708832 -0.0006202936 0.0015254438 0.026225
0.0015254438 -0.0006202936 0.0004526123 0.010898
0.0004526123 -0.0006202936 -0.0000838313 0.003234
0.0004526123 -0.0000838313 0.0001843928 0.003234
0.0001843928 -0.0000838313 0.0000502813 0.001317
0.0000502813 -0.0000838313 -0.0000167748 0.000359
0.0000502813 -0.0000167748 0.0000167533 0.000359
0.0000167533 -0.0000167748 -0.0000000108 0.000120
f(x)= - 0.4x2 + 2.2x + 4.7 is Xr =
= 0.000067%
t a
4.974386
12.521345 20.000000
3.773479 9.090909
0.600453 4.347826
1.586513 2.222222
0.493030 1.098901
0.053712 0.546448
0.219659 0.273973
0.082974 0.136799
0.014631 0.068353
0.019541 0.034165
0.002455 0.017085
0.006088 0.008543
0.001817 0.004271
0.000319 0.002136
0.000749 0.001068
0.000215 0.000534
0.000052 0.000267
0.000081 0.000133
0.000015 0.000067
False-Position or Regula Falsi Method
Problem: Find a root of equation f(x)= 12x3-20x2+30x-50 using 30 iterations and compu
error, ɛa after each iteration. Use the initial guesses of XL= - 5 and XU= 6
i XL Xu Xr f(XL) f(Xu)
1 -5 6 0.7591623036649 -2200 2002
2 0.7591623036649 6 0.8454188040293 -33.5013664862624 2002
3 0.8454188040293 6 0.9257179508258 -31.6811108111031 2002
4 0.9257179508258 6 1.00025945377775 -29.8479666154978 2002
5 1.0002594537778 6 1.06920500443505 -27.9932531245087 2002
6 1.0692050044351 6 1.1327084820204 -26.1200632130289 2002
7 1.1327084820204 6 1.19093551160381 -24.2397483974826 2002
8 1.1909355116038 6 1.24407465094178 -22.3688449978885 2002
9 1.2440746509418 6 1.29234206238813 -20.5264186557751 2002
10 1.2923420623881 6 1.33598131438226 -18.7318680265238 2002
11 1.3359813143823 6 1.3752597965734 -17.0032299951476 2002
12 1.3752597965734 6 1.4104630534457 -15.3559980187669 2002
13 1.4104630534457 6 1.44188812596238 -13.8024245382679 2002
14 1.4418881259624 6 1.46983675053215 -12.3512428377204 2002
15 1.4698367505322 6 1.49460902194062 -11.0077211059499 2002
16 1.4946090219406 6 1.51649790385532 -9.77395363123068 2002
17 1.5164979038553 6 1.53578478279352 -8.64929887014515 2002
18 1.5357847827935 6 1.55273611656765 -7.63088746368971 2002
19 1.5527361165677 6 1.56760112650979 -6.7141407516745 2002
20 1.5676011265098 6 1.58061041950139 -5.89325835497841 2002
21 1.5806104195014 6 1.59197539361387 -5.1616495380296 2002
22 1.5919753936139 6 1.60188827189574 -4.51229608231746 2002
23 1.6018882718958 6 1.61052261500504 -3.93804396029005 2002
24 1.610522615005 6 1.61803417874483 -3.43182745381649 2002
25 1.6180341787448 6 1.6245620023802 -2.98683307250936 2002
26 1.6245620023802 6 1.63022963459047 -2.59661234713377 2002
27 1.6302296345905 6 1.63514642393742 -2.25515291660051 2002
28 1.6351464239374 6 1.63940881862512 -1.95691680550583 2002
29 1.6394088186251 6 1.64310163556493 -1.69685379256417 2002
30 1.6431016355649 6 1.6462992712452 -1.47039657310778 2002
Therefore, after thirty iterations, the approximate root of f(x)= 12x 3-20x2+30x-50 is Xr
1.646299271 with ɛa = 0.194231738%
erations and compute the approximate percent relative
U
=6
f(Xr) F(XL)*f(Xr) at
-33.501366486 73703.0062697774
-31.681110811 1061.36050397466 10.2028130854488
-29.847966615 945.616737831692 8.67425620567371
-27.993253125 835.541684719515 7.45221678939578
-26.120063213 731.185541150485 6.44830040743473
-24.239748397 633.14376041016 5.60633901779199
-22.368844998 542.215174691105 4.88918409234429
-20.526418656 459.1522772728 4.27137867472355
-18.731868027 384.498165317155 3.73487893423211
-17.003229995 318.502260293737 3.26645676285529
-15.355998019 261.101566118125 2.85607725093177
-13.802424538 211.950003863821 2.4958652257002
-12.351242838 170.477097221458 2.17943902518112
-11.007721106 135.959036469487 1.90147814440337
-9.7739536312 107.588955675073 1.657441581364
-8.6492988701 84.5378460994546 1.44338359183089
-7.6308874637 66.0018263178962 1.25583214225591
-6.7141407517 51.2348524914011 1.09170731544516
-5.893258355 39.5681660813068 0.9482648162701
-5.161649538 30.4189342654634 0.82305499388656
-4.5122960823 23.2908909887467 0.71389131754583
-3.9380439603 17.7696203340107 0.61882457445962
-3.4318274538 13.5146873772596 0.5361205753244
-2.9868330725 10.2502957382047 0.4642401154728
-2.5966123471 7.75564763490529 0.40182052921366
-2.2551529166 5.85575790791962 0.34765851938978
-1.9569168055 4.41314664148103 0.30069413203429
-1.6968537926 3.32060170315513 0.25999583747962
-1.4703965731 2.4950480016513 0.22474671437746
-1.2734431998 1.87246651700909 0.19423173757775
x 3-20x2+30x-50 is Xr =
Newton-Rhapson Method
Problem: Find a root of equation f(x) = x4+5x3+9x+3 using 10 iterations and compute th
approximate percent relative error, ɛa after each iteration. Use the initial guess of x0 = 1
i xi f(xi) f’(xi)
0 10 15093 5509
1 7.2603013251044 4760.4191769888 2330.49892735687
2 5.2176403647804 1501.3117010813 985.531949950316
3 3.694288736092 474.6042059061 415.391740067242
4 2.5517426521731 151.4408560542 173.132430541232
5 1.6770315678268 49.5857844386 70.0526914937474
6 0.9691960317287 17.1571532978 26.7317362954334
7 0.327368912525 6.1332270029 10.7478931089293
8 -0.243275672489 0.7420325965 9.83015460447326
9 -0.318761015937 -0.0204691182 10.3945733557253
10 -0.316791803975 -0.0000161488 10.3781865460606
Therefore, after ten iterations, the approximate root of f(x) = x 4+5x3+9x+3 is Xr = - 0.31
with ɛa = 0.00049119%
sing 10 iterations and compute the
ation. Use the initial guess of x0 = 10
xi+1 a
7.26030132510437 37.73533015
5.21764036478039 39.14913289
3.69428873609201 41.23531585
2.55174265217313 44.77512977
1.67703156782682 52.15829571
0.96919603172873 73.03326808
0.32736891252503 196.05622118
-0.24327567248937 234.56705686
-0.31876101593653 23.68085797
-0.3167918039751 0.62161077
-0.31679024794332 0.00049119
of f(x) = x 4+5x3+9x+3 is Xr = - 0.316790248
49119%
Secant Method
Problem: Determine one of the real roots of f(x) = 5x3+24x-10 with initial guesses of x0
Perform until ɛa < 0.5%
i xi-1 xi f(xi-1)
0 2 3 78
1 3 1.34453782 197
2 1.34453782 0.99403254 34.42206344
3 0.99403254 0.57381382 18.76780217
4 0.57381382 0.43277368 4.71620794
5 0.43277368 0.40431503 0.79184572
Therefore, after five iterations, the approximate root of
f(x) = 5x3+24x-10 is x6 = 0.40303713 with ɛa = 0.317068265%
4x-10 with initial guesses of x0 = 2 and x1 = 3.
f(xi) xi+1 a
197 1.34453782 123.125
34.42206344 0.99403254 35.2609457640016
18.76780217 0.57381382 73.2325900318678
4.71620794 0.43277368 32.5898158239061
0.79184572 0.40431503 7.03873060668999
0.03402889 0.40303713 0.317068265474901
Incremental Search Method
Problem: Find the first root of f(x) = x3-10x2+5. Start the procedure with the initial value, x 0 =
0 and the step size, h = 0.2. Perform four iterations of the incremental search.
h = 0.2 h = 0.02 h = 0.001
x f(x) x f(x) x
0 5 0.62 1.394328 0.722
0.2 4.608 0.64 1.166144 0.723
0.4 3.464 0.66 0.931496 0.724
0.6 1.616 0.68 0.690432 0.725
0.8 -0.888 0.7 0.443 0.726
0.72 0.189248 0.727
0.74 -0.070776 0.728
0.729
0.73
0.731
0.732
0.733
0.734
0.735
Xr
e with the initial value, x 0 =
ncremental search.
h = 0.001 h = 0.0001
f(x) x f(x)
0.163527048 0.7341 0.006580452821
0.150643067 0.7342 0.005273845688
0.137743424 0.7343 0.003967083
0.124828125 0.7344 0.002660164
0.111897176 0.7345 0.001353089
0.098950583 0.7346 0.000045858
0.085988352 0.7347 -0.001261529
0.073010489 Xr = 0.73465
0.060017 ɛa = 0.015
0.047007891
0.033983168
0.020942837
Therefore, after four iterations, the first
0.007886904 root of f(x) = x3-10x2+5 is 0.73465 with
-0.005184625 ɛa = 0.015%
0.7345