You are on page 1of 16

Root Finding With Relaxation

MecE 390 Lab 2
Saad Navaid
1356918
LAB H2
2 February, 2015

In One-point iteration initial guess plays a moderate role in faster convergence. 2. Two other values were obtained but were rejected since h cannot be negative and should be less than 2m since the maximum height of the tank is 2m.3 we were only able to find one root in part (a) and another root in part (b). In general. One-point iteration is hence more sensitive to initial guess. it was unable to find the second root since there was monotonic divergence in the region where x is greater than 1 for x less than 1 we converge to x=0. If the guess is close to the root then convergence will be faster but if it's farther away then it could take a large number of iterations to converge to the root as seen in Q. the function did monotonically converge to 0. In part (a) only 1 root could be obtained (0. Secant method requires significantly lesser number of iterations if the initial guess is close to the root but could diverge if during iteration the root estimate falls close to a minimum or maximum point.43112 which is the value for h. All the graphs obtained are shown in Appendix C.3 part (a).9449 but there was monotonically divergence around x=0. Relaxation values greater than 1 resulted in faster convergence compared to no relaxation for both Q.43112) whereas in part (b) one root was obtained as well (2. See Appendix B for the diary output of part (a) and (b).3 part (a) and (b) and convergence was much slower for relaxation values lower than 1. The code was able to find the one root which was 0 however. However. In Q. See Appendix A for code and Appendix B for diary output of part (d).1.9449 which is why we weren't able to obtain that root. In part (b) we were able to monotonically converge to 2. 3. This is as expected by the theory since values of W greater than 1 and less than 2 lead to faster convergence in monotonic convergence. 4.9449). Both part (a) and (b) didn't result in any negative roots as both the auxiliary functions were positive for all x values.43112m.43112. The value of h obtained using the secant method was h=0. we can see that convergence rate is much slower (less efficient) for Onepoint iteration compared to the secant method which is as expected by the theory. In part (a) there was monotonic divergence around x=2. 1 . The function plotfunc(f) was used to obtain a graph of the functions which were then used to make the initial guesses. See Appendix A for code and Appendix B for diary output of part (d) and (e).

