Modified Secant Method has converged step xr fxr 100000000000000

# Modified secant method has converged step xr fxr

This preview shows page 10 - 11 out of 11 pages.

Modified Secant Method has converged step xr f(xr) 1.00000000000000 3.00000000000000 0.19090707642773 2.00000000000000 3.18360338836004 -0.00056230287607 3.00000000000000 3.18306300018166 0.00000001222880 4.00000000000000 3.18306301193337 -0.00000000000000 5.00000000000000 3.18306301193336 0.00000000000000 >> modified_secant(y); enter lower bound: x0 = 5 enter the perturbation fraction: delta = 1.e-6 allowable tolerance es = 1.e-20 maximum number of iterations: maxit = 100 Modified Secant Method has converged step xr f(xr) 1.00000000000000 5.00000000000000 -0.95218632766405 2.00000000000000 8.43840623028652 0.83424608017298 3.00000000000000 9.94988730083687 -0.50125988324262 4.00000000000000 9.37060663811810 0.05423002364893 5.00000000000000 9.42491168214595 -0.00005303264913 6.00000000000000 9.42485865377508 0.00000000000033 7.00000000000000 9.42485865377541 0.00000000000000 8.00000000000000 9.42485865377541 0.00000000000000 Modified Secant Method
>> y=inline( 'sin(x)+exp(-x)' ) y = Inline function: y(x) = sin(x)+exp(-x) >> dy=inline( 'cos(x)-exp(-x)' ) dy = Inline function: dy(x) = cos(x)-exp(-x) >> newton(y,dy) enter initial guess: xguess = 5 allowable tolerance: es = 1.e-20 maximum number of iterations: maxit = 100 Newton method has converged step x f(x) df/dx 1 5.00000000000000 -0.95218632766405 0.27692423846414 2 8.43843620531380 0.83422953550280 -0.55196095802147 3 9.94982849380668 -0.50120899566063 -0.86534634852288 4 9.37062804243114 0.05420864889818 -0.99861944125060 5 9.42491163301525 -0.00005298351447 -1.00008067979687 6 9.42485865377514 0.00000000000028 -1.00008068975027 7 9.42485865377541 0.00000000000000 -1.00008068975027 8 9.42485865377541 0.00000000000000 -1.00008068975027 Newton-Raphson Method

#### You've reached the end of your free preview.

Want to read all 11 pages?

• Fall '10
• Elkamal
• Secant method, Root-finding algorithm, f,x