Newton Raphson Method MATLAB code :
Introduction to Iterative methods:
There are a number of iterative methods that have been tried and used successfully in various problem situations. All these methods typically generate a sequence of estimates of the solution which is expected to converge to the true solution.
Newton Raphson method is also one of the iterative method which is used to find the roots of given expression.
Newton Raphson Method with MATLAB code:
If point x0 is close to the root α, then tangent line to the graph of f(x) at x0 is a good approximation the f(x) near α. So root of the tangent line, where line cuts the X-axis; x1 is the better approximation to α than x0 is.
Slope of the tangent =
Continue in this way. If xn is the current estimate, then the next estimate xn+1 is given by
if x0 is sufficiently close to α, xn→α as n→∞.
Limitations of Newton Raphson method:
- If initial guess is too far away from the required root, the process may converge to some other root.
- Division by zero may occur if f’(xi) is zero or very close to zero.
- A particular value in the iteration sequence may repeat, resulting in an infinite loop.
Newton Raphson MATLAB program :
% Newton Raphson Method
% Change here for different functions
%this is the derivative of the above function
% Change lower limit ‘a’ and upper limit ‘b’
fprintf(‘Approximate Root is %.15f’,sol)
xlabel(‘Number of iterations’)
title(‘Error Vs. Number of iterations’)
Approximate Root is 0.6071016481031231
You may also like:
- Representation of basic discrete time signal using MATLAB
- Jacobi’s iteration method
- lagrange interpolation with MATLAB Program
- Simpson’s 3/8th Rule MATLAB Program example
- Simpson’s 1/3rd rule MATLAB Program examples
- MATLAB Programming for Trapezoidal rule with example
- Gauss Seidel – MATLAB Program and Algorithm
Tags: Newton Raphson Method MATLAB code, Newton Raphson Method MATLAB program.