b= input('New value of b: '). %Units = m^3 f=((pi*h. %plot a solid line on x axis from -50 to 50 grid on.b]). %Get input function to plot funcname=input('Enter function to plot: '. %x axis label title ('Graph of function vs. % plot the input function from -50 to 50 ylabel('f(x)'). ezplot(funcname. while(answer~='n')%runs the loop only if diary is not equal to n/ equal to y clf.'s'). %y axis label xlabel('x').Appendix A Code used for Q.^2-4.^2*(3*r-h))/3)-V.b]). if answer=='y' a= input('New value of a: '). 2 .1 to plot the graph of the function function plotfunc(funcname) % function is a character variable containing the name of function to solve % Syntax: plotfunc('func01') %Initializing variables %Turns diary on and saves input in a file named snavaid_lab02 diary snavaid_lab02. %plot the function from x=-20 to x=20 a=-50.[a.%function y1 function f= func5(h) %spherical tank formula to find height h in m r=1. % Units = m V=0. %clear figure window ezplot('0'. answer='y'. Note: both the functions above were created in separate M-files. b=50.5.'s'). %turns gridlines on to improve guessing hold on.[a. end end Here are the M-files containing the name of the functions function y1=func4(x) y1=x. x') %title of graph %ask if the interval needs to change for better visualization of roots answer=input('New interval (y/n)? '.

xi1).relerr. end disp(['Total no. of iterations relerr=1. %absolute true error f_root=feval(f. fxi=feval(f. %save previous iterate %find value of function at xi and xi_1 fx0=feval(f. fprime=(fxi-fx0)/(xi-x0).count. %derivative of the function % check if estimated derivative/denominator is close to zero if abs(fprime) < small disp('Error: denominator approaching zero.xi1.e-15. % a very small value to prevent division by zero reltol=10^-4. % initializing relative error abserr=1. % initializing function value small=1.abserr.abs(f_root)). of iterations maxitr=500. %Get input function % Get two starting values xi=input('Enter guess 1: '). % printing each iteration result fprintf('%3g %5. % counts the no.') return end xi1=xi-fxi/fprime. % relative error abserr=abs(xi1-xi). % relative tolerance abstol=10^-8.xi). % maximum no. % absolute tolerance ftol=10^-8.1 to find root of a function using the secant method function secroot % Function to find root with Secant Method % Syntax: Secant Root diary snavaid_lab03.Code used for Q. xi1= input('Enter guess 2: '). % initializing variables count=0.% root found using the secant method relerr=abs(xi1-xi)/(xi1+small). %discard oldest iterate xi=xi1. %check if the specified error is less than actual error and the count % is less than the maximum number of allowable iterations while ((relerr>reltol) && (abserr>abstol) || (abs(f_root)>ftol)) && (count<maxitr) count=count+1.5g %10. % initializing absolute error f_root=1. %Turns diary on % The function has been defined in another M-file f=input('Enter name of the function: '.'s'). of iterations: ' num2str(count)]) disp(['Obtained root: ' num2str(xi1)]) 3 .') disp('Try another initial guess.x0).5g %10.6g %10.5g\n'. x0=xi. % tolerance in function value % printing the top labeling line fprintf('\n # root abs error rel error fxi1\n\n').

% tolerance in function value max_x_value= 3.xi.5g %15. %save previous iterate xi=feval(gx. % relative error in percentage abserr=abs(xi-xold). end disp(['Total no.e-15. % absolute tolerance ftol=10^-8.'s'). %absolute true error delta_x=xi-xold. % initializing absolute error f_root=1.xi).count. one starting value and a relaxation parameter gx=input('Enter auxilary function: '.abs(f_root)). % counts the no. %error between the two values xi=xold+W*delta_x. % initializing function value small=1. %introducing the relaxation parameter f_root=feval(f.6g %10.5g\n'.2 to find root of a function using the One-point Iteration method function OPI % Function to find root with One-point iteration method % Syntax: One-point Iteration diary snavaid_lab03. W=input('Enter relaxation parameter: ').relerr. %Turns diary on % The function has been defined in another M-file f=input('Enter name of the function: '. % initializing relative error abserr=1. of iterations: ' num2str(count)]) disp(['Obtained root: ' num2str(xi)]) 4 .'s'). xold=xi. %defining a maximum x value % printing the top labeling line fprintf('\n # root abs error rel error fxi\n\n').%fincding value of the function at root if abs(xi)>max_x_value %stopping iteration if value exceeds the max x value disp('No root found') return end % printing each iteration result fprintf('%3g %5. %this has to be defined in another M-file xi= input('Enter starting value: ').40*10^38. % relative tolerance abstol=10^-8. of iterations maxitr=500.5g %10.xold). of iterations relerr=1.abserr. % maximum no. %Get input function % Get one starting function. %check if the specified error is less than actual error and the count % is less than the maximum number of allowable iterations while ((relerr>reltol) && (abserr>abstol) || (abs(f_root)>ftol)) && (count<maxitr) count=count+1.Code used for Q. %Relaxation parameter % initializing variables count=0. relerr=abs(xi-xold)/(xi+small). % a very small value to prevent division by zero reltol=10^-4.

^2.Code used for Q.^2)-(V/pi))). % Units = m V=0.^0.^3+(3*V/pi))/3).2 to define auxiliary function and actual function function y4 = func7(x) y4=x. %auxiliary function g1 Code used for Q.^2-x.5. function g1=func3(h) r=1.^(1/3).5.%function y4 function y3=func6(x) y3=x. %y as a function of h Note: both the functions above were created in separate M-files.3 to define auxiliary functions function g2=func8(h) r=1. % Units = m V=0.5. 5 . %Units = m^3 g2=((h. %Units = m^3 g1=(3*((r*h.

26223 2 -1.0278e-06 4 2 2.018626 2 2.000885 3 2 0.028119 3 -1.06452 0.00022098 0.6843e-11 Total no.5 6 .4 Enter guess 2: -0.2116e-11 Total no.0044299 0.5 Enter guess 2: -1.875e-08 2.5693e-07 1.00022 0.0022147 0.8998e-07 5 -2 1.0034653 0.071558 -0.0069303 -0.975e-07 -9.00465 0.2846e-07 5.99989 0.46452 -0.Appendix B Diary file for Q.00011217 -5.225 0.035906 0.00011049 1.1 part (d) plotfunc Enter function to plot: func4 New interval (y/n)? y New value of a: -10 New value of b: 10 New interval (y/n)? n secroot Enter name of the function: func4 Enter guess 1: -1.6087e-05 7. of iterations: 4 Obtained root: 2 Diary file for Q.19535 0.6 # root abs error rel error fxi1 1 -2.99296 0. of iterations: 5 Obtained root: -2 secroot Enter name of the function: func4 Enter guess 1: 2.1 Enter guess 2: 2.2 # root abs error rel error fxi1 1 2.00044789 4 -2 0.097448 0.1 part (e) plotfunc Enter function to plot: func5 New interval (y/n)? y New value of a: -10 New value of b: 10 New interval (y/n)? y New value of a: -2 New value of b: 4 New interval (y/n)? y New value of a: -1 New value of b: 3 New interval (y/n)? n secroot Enter name of the function: func5 Enter guess 1: -0.

0012529 3 0.2 part (d) Enter Enter Enter Enter # name of the function: func7 auxilary function: func6 starting value: 0.376067 3.034715 0.94495 1.003891 255 5 2.4 Enter guess 2: 0.10168 0.# root abs error rel error fxi1 1 -0.0013633 4.25 1 2 0.7 # root abs error rel error fxi1 1 3.6224e-06 4 0.43112 secroot Enter name of the function: func5 Enter guess 1: 2.3283e-10 5.0051086 0.0325e-05 4 -0.01504 0.2499e-13 Total no.5259e-05 2.0080559 4 2.421e-20 fxi 0.0483e-06 2.6744e-06 -9.430531 0.0386e-05 3.31614 0.0625 0.376694 0.5259e-05 65535 6 5.0049981 0.421e-20 7 .008508 0.431118 0.3 # root abs error rel error fxi1 1 0.0737e-05 5 2.0017615 3 -0. of iterations: 4 Obtained root: -0.3283e-10 2.5 relaxation parameter: 1 root abs error rel error 1 0.31118 0.33066 0.1875 0.00093244 0.6917e-09 2.5266e-06 5.94495 6.00058776 0.3282e+05 Total no.0016572 1.431121 2.03066 0.00062322 -0.94496 0.42101e-20 2.52588e-05 0.25 0.00390625 0.2723e-09 4.32831e-10 1.058594 0.6 Enter guess 2: 2.376071 0.13799 3 2.79494 2 2. of iterations: 6 Obtained root: 2. of iterations: 6 Obtained root: 5.7706e-06 9.13553 0.011609 0.92898 0.9449 Diary file for Q.94402 0.37607 secroot Enter name of the function: func5 Enter guess 1: 0.1875 3 3 0.2955e-09 Total no.9595e-09 Total no.003891 1.1764e-06 5.058594 15 4 1.1201 -0. of iterations: 4 Obtained root: 0.0094015 2 0.435529 0.00031662 9.8502e-08 6 2.01082 2 -0.0032049 -0.10911 0.379899 0.

4949e-06 1.431299 0.8125 0.089171 0.1473 1.01888 0.80247 656.566 0.75331 1.21 0.00064674 0.00037852 8.02641 0.4001e-06 3.21393 3.0 OPI Enter Enter Enter Enter # name of the function: func5 auxiliary function: func8 starting value: 0.431121 3.051869 0.5057e-08 1.3078e+05 0.0014995 5 0.058995 0.96098 431440 4.4648e+22 No root found fxi 1 1 2.018e-07 7.6188 7.13646 0.027745 0.21 4.431159 0.0128e-05 6.0017539 0.35039 3.1614e-05 1.431129 3.9881e-05 7 0.11574 2 0.566 631.7594e-05 3.509e-07 11 0.75 0.030383 3 0.55556 25.0080932 0. of iterations: 11 Obtained root: 0.25 0.5065e-05 8 0.8125 20.3078e+05 1.4648e+22 1.0068801 4 0.0029718 0.059685 fxi 0.431121 1.0001397 0.431122 6.8614e+11 1.02641 3.6289 20.841 631.56305 abs error 0.012838 0.7757 2.434917 0.3 part (a) W = 1.0004e-07 10 0.43112 OPI Enter name of the function: func5 Enter auxilary function: func8 Enter starting value: 3 Enter relaxation parameter: 1 # 1 2 3 4 5 6 root 3.431946 0.21266 rel error 0.00032401 6 0.0087264 0.1886e-09 fxi 0.5 relaxation parameter: 1 # root abs error rel error 1 2 3 4 5 6 7 2.8141 4.2475e-06 9 0.9855 8 .431121 1.2005e+45 Diary file for Q.039359 0.1753e-07 1.448131 0.431121 6.12476 3.0625 2.2528e-08 Total no.99848 1.06577 3.8614e+11 3.4024e-08 3.46482e+22 3.33333 5.013214 0.036658 0.OPI Enter Enter Enter Enter name of the function: func7 auxiliary function: func6 starting value: 1.8614e+11 3.5 relaxation parameter: 1 root abs error rel error 1 0.040729 0.7623e-07 3.7926e-06 8.7987e-08 8.

8821e-08 1.89 2570.24211 0.432612 0.2834 40.07467 0.2641e+23 1 2.78227 2.2 0.59492e+34 2.40823e+10 3.7612 0.37 0.7338e-07 18 0.8306 1.014582 0.26412e+23 1.4495e+10 16 88347 85486 0.31678 0.6708 3.19788 0.17752 9 0. of iterations: 19 Obtained root: 0.431121 5.4576e-05 0.96762 7.087213 14.431443 0.5448e+07 15 2860.63273e+15 3.99417 3.6493e+21 18 3.1766e-05 2.2682e-06 17 0.6327e+15 0.1786e-07 2.1978e-09 Using this auxiliary function only one root of the equation was obtained which is 0.437944 0.2703e-08 Total no.36368 1223 12 22.17159 4 1.36464 0.7 3.999 10 7.0013 0.8 OPI Enter name of the function: func5 Enter auxilary function: func8 9 .1154e+69 21 2.8298e+103 No root found OPI Enter name of the function: func5 Enter auxiliary function: func8 Enter starting value: 2.012325 11 0.431124 1.8709e-06 1. W = 0.273 0.5161e+07 1.1926e-07 6.36459 8 0.43119 0.90349 0.1459e+31 19 3.5949e+34 1 1.8931e-08 19 0.9288 0.42199 7 0.8834e-06 16 0.916 8 4.081823 0.431121 5.1874e-05 6.7292e-05 15 0.258 0.0203e+46 20 1.34044 0.63809 2.2209e+14 17 1.49219 10933 13 63.4835e-08 3.653 227.34623 6 0.079082 2 2.00012659 14 0.4811e-06 3.2298 0.00014785 3.00058669 13 0.0031738 0.542743 0.74062 0.431121 1.431121 2.5073e+07 0.1167 3 1.18299 77.47049 0.5282e+05 14 290.77082 0.00068558 0.18322 0.12683 31.4677e-07 1.30385 0.275 9 5.89 11 11.5365e-06 5.99999 5.26063 252.99956 4.43112.41779 0.4067e+10 0.431121 2.35303 0.5364 2.00025298 0.0053319 0.0027099 12 0.47179 1.431136 5.0011692 0.567 0.6304 4.40057 1.5 Enter relaxation parameter: 1 # root abs error rel error 1 2.7978 0.3402 3.4766e-09 1.5406e-08 5.460919 0.43112 fxi 3.064879 0.9031 11.31253 0.8984 2.052461 10 0.05315 0.38 0.249 5 1.022975 0.

4259e-05 5 0.0081635 0.43167 0.002675 6 0.431121 3.458505 0.9991e-08 2.9428e-07 14 0.11574 2 0.44159 0.431121 1.00099869 7 0.431121 5.2 OPI Enter Enter Enter Enter name of the function: func5 auxilary function: func8 starting value: 0.6107e-07 5.11574 2 0.2474e-05 8.00032392 0.0442e-08 6.00037229 8 0.431122 1.431145 0.5 relaxation parameter: 1 10 .0 OPI Enter Enter Enter Enter name of the function: func5 auxilary function: func3 starting value: 2.018835 4 0.Enter starting value: 0.9417e-09 Total no.022441 0.431121 8.43112 fxi 0.0334e-06 1.431121 4.432593 0.431121 1.7032e-07 15 0.1198e-06 2.1611e-06 4.3706e-06 3.00087796 5.435059 0.00043067 0.0083968 0.1268e-10 Diary file for Q.431149 5.059508 0.00013871 9 0.2147e-08 5. of iterations: 7 Obtained root: 0.051869 0.021144 0.0031327 0.9462e-08 1.2 # root abs error rel error 1 0.2275e-05 5.7798e-07 1.1509e-06 2.3218e-09 W = 1.0007512 4 0.5 Enter relaxation parameter: 0.0030827 0.431125 8.1667e-05 10 0.431131 2.9244e-05 11 0.3247e-07 1.8549e-09 8.01199 3 0.5965e-07 3.431325 0.014181 0.431121 2.1676e-06 12 0.048344 3 0.2484e-09 1.1689e-05 3.8 # root abs error rel error 1 0.431534 0.0011541 0.43112 fxi 0.00016201 6.2343e-08 8.431121 1.3 part (b) W = 1.0901e-06 7.0341e-05 2.3792e-07 16 0. of iterations: 17 Obtained root: 0.00043494 0.5 relaxation parameter: 1.0071362 5 0.137e-08 17 0.0051865 0.051869 0.2866e-07 9.5974e-06 6 0.2966e-06 1.524e-07 7 0.5703e-08 1.00016052 0.6696e-06 13 0.9081e-05 4.1176e-06 1.437757 0.431122 3.9133e-08 Total no.431197 0.0011675 0.9801e-05 0.431121 6.

827e-07 32 2.3976e-05 5.4834e-08 41 2.94495 4.3837e-05 19 2.6304e-05 1.94348 0.7195e-07 1.94494 2.0027319 0.40065 0.82672 0.1842e-08 40 2.6826e-06 2.001503 0.7864e-05 1.067144 0.018879 0.94494 1.0003201 0.5807e-06 1.1657 0.8838e-10 48 2.0059213 0.9107e-09 9.94495 9.095581 0.9734e-08 37 2.022091 0.4215e-06 4.00034703 15 2.5953e-06 3.015111 0.00051092 14 2.1678e-07 7.3425e-09 4.0040221 0.2162e-08 39 2.4526e-07 1.0536e-07 6.94495 2.4056e-05 21 2.035018 3 2.0076239 7 2.94495 2.94495 6.046659 0.00026809 0.0074e-08 42 2.94495 1.3685e-08 1.0932e-06 7.93479 0.239e-06 5.7807e-09 11 .5707e-05 23 2.3947e-07 4.4489e-05 4.032185 0.8399e-06 3.0239e-07 1.6339 0.012829 0.8731e-05 2.94495 4.003528 9 2.00014766 5.027774 0.94488 3.12921 0.93001 0.1339 0.088122 0.4554e-09 47 2.94278 0.00018207 0.94495 6.00075217 13 2.01641 5 2.0148e-08 6.1902e-06 8.94492 1.9768e-09 6.8e-06 2.010312 0.00010872 18 2.3128e-05 22 2.00085586 0.94495 1.4325e-08 2.00021741 7.2263e-07 34 2.6577e-08 2.94495 4.00010029 3.0959e-10 51 2.0023982 10 2.89756 0.57824 0.6464e-09 44 2.94495 4.6541e-07 3.94494 4.94485 4.1917e-10 2.06002 0.94395 0.0833e-07 5.2927e-09 3.1414e-05 1.94449 0.0466e-06 30 2.00047127 0.1334e-05 7.72948 0.3859e-08 3.311e-09 2.94473 0.6256e-05 1.0012602 0.94493 6.1171e-10 3.4841e-08 1.1077e-07 31 2.94463 0.0821e-06 1.91267 0.94494 3.7031e-05 3.18906 0.205e-10 1.2692e-06 28 2.3683e-08 4.0018555 0.3413e-06 27 2.5564e-07 2. of iterations: 52 fxi 2.00039476 0.0032531 0.0146e-05 20 2.4717e-08 3.94494 9.94495 6.687e-08 1.2132e-05 8.7526e-06 1.94495 2.512e-07 35 2.94026 0.# root abs error rel error 1 2.4896e-07 3.143e-09 46 2.00069377 0.8416e-09 43 2.7282e-07 2.94495 1.93805 0.0022116 0.5319e-07 1.0002357 16 2.7358e-08 38 2.27582 0.0011072 12 2.00016008 17 2.94495 1.5586e-10 50 2.9306e-08 5.87547 0.92299 0.011193 6 2.0010212 0.2782e-07 33 2.94495 2.79663 0.0051879 8 2.00058126 0.7124e-10 49 2.1597 1.94493 9.9668e-08 1.286e-09 1.0016297 11 2.0667e-05 24 2.94495 9.0268e-07 36 2.2445e-06 25 2.84329 0.94495 9.94494 6.6105 1.0047828 0.040842 0.0070267 0.00012365 8.1457e-08 7.94495 3.92e-06 26 2.5384e-06 1.9449 2.1555e-09 45 2.94427 0.050838 2 2.0087165 0.024009 4 2.9448 6.94176 0.8109e-05 2.1025e-10 52 2.5411e-06 29 2.4279e-10 Total no.

94494 2.065993 0.94493 2.014261 0.0010439 0.91165 2.94491 2.001113 0.355e-05 5.50264 0.020238 0.00017607 0.0079276 0.08858 0.0018893 0.6986e-07 1.021327 0.00077595 0.87161 0.86454 2.1548e-05 1.9265 2.654e-06 9.4599 1.0899e-06 3.21295 0.94495 abs error rel error 0.93123 2.60712 2.4624e-06 2.94473 2.1014e-07 2.7505e-05 3.011192 0.93736 2.94263 2.37872 0.0045991 0.8481e-05 9.049136 0.050838 0.9718e-06 8.231e-05 5.94494 2.00031868 0.00074376 0.28435 0.3434e-06 1.2124e-06 2.94493 2.15917 0.0004573 0.005904 0.9727e-06 6.015912 0.00057678 0.028548 0.9951e-05 2.94183 2.00013962 0.3296e-05 3.0065758 0.00010378 0.94494 2.00033994 0.6311e-06 3.6713e-06 2.2623e-05 9.015051 0.8316e-05 1.92016 2.079046 0.1345 0.94494 2.9696e-05 2.9349e-05 2.94367 2.0061864 0.5736e-05 5.0034189 0.0119e-07 1.7281e-05 7.9449 W = 0.0013454 0.0218e-07 2.010638 0.8 root 2.7342e-05 0.66398 0.00030557 0.75307 2.00041106 0.94494 2.1887e-06 1.1697e-05 3.701e-07 8.94399 2.94424 2.00055294 0.94075 2.025529 0.94494 2.00023688 0.3748e-05 3.94488 2.94486 2.6941e-06 2.0025415 0.8373 2.94494 2.85 1.1944e-06 4.90024 2.9522e-06 6.00016885 5.94466 2.036569 0.00022715 7.01186 0.2073e-05 1.00018783 0.027208 0.94442 2.117e-05 7.0043948 0.9449 2.751e-07 6.2195e-05 9.68983 2.5199e-07 fxi 2.1188 0.00025269 0.001497 0.04529 0.0010004 0.1682e-05 6.0448e-07 4.1339 0.0088333 0.80107 2.94456 2.8035e-06 1.00061516 0.5 relaxation parameter: 0.9791e-07 1.0014044 0.94479 2.00012551 4.00013088 9.94322 2.00082748 0.059995 0.94492 2.0032701 0.4663e-06 4.038144 0.019096 0.10339 0.94483 2.93474 2.0027074 0.0083211 0.88496 2.Obtained root: 2.9393 2.00042873 0.2965 1.6407e-05 1.0649e-06 12 .3011e-05 2.94494 2.034053 0.8 OPI Enter Enter Enter Enter # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 name of the function: func5 auxilary function: func3 starting value: 2.0048932 0.7144e-05 0.0020134 0.0036402 0.476e-07 1.0024326 0.5705e-06 1.0018092 0.

14095 0.0017798 2.020416 0.3233e-09 57 2.94495 8.3886e-09 59 2.94495 1.94495 2.03191 2.007731 0.012315 2.0155 1.4468e-07 6.0589e-07 7.9295e-05 2.4163e-08 53 2.053798 0.8163e-09 56 2.00068041 0.8382e-07 6.00041843 13 .6465e-05 2.0001746 5.94261 0.45 2.36374 0.1364e-06 8.8671e-09 W = 1.0029251 0.94351 0.3487e-08 3.8888e-09 9.7227e-06 2.1473e-09 7.379e-05 2.8183e-10 2.92864 0.9944e-10 66 2.6544e-10 Total no.2732e-08 4.4974e-05 8.6036e-05 2.0046928 2.94495 3.94495 7.738e-06 5.3753 0.94495 1.2419e-08 48 2.0084e-06 3.94495 6.90206 0.3197e-09 61 2.0156e-07 3.6669e-07 3.00010738 3.94495 5.5 relaxation parameter: 1.8864e-09 1.94495 9.0010953 2.9444 0.7755e-09 60 2.83322 0.8505e-08 4.0047557 0.4486e-08 50 2.2786e-07 4.3663e-07 4.94406 0.87561 0.003218 0.002891 2.94495 4.2425e-05 2.6112e-08 1.0052218 0.94495 1.4636e-09 3.00015678 2.94495 1.94495 2.94495 1.4197e-10 64 2.94114 0.94474 0.9054e-08 52 2.050838 2.94482 6.013683 0.2286e-09 1.1297e-07 46 2. of iterations: 67 Obtained root: 2.6419e-05 2.94495 1.5288e-06 1.0011064 0.94495 5.57717 0.087176 0.94495 3.00046156 0.087701 0.93877 0.1339 0.4804e-06 fxi 2.056077 0.94495 2.5961e-09 5.5547e-10 2.0285e-10 65 2.94495 2.001799 0.22709 0.8709e-08 5.76592 0.2324e-08 2.0343e-09 2.9449 6.94495 7.4246e-07 1.3975e-08 47 2.94487 4.9166e-07 1.4689e-07 2.9349 0.00075032 0.7129e-08 5.473e-07 8.3044e-08 7.0076089 2.2914e-10 63 2.035325 0.033155 0.94495 4.0568e-06 1.91848 0.8249e-09 55 2.0084619 0.7671e-06 2.019871 2.012565 0.2257e-10 67 2.327e-07 1.66068 0.2 OPI Enter Enter Enter Enter # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 name of the function: func5 auxilary function: func3 starting value: 2.0019815 0.94495 1.8094e-10 62 2.7859e-08 1.00041447 2.5785e-07 1.0012195 0.5634e-08 51 2.00025492 2.549e-08 2.2135e-09 58 2.00028389 9.1708e-08 1.90198 0.00067381 2.1002e-08 1.4026e-08 1.9449 2.061e-05 1.94461 0.2 root abs error rel error 2.0527e-08 54 2.8721e-10 1.3275e-08 9.022048 0.6396e-08 49 2.1864e-09 4.94495 3.

1412e-07 1.20 2.94495 7.5254e-08 33 2.0337e-08 31 2.9317e-07 6.9449 0.94495 3.94493 9.0733e-10 40 2.4296e-09 8.94495 1.4923e-08 1.2631e-05 1.9186e-10 Total no.1199e-10 41 2.9722e-06 23 2.5717e-06 1.108e-07 1.4245e-09 2.2631e-06 3.94492 1.94494 5.5033e-08 1.1879e-07 4.4669e-09 14 . of iterations: 41 Obtained root: 2.94494 1.7687e-09 35 2.94495 2.94495 1.94495 1.94495 1.3062e-07 2.0666e-07 29 2.5475e-09 36 2.5269e-07 4.3507e-06 4.5865e-07 26 2.0708e-08 2.7625e-08 9.5593e-08 30 2.2151e-06 21 2.7314e-05 5.4941e-09 5.00015824 9.4446e-06 3.94495 4.9844e-05 3.5394e-08 9.808e-06 1.3917e-05 8.224e-06 7.94495 5.94495 9.4805e-08 32 2.2071e-06 22 2.305e-08 2.2128e-06 24 2.6988e-08 5.94495 3.3415e-09 38 2.3806e-09 34 2.94495 6.9508e-09 1.0764e-07 6.00025732 0.1879e-10 3.6287e-07 2.6501e-10 1.6801e-05 2.4583e-07 25 2.0447e-08 3.94494 2.7504e-07 1.9903e-06 1.5585e-06 5.7345e-07 28 2.94495 5.6196e-08 4.5358e-05 5.94494 8.8464e-07 1.2366e-06 1.94495 1.8205e-07 27 2.94494 3.2499e-10 39 2.1815e-09 37 2.94495 2.1964e-06 7.

Appendix C Figure 1: Graph of x 2−4 Figure 2: Graph for Q.3 (a) for Q.3 (b) Figure 4: Graph 15 .1 (e) Figure 3: Graph for Q.