Question: Apply the MATLAB built-in function [rootest, fval]=fzero(func, initialguess) to compute the roots for the following functions. This function runs a relatively stable algorithm that uses
Apply the MATLAB built-in function [rootest, fval]=fzero(func, initialguess) to compute the roots for the following functions. This function runs a relatively stable algorithm that uses a combination of root-finding procedures discussed in class.
a) In a script file, compute the root of f(x)=e^(x-1)-1 using fzero with initial guesses x0=5 and x0=5+10^(-10) . For each initial guess, show the values of rootest and fval, and use these to compute and show the forward and backward absolute errors for each initial guess, using the exact root for the errors. The input func is the function f (x) enclosed by apostrophes. The outputs are the final root estimate and f (x) evaluated at this estimate. Use exp() for the exponential function.
b) In the same script, repeat what you did in part (a), but this time forf(x)=e^(4x-4)-2e^(3x-3)+2e^(x-1)-1, using the same exact root you used in part (a).
c) Determine the multiplicity of the root for both f(x)=e^(x-1)-1 and f(x)= e^(4x-4)-2e^(3x-3)+2e^(x-1)-1. Carefully explain the results you get from parts (a) and (b). How does the multiplicity affect the relationship between the forward and backward errors, and the reliability of the backward error measure? How does the change in input (initial guess) affect the change in output in the first function versus the second function, and why?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
