
2-5.C xx=linspace(0,1) yy=fun (xx) fprintf('for the function f(x)=') disp(fun) figure (1) plot (xx, YY) xlabel('x') ylabel('f(x)') title('x vs.
#Make script freemat code#
%&Matlab code for Bisection method clear all close all function for which root have to find fun 3.*cos(2.*x).*cos(4.*)-2.*cos(6.**). %function for which root have to the function f(x)=')įprintf('\tRoot using Bisection method is %f.\n',root) Do you believe you found the root to 10 correct places in both cases? In theory, the Bisection Method gives as much precision as you ask it for Can you explain any difficulties the Bisection Method is having in practice? Summarize any differences between the two cases, fi and f2. Repeat Step 1 for the function () that is obtained by replacing the 5/2 in the function by 7/2 Just as for f(x), the revised function f(x) has exactly one roor in the intervalo S S L 4. What is the checking error" 1()? Make a table of ll nearby numbers (including your r) and their checking errors: - 5 x 10-10 - 4 x 1p-10 +5 x 10-10 When writing down the checking errors, you only need to report a few significant digits in the right side of the table, but be sure to list the exponent Does the table change your opinion about your best guess of the root? Report your best guess for the root of f1(1) up to 10 decimal places, and underline or highlight the digits you are confident are correct 3. Let's try to check your computed root (or roots, if you got more than one). Report your three solutions, rounded to 10 digits after the decimal point Do they agree? 2. If you are using the textbook's code, choose a tolerance TOL that will guarantee 10 correct digits. (Try to make sure they aren't thinly-disguised repetitions of one another.) Be sure to check that the Intermediate Value Theorem guarantees a solution before you start. Begin by applying the Bisection Method three times, using three different starting intervals (a,b).

You should use the Bisection Method as described below to determine the root, and then try to assess whether all 10 places are correct 1.

Use MATLAB, which does all calculations in double precision, equivalent to about 16 decimal digits. Your assignment is to find this root accurately to 10 decimal places, if possible. This function has exactly one root in the interval