Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
14 views2 pages

Lab Report 4

Uploaded by

Azeem Shan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Lab Report 4

Uploaded by

Azeem Shan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Numerical Analysis Lab

Experiment # 04
Title: Newton Raphson method
Objective:
The objective of the Newton-Raphson method is to find the root or solution of a given equation. It
does this by iteratively refining an initial guess until it gets very close to the actual root. This method
provides a systematic way to find solutions to equations, especially when other methods may be
difficult or impractical to apply.
Theoretical background: The Newton-Raphson method, formulated by Isaac Newton and Joseph
Raphson, is a powerful iterative technique for finding successively better approximations to the roots
(or zeroes) of a real-valued function. It leverages calculus by iteratively refining an initial guess based
on the function's derivative until a satisfactory solution is obtained. Widely used in numerical analysis
and optimization, its efficiency lies in its quadratic convergence rate, making it particularly useful for
solving nonlinear equations and optimization problems in various fields such as engineering, physics,
and economics.

Procedure:
The Newton-Raphson method is an iterative numerical technique used to approximate the roots of a
real-valued function. The procedure begins by selecting an initial guess for the root of the function.
Subsequently, the function and its derivative are evaluated at this initial guess. Using this information,
the method computes a new approximation by adjusting the guess based on the function's value and
slope at the current point. This process of updating the guess is repeated iteratively until a satisfactory
level of accuracy is achieved or until convergence criteria are met. The final approximation obtained
through this process provides an estimate of the root of the function, often with a high degree of
precision.
Code and output:

syms x;
a=x^3-19;
error= 0.1
x0=input("enter the intial value");
tol=input("enter the allowed error")
f=inline(a);
dif=diff(sym(a));
d=inline(dif);
while error>tol
x1=x0-((f(x0)/d(x0)));
error=abs((x1-x0)/x1);
x0=x1;

end
root=x1
c=-10:0.01:10;
plot(c,f(c))
Conclusions:

The Newton-Raphson method stands as a powerful tool for approximating the roots of real-valued
functions with remarkable efficiency. Its iterative nature and exploitation of calculus make it
particularly adept at rapidly converging towards solutions. While its quadratic convergence rate often
leads to swift convergence, careful consideration must be given to its initial guess and potential
singularities in the function. Despite these considerations, the method's widespread application across
various fields attests to its reliability and effectiveness in numerical analysis and optimization tasks.

You might also like