"Newton's Method and Loops": University of Karbala College of Engineering Petroleum Eng. Dep
"Newton's Method and Loops": University of Karbala College of Engineering Petroleum Eng. Dep
COLLEGE OF ENGINEERING
A Report
By:-
To :-
Evening study
Date
1/9/2020
1
Abstract
2
Introduction
Complex systems with higher speed processing control are in demand now a
days and the solution to this is to divide them into subsystems and in this
way each subsystem will be treated individually and the control and
operation will be applied to each of that subsystem.
Finding roots of the nonlinear equation with the help of Newton Raphson
method provides good result with fast convergence speed and Mat lab also
adopted this method for finding the roots and tool used for such calculations
is scientific calculator.
3
Explanation
Theory
Before starting Newton’s method: getting an idea what the function looks
like . The first thing to do is always to try to plot the function and look at it.
Our example looks like this:-
4
f(x) is represented by the blue curve.
we see that this root lies somewhere between −1 and −0.5, but the exact
numerical value of this root is hard to read off the graph. Still, that is already
good enough for starting Newton’s method to find a more accurate value for
the solution. We have seen a zero and we know more or less where it is.
5
Prerequisites for the use of Newton’s method
sin(x2)−x3=1 …..(3.1)
There is another prerequisite, namely that we are dealing with real numbers
in the equation. This goes for parameters and coefficients, but also for the
variable x itself. Newton’s method cannot find complex-valued solutions to
such an equation.
There are two more things we need to be able to do when using the method:
one is calculating derivatives and the other is finding reasonable points for
the function to start looking for the solution in the neighborhood of these
points. These two requirements become clear as soon as we start using
Newton’s method .
6
convince ourselves that the function f(x) does indeed have a zero (or
more)
pick a point on the function close enough to that zero (you’ll see
exactly what “close enough” means)
compute the zero of the tangent (which is simple, because the tangent
is a linear function)
use that zero of the tangent as our new x0, but in order to avoid
confusion, we call it x1
f(x) = 0 (3.2)
7
Newton iterations
We will denote an actual solution of equation (3.2) by x∗. There are three
methods which you may have discussed in Calculus: the bisection method,
the secant method and Newton’s method. All three depend on beginning
close (in some sense) to an actual solution x∗.
Recall Newton’s method. You should know that the basis for Newton’s
method is approximation of a function by it linearization at a point, i.e.
Since we wish to find x so that f(x) = 0, set the left hand side (f(x)) of this
approximation equal to 0 and solve for x to obtain:-
…..(3.4)
We begin the method with the initial guess x0, which we hope is fairly close
to x∗. Then we define a sequence of points {x0, x1, x2, x3, . . .} from the
formula:
……(3.5)
8
accomplish this is to count the number of times through. In Matlab, a for ...
end statement makes a loop as in the following simple function program:-
The result will be the sum of the first 100 integers. All for ... end loops have
the same format, it begins with for, followed by an index (i) and a range of
numbers (1:n). Then come the commands that are to be repeated. Last comes
the end command.
Loops are one of the main ways that computers are made to do calculations
that humans cannot. Any calculation that involves a repeated process is
easily done by a loop. Now let’s do a program that does n steps (iterations)
of Newton’s method[6]. We will need to input the function, its derivative,
the initial guess, and the number of steps. The output will be the final value
of x,
i.e. xn. If we are only interested in the final approximation, not the
intermediate steps, which is usually the case in the real world, then we can
use a single variable x in the program and change it at each step:-
9
In the command window define an inline function: f(x) = x3 – 5
i.e.
> f1 = inline(’3*x^2’).
Then run mynewton on this function. By trial and error, what is the lowest
value of n for which the program converges (stops changing).
Convergence
Newton’s method converges rapidly when f′(x∗) is nonzero and finite, and
x0 is close enough to x∗ that the linear approximation (3.2) is valid. Let us
take a look at what can go wrong.
10
References
[2] “Tan Tingting”, “ Li Ying” & “ Jiang Tong”, The Analysis of the
Convergence of Newton-RaphsonMethod Based on the Current Injection in
Distribution Network Case”,Volume no 5, Issue no 03, June 2013.
[4] “Cheong Tau Han”, “Lim Kquatiian Boon” & “ Tay Kim Gaik”, Solving
Non-Linear Equation by Newton-Raphson Method using Built-in Derivative
Function in Casio fx-570ES Calculator, Publication: UniversitiTeknologi
Mara, 2 UniversitiPendidikan Sultan Idris, UniversitiTun Hussein Onn
Malaysia
11