Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab Code, Hardware and Software Integration The modified secant method is an iterative approach to estimate the root of a given function. Given only a

Matlab Code, Hardware and Software Integration
image text in transcribed
image text in transcribed
The modified secant method is an iterative approach to estimate the root of a given function. Given only a single starting guess x, the root of the equation f(x) -o is estimated iteratively as follows: xif(x) f(x1 + %)-f(x.) 2 0 where a new estimate of the root of the function is predicted as a function of an old estimate of the root of the function. The parameter is a small perturbation fraction. The choice of a proper value for is not automatic. If 8 is too small, the method can be swamped by round-off error caused by subtractive cancellation in the denominator. If it is too big, the technique can become inefficient and even divergent. The iterations continue until either a maximum number of rounds is reached, or the relative estimation error defined as falls below a specific threshold. Write a MATLAB function that implements the modified secant method to find the root of a given function. Note that your MATLAB program must have access to the function, which can be achieved by passing a function handle funcHandle to it as its first input. The format of the MATLAB function is given below: function funcRoot, estimationError, Iter] modifiedsecant (funcHandle, x0, delta, maxError, maxIter) % modifiedsecant: modified secant method root location finder. % [funcRoot, estimationError, Iter) -modifiedSecant {funcHandle, , delta, maxError, maxIter) uses modified secant method to find the root of funcHandle close to the initial guess of x0 Inputs: funcHandle function handle of the function whose roots are being found x0 delta maxError initial guess small input perturbation fraction desired relative estimation error of the root of the function (default-10-5) maxIter Outputs : maximum number of allowable iterations (default-100) funcRoot real root of the function specified by funcHandle estimat ionError approximate relative error{%) Iter number of iterations run to find the root of funcHandle At each iteration, the function prints out the iteration number, the estimated root of the function at that iteration, and the relative estimation error at that iteration (in percent) in a tabulated format with appropriate headings. Write a MATLAB script that uses your function to find the roots of the following equations: a) Use the modified secant method to estimate the root of f(x)--x employing an initial guess of xo_o. Run your program three times with values of = 0.01, = 0.05, and =0.1, and compare the convergence properties of your function. b) Use the modified secant method to estimate the positive root of f(x)-16.05x 88.75x- 192.0375x2+116.35x+ 31.6875 employing an initial guess of x.-0.5825, = 0.05, and a maximum error of o.0I c) Use the modified secant method to estimate the lowest positive root of f(x) -7sin(x)e*-1 employing an initial guess of x 0.3 and 0.01

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions