Solve the following problems using the MATLA8 environment. Do not use MATLAB?s built-in functions for solving nonlinear
Question:
Solve the following problems using the MATLA8 environment. Do not use MATLAB?s built-in functions for solving nonlinear equations.
Steffensen's method is a scheme for finding a numerical solution of an equation of the form f(x) = 0 that is similar to Newton?s method but does not require the derivative of f(x). The solution process starts by choosing a point xi, near the solution, as the first estimate of the solution. The next estimates of the solution xi + 1 are calculated by:
Write a MATLAB user-defined function that solves a nonlinear equation With Steffensen's method. Name the function Xs = SteffensenRoot(Fun,Xest), where the output argument Xs is the numerical solution. The input argument Fun is a name for the function that calculates f(x) for a given x (it is a dummy name for the function that is imported into SteffensenRoot), and Xest is the initial estimate of the solution. The iterations should stop when the estimated relative error (Eq. (3.9)) is smaller than 10?6. The number of iterations should be limited to 100 (to avoid an infinite loop). If a solution with the required accuracy is not obtained in 100 iterations, the program should stop and display an error message.
Use the function SteffensenRoot to solve Problems 3.2 and 3.3.
Problem 3.2
Determine the root of f(x) = x - 2e - x by:
(a) Using the bisection method. Start With a = 0 and b = 1, and carry out the first three iterations.
(b) Using the secant method. Start With the two points, x l = 0 and x 2 = 1, and carry out the first three iterations.
(c) Using Newton's method. Start at x l = 1 and carry out the first three iterations.
Problem 3.3
The location x? of the centroid of an arc of a circle is given by
x?= rsin?/?
Determine the angle which x? = 3r/4.
First, derive the equation that must be solved and then determine the root using the following methods:
(a) Use the bisection method. Start with a = 0.5 and b = 1.5, and carry out the first four iterations.
(b) Use the secant method. Start with the two points a l = 0.5 and a 2 = 1.5, and carry out the first four iterations.
Estimated Relative Error
Calculus Early Transcendentals
ISBN: 978-0321947345
2nd edition
Authors: William L. Briggs, Lyle Cochran, Bernard Gillett