% % 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 63; Solutions on EPage 161 % %----- close all; clc; clear all; addpath('../../BookCode'); fn = @(x) ( [ x(1)^3 - 3*x(1)*(x(2)^2) - 1/2; 3*(x(1)^2)*x(2) - x(2)^3 - sqrt(3)/2 ] ); fn_prime = @(x) ( [ 3*x(1)^2 - 3*x(2)^2 , -6*x(1)*x(2); 6*x(1)*x(2), 3*x(1)^2 - 3*x(2)^2 ] ); [root,n_iters] = broyden( [1,2].', fn, 2, 1.e-4 ) [root,n_iters] = newtonmv( [1,2].', fn, fn_prime, 2, 1.e-4 )