0% found this document useful (0 votes)
44 views5 pages

Solution of Non Linear Equation by Using Newton Rapshon Method

Solution of non linear equation by using Newton Rapshon Method

Uploaded by

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

Solution of Non Linear Equation by Using Newton Rapshon Method

Solution of non linear equation by using Newton Rapshon Method

Uploaded by

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

Dept.

of
Electrical & Electronic Engineering
Lab. Report on

EEE 2206: NUMERICAL METHODS &


STATISTICS IN ENGINEERING SESSIONAL

Student Name: Iftiar Rahman Emon

Student ID: 211136

Experiment No: 02
Exp. Name: Solution of non-linear equation by using Newton-Rapshon
Method

Date of Experiment: 08-09-2024


Date of Submission: 15-09-2024

Course Teacher: Md. Rabiul Islam


Lecturer, EEE, JUST
Comments:

JASHORE UNIVERSITY OF SCIENCE & TECHNOLOGY


Jashore-7408, Bangladesh
Experiment No: 02
Experiment Name: Solution of non-linear equation by using Newton-
Rapshon Method

1. Objective
To implement the Newton-Raphson method in MATLAB and C programming to find the
root of a given nonlinear equation.

2. Theory
The Newton-Raphson method is an iterative numerical method for finding the root of a
nonlinear equation. It uses the tangent line to approximate the function at the current
guess and finds the point where the tangent line intersects the x-axis. This point becomes
the next guess, and the process is repeated until a desired accuracy is achieved.

Let 𝑥0 be the approximate root of 𝑓(𝑥) = 0 and let 𝑥1 = 𝑥0 + ℎ be the correct root. Then

𝑓(𝑥1 ) = 0

⇒ 𝑓(𝑥0 + ℎ) = 0 ……….(1)

By expanding the above equation using Taylor’s theorem, we get:

𝑓(𝑥0 ) + ℎ𝑓 ′ (𝑥0 ) + ⋯ = 0
⇒ ℎ = −𝑓(𝑥0 )/𝑓 ′ (𝑥0 )

Therefore,
𝑥1 = 𝑥0 − 𝑓(𝑥0 )/𝑓 ′ (𝑥0 )

Now, 𝑥1 is the better approximation than 𝑥0

Similarly, the successive approximations 𝑥2 , 𝑥3 , … … . 𝑥𝑛+1 are given by


𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′ … … … . (2)
𝑓 (𝑥𝑛 )
Equation 2 is called the Newton-Rapshon formula to find the roots of an equation.

The geometric representation of this formula is given below


Figure 2.1: Graphical Representation of Newton-Rapshon Method.

3.Steps:

Input Parameters:
Function Definition: The user is prompted to enter the nonlinear function in symbolic form.
Derivative Definition: The user is asked to input the derivative of the function.
Initial Guess: The user specifies the initial guess for the root.
Number of Iterations: The user defines the maximum number of iterations to be performed.
Tolerance: The user sets the desired tolerance for the root.

Newton-Raphson Method Algorithm:


Check for Initial Guess Validity:
Verify if the derivative at the initial guess is not zero. If it is, display an error message indicating
that the Newton-Raphson method cannot be applied.

Iteration Loop:
For each iteration:
Calculate the next guess x1 using the Newton-Raphson formula.
Print the current iteration and the calculated value of x1.
Check for convergence:
If the absolute difference between x1 and the previous guess x0 is less than the tolerance, the
root is considered found, and the loop breaks.
Check for Zero Derivative:
If the derivative at x1 is zero, display an error message indicating that the method failed.
Update the current guess:
Set x0 to x1 for the next iteration.

3. MATLAB Script Code:


4. Output:

5.Discussion:

The code demonstrates the Newton-Raphson method to find the root of the nonlinear equation
f(x) = x^2 + 2x - 2. We input the function, its derivative, an initial guess, the maximum number
of iterations, and the desired tolerance. The Newton-Raphson method iteratively refines the
initial guess using the tangent line approximation to converge towards the root. The output
shows the root approximations at each iteration. The final calculated root is 0.7321, which is
within the specified tolerance. The Newton-Raphson method is generally more efficient than the
bisection method, but it requires the calculation of the derivative.

You might also like