Question

In: Advanced Math

Formulate Newton’s method for the system x^3 = y y^3 = x Note that this system...

Formulate Newton’s method for the system
x^3 = y

y^3 = x

Note that this system has three real roots (−1, −1), (0, 0) and (1, 1). By taking various initial points in the square −2 < x, y < 2, try to obtain the attraction regions of these three roots.

P.S. An attraction region of a root is defined as the set of all initial points which will eventually converge to the root.

Solutions

Expert Solution


%Matlab code for Multivariate Newton Raphson method
clear all
close all

syms x y
%steady state equation
f(x,y)=x^3-y;
g(x,y)=y^3-x;

%Newton Raphson algorithm
f_x(x,y)=diff(f,x);
f_y(x,y)=diff(f,y);
g_x(x,y)=diff(g,x);
g_y(x,y)=diff(g,y);
%initial guess for Newton Raphson
x0=-2;y0=-2;
fprintf('For initial guess x=%f and y=%f.\n',x0,y0)
err=1; c=0;
  
    %loop for Newton Raphson Algorithm
    while err>10^-12
        c=c+1;
        %Jacobian of equation of 2 variable
        jac=[f_x(x0,y0) f_y(x0,y0);g_x(x0,y0) g_y(x0,y0)];
        ijac=inv(jac);
        xx=double([x0;y0]-ijac*[f(x0,y0);g(x0,y0)]);
        %error in each loop
        err(c)=norm(xx-[x0;y0]);
        %iteration count
        it(c)=c;
        x0=double(xx(1));
        y0=double(xx(2));
        fprintf('After %d iteration\n',c)
        fprintf('\t x=%.12f\ty=%.12f\n',x0,y0)
    end

fprintf('\nNR solution for solution of equation is x=%.12f y=%.12f.\n',xx(1),xx(2))
fprintf('------------------------------------------------------------\n\n')


%initial guess for Newton Raphson
x0=2;y0=2;
fprintf('For initial guess x=%f and y=%f.\n',x0,y0)
err=1; c=0;
  
    %loop for Newton Raphson Algorithm
    while err>10^-12
        c=c+1;
        %Jacobian of equation of 2 variable
        jac=[f_x(x0,y0) f_y(x0,y0);g_x(x0,y0) g_y(x0,y0)];
        ijac=inv(jac);
        xx=double([x0;y0]-ijac*[f(x0,y0);g(x0,y0)]);
        %error in each loop
        err(c)=norm(xx-[x0;y0]);
        %iteration count
        it(c)=c;
        x0=double(xx(1));
        y0=double(xx(2));
        fprintf('After %d iteration\n',c)
        fprintf('\t x=%.12f\ty=%.12f\n',x0,y0)
    end

fprintf('\nNR solution for solution of equation is x=%.12f y=%.12f.\n',xx(1),xx(2))
fprintf('------------------------------------------------------------\n\n')

%initial guess for Newton Raphson
x0=0.5;y0=-0.5;
fprintf('For initial guess x=%f and y=%f.\n',x0,y0)
err=1; c=0;
  
    %loop for Newton Raphson Algorithm
    while err>10^-12
        c=c+1;
        %Jacobian of equation of 2 variable
        jac=[f_x(x0,y0) f_y(x0,y0);g_x(x0,y0) g_y(x0,y0)];
        ijac=inv(jac);
        xx=double([x0;y0]-ijac*[f(x0,y0);g(x0,y0)]);
        %error in each loop
        err(c)=norm(xx-[x0;y0]);
        %iteration count
        it(c)=c;
        x0=double(xx(1));
        y0=double(xx(2));
        fprintf('After %d iteration\n',c)
        fprintf('\t x=%.12f\ty=%.12f\n',x0,y0)
    end

fprintf('\nNR solution for solution of equation is x=%.12f y=%.12f.\n',xx(1),xx(2))
fprintf('------------------------------------------------------------\n\n')

%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%


Related Solutions

Numerical Analysis: Apply Newton’s method to find the roots of polynomial P(x) = x^3 + 3x^2...
Numerical Analysis: Apply Newton’s method to find the roots of polynomial P(x) = x^3 + 3x^2 − 2x + 1. Find the convergence rate.
Apply Newton’s method and the modified method to the equation f(x) = 1−cos(x−5) to approximate the...
Apply Newton’s method and the modified method to the equation f(x) = 1−cos(x−5) to approximate the a double root 5. Compare the results and demonstrate the superiority of the modified method. Numerically identify the rates of convergence of both the methods.
Use Newton’s Method to approximate the value of x where f(x) = x3 + 10x2 +...
Use Newton’s Method to approximate the value of x where f(x) = x3 + 10x2 + 15x – 2 has a local maximum. Give the value accurate to 3 decimal places.
3.Consider the system x*=4x-y, y*=2x+y (a) Write the system in matrix form  and find the eigenvalues and...
3.Consider the system x*=4x-y, y*=2x+y (a) Write the system in matrix form  and find the eigenvalues and eigenvectors of the matrix A. (b) Classify the fixed point at the origin (c) Find the  general solution of the system (d) Solve the system subject to the initial condition
Solve the system y'=x x'=-x+ry-y^3 r is a real number. Solve for eigenvalues & stability of...
Solve the system y'=x x'=-x+ry-y^3 r is a real number. Solve for eigenvalues & stability of system. Show bifurcation value.
Use Newton’s method to find x1, x2 and x3 with the given x0 2/x− x^2 +...
Use Newton’s method to find x1, x2 and x3 with the given x0 2/x− x^2 + 1 = 0 x0 = 2
Use the Newton’s method to find the root for ex+1 = 2 + x, over [−2,...
Use the Newton’s method to find the root for ex+1 = 2 + x, over [−2, 2]. Can you find a way to numerically determine whether the convergence is roughly quadratic using error produced at each iteration? Include your answers as Matlab code comments
Estimate the numeric value of 51/7 accurately to 6 decimal places, using Newton’s Method. Note: You...
Estimate the numeric value of 51/7 accurately to 6 decimal places, using Newton’s Method. Note: You may use Excel to solve this problem.
Use the method of Undetermined Coefficients to find a general solution of this system X=(x,y)^T Show...
Use the method of Undetermined Coefficients to find a general solution of this system X=(x,y)^T Show the details of your work: x' = 6 y + 9 t y' = -6 x + 5 Note answer is:  x=A cos 4t + B sin 4t +75/36; y=B cos 6t - A sin 6t -15/6 t
Formulate the situation as a system of inequalities. (Let x represent the number of goats the...
Formulate the situation as a system of inequalities. (Let x represent the number of goats the farmer can raise and y represent the number of llamas.) A rancher raises goats and llamas on his 800-acre ranch. Each goat needs 4 acres of land and requires $70 of veterinary care per year, while each llama needs 10 acres of land and requires $56 of veterinary care per year. If the rancher can afford no more than $9,240 for veterinary care this...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT