Professional Documents
Culture Documents
Haseeb Lab05 PSA
Haseeb Lab05 PSA
21-EE-170
Objective:
Theoretical Background:
Newton-Raphson method, also known as the Newton method, is an iterative numerical technique
for finding successively better approximations to the roots (or zeroes) of a real-valued function. It's
particularly useful when an analytical solution to finding these roots is difficult or impossible to
obtain. The method is based on the concept of using tangent lines to approximate the behavior of a
function near a root. Given an initial guess, the method iteratively refines this guess by intersecting
the x-axis with the tangent line at that point. The point of intersection becomes the new
approximation, hopefully closer to the true root.
Mathematical steps:
Pseudo code:
Flow chart:
LAB TASK
Use Newton-Raphson method to develope the code for the f(x)= x^3 - 6*x^2 + 9*x – 4.
Matlab Code:
clc
clear all
close all
syms x;
dx = 1;
x_val = 2;
iter = 0;
disp('iter g dx x')
iter = iter + 1;
dx = g / y;
fprintf('%d', iter)
end
Command window:
iter g dx x
Conclusion:
The implemented Newton-Raphson method successfully approximates the root of the equation f(x)=
x^3 - 6*x^2 + 9*x – 4. With close initial guesses, the method rapidly converges towards the root,
demonstrating its efficiency and versatility in numerical computation. However, it requires careful
selection of initial guesses and may exhibit sensitivity to function behavior near the root. Overall, the
method's reliance on function derivatives and potential for local extrema necessitate cautious
application in various numerical problems.