Problem 2: Compare performance of Newton\'s method and Muller\'s method on the p
ID: 3210182 • Letter: P
Question
Problem 2: Compare performance of Newton's method and Muller's method on the problem of finding roots of a polynomial with real co- efficients by the method of deflation. Write a code implementing deflation method for finding all roots of a polynomial using (a) Newton's method, b) Muller's method ·On the example of P(x) = 2.3 +4x2 +4x+3, show that Newton's ·On the example of P(r) = 2.3 + 4x2 + 4x + 3, show that Muller's ·Show that Newton's method gives correct roots of P(x) = 2.3 + method can not produce complex roots when starts from real initial approximation. method is not sensitive to a real initial approximation 4r2 +4x +3, if the initial approximation has a nonzero complex component. Write a report. Include results of the calculations done in previ ous items, add minor comments explaining the resultsExplanation / Answer
SOL
p(x) = x^3+4x^2+4x+3;
actual roots of p(x) is -3, -0.5-0.866j , -0.5+0.866j
newton method
x(n+1)=x(n)-f(x(n)) /f'(x(n))
as if we choose x(n) as initial guess to real number then f(xn) also real and f'(xn) ia also real
therfore xn+1 is always real till the iteration convergence to real number in this case -3
thus with the initial guess of real number we never going to find out the complex roots of polynomial
%%%% Matlab code %%%%
% Newton Raphson method
syms x
f= x^3+4*x^2+4*x+3;
tol=10^(-6);
x0=[-5,1,4]; %%% initial guess
for k=1:length(x0)
s(1)=x0(k);
for n=1:100
l1=subs(f,s(n));
l2=subs(diff(f),s(n));
s(n+1)=s(n)-(l1/l2);
e=abs(s(n+1)-s(n));
if (e < tol)
break;
end
end
fprintf('Initial guess x0= %f ', x0(k));
fprintf(' roots of equation is = %f ', s(end));
fprintf('Number of iteration required = %d ', n);
end
OUTPUT:
Initial guess x0= -5.000000
roots of equation is = -3.000000
Number of iteration required = 7
Initial guess x0= 1.000000
roots of equation is = -3.000000
Number of iteration required = 7
Initial guess x0= 4.000000
roots of equation is = -3.000000
Number of iteration required = 13
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.