ノん 3 03 2- ata ord Uneoized mo da
%Matlab code for Newton method clear all close all syms x Y functions for which intersection have to find f (x,y)-x.*2ty.2-5; Displaying the equation fprintf ( The equations are n') disp(f) disp g) creating Jacobian matrix f x(x,y)-diff(f,x); t_y(x,y)=d iff ( f,y); gx (x,y)-diff (g, x)i g_y(x,y)-diff (g,y); %Jacobian matrix %displaying the Jacobian Matrix fprintftThe Jacobian Matrix is \nn) disp jacl) x1-1yl-1.5; fprintffor x-1 and y-1.5 Jacobian matrix is In') disp ( [f-x(x1'yl) f-y ( x 1 , yl ) ; g_x ( x1,yl) g-y ( x1 , y1))) fprintf(n tThe inverse of Jacobian Matrix is Inn') disp(inv(jacl)) loop for Newton iterations err-l;k 0; fprint f ( 'For initial condition x1=%f and x2=%f while err>10-10 \n',x1,y1) k=k+1 ; jac-f-x ( x 1 , yl ) f-y ( x1 , y 1 ) ;9-x ( x 1 , yl ) g-y ( x1 , y 1 )]; ijac-inv(jac) fprintf (Displayin the jacobian for 82.4f,2.4f) n jac- In',x1,yl) disp (double ( јас)) fprint f ( "Displayin inverse of jacobian for (82.4f,%2.4f)\n the ijac=\n" , x1,y1) disp (double(ijac)) fprint f ( "So that the Newton iterations X-%d-\n', k) fprint f ('[82.4f; %2.4f]-ijac * [ %2.4f; 82.4f1 In',x1,yl,f (x1,yl),g (x1,yl)) uu-double( [xl;yl]-ijac*[f(xl,yl) ;g(xl,yl)]); err norm (uu-[x1;yl]) x1-double (uu (1)) yl-double (uu ( 2)); tprint f ("\nAfter %d lterations\n',k)
We were unable to transcribe this image
We were unable to transcribe this image