꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
Newton's Raphson method
1. PRACTICAL
Name- Saloni Singhal
M.Sc. (Statistics) II-Sem.
Roll No: 2046398
Course- MATH-409 L
Numerical Analysis Lab
Submitted To: Dr. S.C. Pandey
2. OBJECTIVE
1. Create an M-file to implement
Newton Raphson method.
1. Compare Fixed Point and Newton
Raphson method for convergence,
rate, etc.
3. Theory
Let be xo be an approximation of the root of f(x)=0, whose real
root is α= xo+h ,where h is the correction (small) to be applied
to to give the exact value of the root. Therefore, f(x)=f(xo+h)=0
By taylor series expansion, neglecting higher order terms and
substituting for h we get
And successive approximations as known as
The Newton’s Raphson Formula.
4. Convergence
The method fails if f '(x) = 0 or very small in the
neighborhood of the root.
The sufficient condition for convergence of
Newton-Raphson method is | f(x) f "(x) | < [f '(x)]2
The Newton Raphson method is said to have a
quadratic (Non-linear) rate of convergence. Geometric Significance:
OA1, OA2 , … are successive
approximations to the desired
root
5. Script File
x0=1; %initial approx
MaxIter=20;
tolX=1e-8;
% Newton-Raphson method computation
x=x0;
xold=x0;
for i = 1:MaxIter
F=x^2+log(x)-2;
Fd=2*x+(1/x);
x = x - F/Fd;
err(i)=abs(x-xold);
xold=x;
if(err(i)<tolX)
break;
end %display error in iterations
disp(['Error in iteration ',num2str(i),' is =
',num2str(err(i),'%e')])
end
7. Log Plot of error in i and i+1 iterations
Codes:
8. Log Plot of i+1 and i errors of Fixed point and Newton
Raphson
We calculate the
convergence rate of both
the methods by
calculating the slopes of
both curves using
cartesian coordinate
i.e. m=y2-y1/x2-x1
9. Conclusion
• For the given equation f(x)= x2+log(x)-2=0
• the initial approximated root is x0=1.0
and f(1)*f’’(1) < [f’(1)]^2 so convergence is
assured.
• And err(2)=0.01915
• So err(2)=[err(1)^2]*[f’’(1)]/2f’(1) or
err(n+1) ∝ err(n)^2
• Hence, the method has quadratic convergence.
• The real root is x =1.3141.
• And as f(1.3141) is in accepted region as tolx
=1e-8
10. Comparing Fixed Point and Newton
Raphson method
In newton Raphson method: -
• Rate of convergence = slope(2)= 1.927 =2(approx.)
• This shows that NR method has quadratic convergence.
In fixed point iteration method: -
• Rate of convergence=slope(1) = 1.0916 = 1(approx.)
• This shows that FPI method has linear convergence.
Also rate of convergence of newton Raphson method is
faster than fixed point iteration method as no of iterations
taken are: -
• i=15 in FPI
• and i=3 in NR iterations in FPI>NR