Vous êtes sur la page 1sur 19

1

Solution of Nonlinear Equations


Topic: Iterations and Roots finding methods
Dr. Nasir M Mirza
Numerical Methods
Email: nasirmm@yahoo.com
2
Solution of Nonlinear Equations
0 7 5
3 4
= + x x x
Nonlinear equations are those which involve powers other than the
first, for example
This is a quartic equation as it has x
4
.
The transcendental equations are those which involve functions
other than just powers of x. For example,
2
cos ) exp( x x x + =
When no simple method exists for solving equations lie above,
we use numerical methods to solve them.
Numerical analysis uses a process known as ITERATION.
3
Solution of Nonlinear Equations
|
.
|

\
|
+ =
x
N
x y
2
1
ITERATIONS:
Assume N = 1973 and x = 40.
y = 0.5(40 + 1973/40) = 0.5(40 + 49.3) = 44.6
Let us look at this equation:
Suppose now x = 44.6 instead of 40.
y = 0.5(44.6 + 1973/44.6) = 0.5(44.6 + 44.24) = 44.42
now take x = 44.42 instead of 44.6.
y = 0.5(44.42 + 1973/44.42) = 0.5(44.42 + 44.41692) = 44.41846
Putting x = 44.41846
y = 0.5(44.41846 + 1973/44.41846) = 44.41846
4
Solution of Nonlinear Equations
|
.
|

\
|
+ =
x
N
x y
2
1
ITERATIONS:
The process of finding successive approximations to a quantity as
done in previous slide is called iterative process.
Notice that x and N/x have been getting closer and closer
Each use of formula is called an iteration and each successive
answer is an iterate.
The first value of y was taken as the second value for x and then
second value of y was taken as the third value of x and so on.
5
Solution of Nonlinear Equations
|
.
|

\
|
+ =
x
N
x y
2
1
ITERATIONS:
Let the initial guess is labeled as x
o
.
Then the first value of y is the first iterate or x
1
; then the second value is
x
2
and so on.
( )
0 0 1
/ 5 . 0 x N x x + =
( )
1 1 2
/ 5 . 0 x N x x + =
( )
2 2 3
/ 5 . 0 x N x x + =
( )
n n n
x N x x / 5 . 0
1
+ =
+
n = 0, 1, 2, 3, . . .
6
ITERATIONS:
0.5( x
n
+ N/x
n
) x
n+1

START
READ N, x
o
, c
Is
| x
n+1
x
n
| < c
x
n+1
x
n

Output: x
n+1

STOP
YE
S
NO
Flow chart for
program on
iteration:
7
Solution of nonlinear equations by iterations
0 10 4
2 3
= + x x x
( )
n n
x F x =
+1
2 3
4 10 x x x + =
The form of iterative equation should be:
Consider as an example. Let us find root of the following equation
Let us rearrange the equation so that it has general form: x = F(x);
Two possibilities are following:
2
2
10 4
x
x x
x
+
=
Then iterative equations can be written for above cases:
2 3
1
4 10
n n n
x x x + =
+
2
2
1
10 4
n
n n
n
x
x x
x
+
=
+
What should be initial starting point and we can find that ?
8
Solution by iterative methods
Various methods to take an
initial points are following:
First method is to Make a
approximate graph of y = x
3
4x
2
+x -10 ; then look for
approximate point where
curve is crossing the x-axis.
That point will be the initial
starting point x
o
.
x
o
= 4
-2 0 2 4 6 8
-80
-40
0
40
80
120
160
200
240
280


y
(
x
)
x
9
Solution by iterative methods
Second method is to Make a rough table of x and y using the
equation: y = x
3
4x
2
+x -10 ; then look for approximate point
where y changes its sign. That point will be the initial starting point
x
o
.
x -2 -1 0 1 2 3 4 5 6
y -36 -16 -10 -12 -16 -16 -6 20 68
So, the initial starting point will be x
o
= 4.
10
Solution of nonlinear equations by iterations
0 10 4
2 3
= + x x x
Let us find root of the equation:
Consider first the form:
x
0
= 4. , x
1
= 10; x
2
= -590, x
3
= -203986590
2 3
1
4 10
n n n
x x x + =
+
This process is going wild.
Let us take another form of the iterative equation:
2
2
1
10 4
n
n n
n
x
x x
x
+
=
+
x
0
= 4. , x
1
= 4.4; x
2
= 4.29, x
3
= 4.310
x
4
= 4.3063 , x
5
= 4.3070; x
6
= 4.3069, x
7
= 4.3069
This process shows that x = 4.3069 is a root.
11
Solution of nonlinear equations by iterations
CONVERGENCE:
The iteration process is based on this fact that the absolute difference between
x
n+1
and x
n
will decrease as n increases. It means
If |F(x)| < 1 then the iteration process will converge.
( )
n n
x F x =
+1
When F(x) = 10 x
3
+ 4x
2
; F(x) = -3x
2
+ 8x; which means
F(x=4) = -16 and its absolute value is greater than one.
When F(x) = (4x
2
x +10)/x
2
; F(x) = 1/x - 20/x
2
; which means F(x=4)
= -1/4 and its absolute value is less than one. That is why the second
possible equation converges to the root.
12
Convergence Criteria
The algorithm must decide on
how close to the root the guess
should be before stopping.
Two criteria can be applied
in testing.

Magnitude by which
estimate of root
changes.
Magnitude by which the
function will change.

f(x)
x
Tolerance
on f(x)
Tolerance
on x
13
Does the function have singularities?

a
f(x)
x
b
f(a)
f(b)
Some root finding procedure will converge to a singularity, as well
as converge to a root.
This must be guarded against.

a
f(x)
x
b
f(a)
f(b)
14
Basic Root Finding Techniques

a
f(x)
x
b
The main concept of each technique is to bracket the root and do
a series of iteration until the method converges on a solution.
15
Basis of Any Bisection Method
Theorem one:
x


f(x)
x
u

x
An equation f(x)=0,
where f(x) is a real
continuous function,
has at least one root
between x
l
and x
u
if
f(x
l
) f(x
u
) < 0.
16
Theorem Two:
If function f(x) in
f(x)=0 does not
change sign between
two points, roots
may still exist
between the two
points.

x


f(x)
x
u

x
17
Theorem Three:
If the function f(x) in f(x)=0 does not change sign between two
points, there may not be any roots between the two points.

x


f(x)
x
u

x

x


f(x)
x
u

x
18
Theorem Four:
If the function f(x) in f(x)=0
changes sign between two
points, more than one root
may exist between the two
points.

x


f(x)
x
u

x
19
General Considerations
Is the function to be evaluated often?
If so you may be able to create an algorithm for the problem.

How much precision is needed?
Engineering calculations are often required for a few significant figures.

How fast and robust must the method be?
If the root finding is embedded in another program that automatically
changes the parameter f(x), it is important that the root finder is robust.
A robust procedure is relatively immune to initial guess and it converges
quickly without being overly sensitive to the behavior of the function.

Is the function a polynomial?
There are special procedures for finding roots of polynomials. These
should be used instead of general procedures such as bisection,
Newtons method or secant method.

Vous aimerez peut-être aussi