You are on page 1of 6

Numerical Computing

Project Report

Title:
Length of Electrical poles using Newton
Raphson Method
MEMBERS NAME:

USAMA MIR (9941)


WAHEED AFRIDI (11723)
SYED HAMMAD (10259)

INSTRUCTOR:

Sir Sanjay Kumar


Acknowledgement:
We have made this project with the understanding of all the
principles of Numerical Computing that were taught to us in
both theory class and labs. This wouldn’t have been possible
without the great support of our instructor Sir Waqas Pasha who
always stood with us as a pillar of support always guided us in
the most friendly way

Brief Introduction:

This project is known as the measuring length between 2


electrical poles which is made with Newton Raphson Method.
This project is made on Python language and the basic work of
this project is that it takes initial point, tolerable error, sag of
the cable and length between poles from the user and then
calculates the value of T0, the difference between iterations
and the length of the cable using Newton Raphson’s Formula
that is:

We have used the import math library which will be used to


find the derivative of the function f’(x0).
These are the syntax used to fulfil the demands of the Newton
Raphson Formula.
In our project, the output of this code will be stored in a text file
for more accuracy with all the iterations in it.

A brief Introduction about Newton Raphson:


The Newton-Raphson method (also known as Newton's
method) is a way to quickly find a good approximation for the
root of a real-valued function f(x) = 0. It uses the idea that a
continuous and differentiable function can be approximated by
a straight line tangent to it.
Suppose you need to find the root of a continuous, differentiable
function f(x), and you know the root you are looking for is near
the point x=x0 . Then Newton's method tells us that a better
approximation for the root is:

This process may be repeated as many times as necessary to get


the desired accuracy. In general, for any x-value xn, the next
value is given by:
Advantages and Disadvantages:

Advantages:

 Fast convergence: It converges fast, if it converges. Which


means, in most cases we get root (answer) in less number of
 steps.
 It requires only one guess.
 Formulation of this method is simple. So, it is very easy to
 apply.
 It has simple formula so it is easy to program.
 Derivation is more intuitive, which means it is easier to
understand its behaviour, when it is likely to converge and
when it is likely to diverge.

Disadvantages:

 It's convergence is not guaranteed. So, sometimes, for given


 equation and for given guesswe may not get solution.
 Division by zero problem can occur.
 Root jumping might take place thereby not getting intended
 solution.
  Inflection point issue might occur.
 Symbolic derivative is required.
 In case of multiple roots, this method converges slowly.
 Near local maxima and local minima, due to oscillation, its
convergence is slow.

Reason of using this method in our project:

We used this method because it was way more convenient for


us to find the length of the wire using this method since it
converges fast and for our domain of the project values are
needed quickly.
Code:

Output:

Output in textfile:

You might also like