Question

In: Advanced Math

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

Solutions

Expert Solution

clc;
clear all;
format short

f=@(x)exp(x+1) - 2 - x; %function

f1=@(x)exp(x+1)-1; %derivative of function

x(1)=1; %initial value
tol=1e-7; % tolernece
erorr=0.1;
n=1;
Max_iter=18; % Maximum iteration

while(erorr>tol&n<Max_iter)

x(n+1)=x(n)-(2*f(x(n))/f1(x(n))); %newton method
  
%x=x1;
erorr(n)=abs((x(n)-x(n+1)));
n=n+1;

end
disp('_____________________________________________________________')

disp('n x(n)) f(x(n)) error ')
disp('____________________________________________________________')

for i=1:n-1
fprintf('%d\t%15f \t %20f \t %20f \n',i ,x(i),f(x(i)),erorr(i))
end

for i=2:n-2
r(i-1)=log(erorr(i+1)/erorr(i))/log(erorr(i)/erorr(i-1));
end
disp('Rate of convergence')
r'
disp('Root of function is')
y=x(end)

disp('Number of iteration to converge the root')
n-1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

_____________________________________________________________
n x(n)) f(x(n)) error   
____________________________________________________________
1   1.000000    4.389056    1.373929
2   -0.373929    0.244177    0.561166
3   -0.935095    0.002153    0.064203
4   -0.999298    0.000000    0.000702
5   -1.000000    0.000000    0.000000
Rate of convergence

ans =

2.4212
2.0830
2.0003

Root of function is

y =

-1.0000

Number of iteration to converge the root

ans =

5

>>


Related Solutions

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 secant Method to find a root for the function: f(x) = x^3 + 2x^2...
Use the secant Method to find a root for the function: f(x) = x^3 + 2x^2 + 10x -20, with x_0 = 2, and x_1 = 1.
Use the Fixed-Point Iteration Method to find the root of f ( x ) = x...
Use the Fixed-Point Iteration Method to find the root of f ( x ) = x e^x/2 + 1.2 x - 5 in the interval [1,2].
Use Newton’s method to find the real root (in four decimal places) near 0.5 of the...
Use Newton’s method to find the real root (in four decimal places) near 0.5 of the equation x^5 −4x^2 + 2 = 0
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
USING BISECTION METHOD, FIND THE ROOT OF 0.5e^x - 5x + 2 = 0 ON THE...
USING BISECTION METHOD, FIND THE ROOT OF 0.5e^x - 5x + 2 = 0 ON THE INTERVAL [ 0 , 1 ] UP TO 3 DECIMAL PLACES. USE NEWTON'S METHOD TO APPROXIMATE THE ROOT OF f(x)=x^2-5    IN THE INTERVAL  [ 2 , 3 ] UP TO 4 DECIMAL PLACES.
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.
Use the False Position method to find a guess of the root of f(x) = cos(x2...
Use the False Position method to find a guess of the root of f(x) = cos(x2 ) with lower and upper bounds of 0 and 2, respectively. Then, narrow the interval and find a new guess of the root using False Position. What is your relative approximate error? a. 8.47% answer b. 12.45% c. 0.112 d. 0.243 e. None of the above Please provide complete solution how the answer is a thumbs up for correct and neat solution! step by...
GIVEN: COS(x) +3xe^-x=0 USING NEWTON RAPHSON METHOD Find: 1.) The POSITIVE ROOT USING X0=2 2.) THE...
GIVEN: COS(x) +3xe^-x=0 USING NEWTON RAPHSON METHOD Find: 1.) The POSITIVE ROOT USING X0=2 2.) THE NEGATIVE ROOT USING X0=-0.5 *STOPPING CRITERION ≤ 0.01% use radian mode in calcu and i dont want a program answers pls i need the manual method.
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT