Code with C
Newton Raphson Method Algorithm and Flowchart
April 20, 2014 in Algorithms & Flowcharts, Numerical Methods 1 Comment
Newton Raphson method, also called the Newton’s method, is the fastest and simplest approach of all methods to find the real root of a nonlinear function. It is an open bracket approach, requiring only one initial guess. This method is quite often used to improve the results obtained from other iterative approaches.
The convergence is fastest of all the root-finding methods we have discussed in Code with C. The algorithm and flowchart for Newton Raphson method given below is suitable for not only find the roots of a nonlinear equation, but the roots of algebraic and transcendental equations as well.
The overall approach of Newton’s method is more useful in case of large values the first derivative of f(X) i.e f'(X). The iterative formula for Newton Raphson method is:
Xn+1 = Xn – f(Xn)/f'(Xn)
Features of Newton’s Method:
Type – open bracket
No. of initial guesses – 1
Convergence – quadratic
Rate of convergence – faster
Accuracy – good
Programming effort – easy
Approach – Taylor’s series
Newton Raphson Method Algorithm:
Start
Read x, e, n, d
*x is the initial guess
e is the absolute error i.e the desired degree of accuracy
n is for operating loop
d is for checking slope*
Do for i =1 to n in step of 2
f = f(x)
f1 = f'(x)
If ( [f1] < d), then display too small slope and goto 11.
*[ ] is used as modulus sign*
x1 = x – f/f1
If ( [(x1 – x)/x1] < e ), the display the root as x1 and goto 11.
*[ ] is used as modulus sign*
x = x1 and end loop
Display method does not converge due to oscillation.
Stop
Newton Raphson Method Flowchart:
Newton Raphson Method Flowchart
These algorithm and flowchart can be used to write source code for Newton’s method in any high level programming language.
Also see,
Newton’s Method C Program
Numerical Methods Tutorial Compilation
Although the Newton Raphson method is considered fast, there are some limitations. These are listed below:
Finding the f’(x) i.e. the first derivative of f(x) can be difficult in cases where f(x) is complicated.
When f’(xn) i.e. the first derivative of f(xn) tends to zero, Newton Raphson gives no solution.
Infinite oscillation resulting in slow convergence near local maxima or minima.
If the initial guess is far from the desired root, then the method may converge to some other roots. So, Newton Raphson method is quite sensitive to the starting value.
The method cannot be applied suitably when the graph of f(x) is nearly horizontal while crossing the x-axis.
If root jumping occurs, the intended solution is not obtained.