% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % % Problem on EPage 62; Solutions on EPage 161 % %----- close all; clc; clear all; addpath('../../BookCode'); % Test the code on several problems from this section: % disp('Ex 3.2:'); fn = @(x) ( x^1.4 - sqrt(x) + 1/x - 100 ); root_im = illinois_method( fn, 20.0, 30.0, 1.e-9 ) disp('Ex 3.3 one root:'); fn = @(x) ( abs(x).^3 + x - 6 ); root_im = illinois_method( fn, -3, -1, 1.e-9 ) disp('Ex 3.3 second root:'); root_im = illinois_method( fn, +1, +2, 1.e-9 ) disp('Ex 3.4:'); c = 10; fn = @(x) ( tan(x) - c ); root_im = illinois_method( fn, 1.4, 1.5, 1.e-9 )