Question: 3. (10 points) Write a Matlab program secant.m for the secant method. Suppose we want to find the largest positive root of f(x) = 2.3-5x
3. (10 points) Write a Matlab program secant.m for the secant method. Suppose we want to find the largest positive root of f(x) = 2.3-5x + 3, Plot the graph of y = f(x) on an appropriate interval by Matlab (check how to use Matlab build-in function plot). Use your secant.m to compute the root. Also use the bisection method, the Newton method, and the new method you derived in question 2 to find the root. For the bisection method, use 1,3) as the initial interval, for the Newton method, use o 2 as the initial point, for the secant method, use ao = 1 and x1-2 as the two initial points, and for the new method, use ao-2 as the initial point. You can choose any appropriate initial points and initial interval, Take tolerances xtol-1.e-12 and ftol-1.e-12 for Newton's method, the new method, and the secant method, and take delta-1.e-12 for the bisection method. Set a big number for the maximum number of iterations of the secant method and Newton's method such that the iteration stops only when xto1=1.e-12 or ftol-1.e-12 is satisfied. Conment on the speeds of convergence of these four methods. Print out the graph of y (x) and the commands you used to plot the graph, your program secant.m, and other M-files related o(). Also print out the results of each iteration step. You can use M-files newton.m and bisection.m on the course web site. 3. (10 points) Write a Matlab program secant.m for the secant method. Suppose we want to find the largest positive root of f(x) = 2.3-5x + 3, Plot the graph of y = f(x) on an appropriate interval by Matlab (check how to use Matlab build-in function plot). Use your secant.m to compute the root. Also use the bisection method, the Newton method, and the new method you derived in question 2 to find the root. For the bisection method, use 1,3) as the initial interval, for the Newton method, use o 2 as the initial point, for the secant method, use ao = 1 and x1-2 as the two initial points, and for the new method, use ao-2 as the initial point. You can choose any appropriate initial points and initial interval, Take tolerances xtol-1.e-12 and ftol-1.e-12 for Newton's method, the new method, and the secant method, and take delta-1.e-12 for the bisection method. Set a big number for the maximum number of iterations of the secant method and Newton's method such that the iteration stops only when xto1=1.e-12 or ftol-1.e-12 is satisfied. Conment on the speeds of convergence of these four methods. Print out the graph of y (x) and the commands you used to plot the graph, your program secant.m, and other M-files related o(). Also print out the results of each iteration step. You can use M-files newton.m and bisection.m on the course web site
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
