Click to add title

advertisement
Numerical
Analysis
Lecture 8
Chapter 2
Solution of
Non-Linear
Equations
Introduction
Bisection Method
Regula-Falsi Method
Method of iteration
Newton - Raphson Method
Secant Method
Muller’s Method
Graeffe’s Root Squaring
Method
Muller’s
Method
Suppose, xi 2 , xi 1 , xi
be any three distinct
approximations to a root
of f (x) = 0.
f ( xi 2 )  fi 2 , f ( xi 1 )  fi 1
f ( xi )  fi .
Noting that any three distinct
points in the (x, y)-plane
uniquely, determine a
polynomial of second degree.
A general polynomial of
second degree is given by
f ( x)  ax  bx  c
2
Suppose, it passes through the points
( xi 2 , fi 2 ), ( xi 1 , fi 1 ), ( xi , fi )
then the following equations will
be satisfied
2
i 2
ax
 bxi 2  c  fi 2
ax  bxi 1  c  fi 1
ax  bxi  c  fi
2
i 1
2
i
Fig: Quadratic polynomial.
Eliminating a, b, c, we obtain
2
x
1
2
i2
2
i 1
2
i
xi  2
xi 1
1
1
xi
1
x
x
x
x
f
fi 2
0
f i 1
fi
which can be written as
( x  xi 1 )( x  xi )
f 
fi 2
( xi 2  xi 1 )
( x  xi 2 )( x  xi )

fi 1
( xi 1  xi  2 )( xi 1  xi )
( x  xi  2 )( x  xi 1 )

fi
( xi  xi  2 )( xi  xi 1 )
That was a second degree
polynomial.
Now, introducing the notation
h  x  xi ,
hi  xi  xi 1 ,
hi 1  xi 1  xi 2
The above equation can be written as
The above equation can be written as
(h  hi )h
f 
fi 2
hi 1 (hi 1  hi )
(h  hi  hi 1 )h

fi 1
(hi 1 )(hi )
(h  hi  hi 1 )(h  hi )

fi
(hi  hi 1 )hi
We further define
x  xi
h


hi
xi  xi 1
hi
i 
hi 1
i  1  i
With these substitution we
get a simplified Equation as
f 
1
i
[ (  1) f i  2
2
i
 (  1   )i i fi 1
1
i
 (  1   )i fi ]
1
i
Or
f   ( f i  2   f i 1i i  fi i )
2
2
i
 [ f i  2   f 
2
i
 fi (i   i )]
2
i 1 i
1
i
 fi
1
i
To compute  ,set f = 0, we obtain
i ( fi 2i  fi 1i  fi )  gi   i fi  0
2
where
gi  fi 2i2  fi 1i2  fi (i  i )
A direct solution will lead to loss of
accuracy and therefore to obtain
max accuracy we rewrite as:
f i i
gi

 i ( f i  2 i  f i 1 i  fi )  0
2


so that,
 gi  [ gi2  4 fi i i ( fi 2i  fi 1 i  fi )]1/ 2

2 fi  i
or 
1
2 fi i

gi  [ gi2  4 fi i i ( fi 2i  fi 1 i  fi )]1/ 2
Here, the positive sign must be so
chosen that the denominator becomes
largest in magnitude.
we can get a better
approximation to the root, by
using
xi 1  xi  hi 
Example
Do two iterations of Muller’s
method to solve
x  3x  1  0
3
starting with
x0  0.5, x2  0, x1  1
Solution
f ( x0 )  f0  (0.5)  3(0.5) 1  0.375
3
f ( x1 )  f1  (1)  3(1) 1  1
3
f ( x2 )  f2  0  3 0 1  1
c  f0  0.375 h1  x1  x0  0.5
h2  x0  x2  0.5
h2 f1  (h1  h2 ) f 0  h1 f 2
a
h1h2 (h1  h2 )
(0.5)( 1)  ( 0.375)  (0.5)

 1.5
0.25
f1  f 0  ah
b
 2
h1
2
1
 x  x0 
 0.5 
2c
b 
2 
b 2  4ac
2(0.375)
4  4(1.5)(0.375)
0.75
 0.5 
 0.33333 0.5
2  4  2.25
Take
x2  0, x0  0.33333, x1  0.5
h1  x1  x0  0.16667, h2  x0  x2  0.33333
c  f 0  f (0.33333)
 x  3 x0  1  0.037046
3
0
f1  x  3x1  1  0.375
3
1
f 2  x  3x2  1  1
3
2
h2 f1  (h1  h2 ) f 0  h1 f 2
0.023148
a

h1h2 (h1  h2 )
0.027778
= 0.8333
f1  f 0  ah
b
 2.6
h1
2
1
x  x0 
2c
b  b  4ac
0.074092
 0.333333 
5.2236
 0.3475 0.33333  x0
2
For third iteration take,
x2  0.333333,
x0  0.3475,
x1  0.5
Graeffe’s Root
Squaring
Method
GRAEFFE’S ROOT SQUARING
METHOD is particularly
attractive for finding all the
roots of a polynomial equation.
Consider a polynomial of third
degree
f ( x)  a0  a1x  a2 x  a3 x
2
3
f ( x)  a0  a1x  a2 x  a3 x
2
3
f ( x)  a0  a1x  a2 x  a3 x
2
3
f ( x) f ( x)  a x  (a  2a1a3 ) x
2 6
3
2
2
(a  2a0 a2 ) x  a
2
1
2
2
0
f ( x) f ( x)  a t  (a  2a1a3 )t
2 3
3
2
2
(a  2a0 a2 )t  a
2
1
2
0
2
4
The roots of this equation are
squares or 2i (i = 1), powers of the
original roots. Here i = 1 indicates
that squaring is done once.
The same equation can again be
squared and this squaring process
is repeated as many times as
required. After each squaring, the
coefficients become large and
overflow is possible as i increases.
Suppose, we have squared the
given polynomial ‘i’ times, then
we can estimate the value of the
roots by evaluating 2i root of
ai
,
ai 1
i  1, 2,
,n
where n is the degree of the
given polynomial.
The proper sign of each
root can be determined
by recalling the original
equation. This method
fails, when the roots of
the given polynomial are
repeated.
Example
Using Graeffe root
squaring method, find all
the roots of the equation
x  6 x  11x  6  0
3
2
Solution
Using Graeffe root squaring
method, the first three squared
polynomials are as under:
For i = 1, the polynomial is
x  (36  22) x  (121  72) x  36
3
2
 x  14 x  49 x  36
3
2
For i = 2, the polynomial is
x  (196  98) x  (2401  1008) x  1296
3
2
 x  98x  1393x  1296
3
2
For i = 3, the polynomial is
x  (9604  2786) x  (1940449  254016) x 1679616
3
2
 x3  6818x2  16864333x 1679616
The roots of polynomial are
36
 0.85714,
49
49
 1.8708,
14
14
 3.7417
1
Similarly, the roots of polynomial (2) are
1296
4
 0.9821,
1393
1393
4
 1.9417,
98
4
98
 3.1464
1
Still better estimates of the roots
obtained from polynomial (3) are
8
1679616
 0.99949,
1686433
8
1686433
 1.99143,
6818
8
6818
 3.0144
1
The exact values of the
roots of the given
polynomial are 1, 2 and 3.
Numerical
Analysis
Lecture 8
Revision Example
Obtain the Newton-Raphson
extended formula
2
f ( x0 ) 1 [ f ( x0 )]

x1  x0 

f
(
x
)
0
3
f ( x0 ) 2 [ f ( x0 )]
for finding the root of the
equation f (x) = 0.
Solution
Expanding f (x) by Taylor’s series, in the
neighborhood of x0, we obtain after
retaining the first order term only
0  f ( x)  f ( x0 )  ( x  x0 ) f ( x0 ) 
Which gives
f ( x0 )
x  x0 
f ( x0 )
This is the first approximation to the root.
Therefore,
f ( x0 )
x1  x0 
f ( x0 )
Expanding f (x) by Taylor’s
series and retaining up to
second order term,
0  f ( x)  f ( x0 )  ( x  x0 ) f ( x0 )
( x  x0 )

f ( x0 )
2
2
Therefore,
f ( x1 )  f ( x0 )  ( x1  x0 ) f ( x0 )
( x1  x0 )

f ( x0 )  0
2
2
This can also be written as
2
1 [ f ( x0 )]
f ( x0 )  ( x1  x0 ) f ( x0 ) 
f ( x0 )  0
2
2 [ f ( x0 )]
Thus, the Newton-Raphson extended
formula is given by
f ( x0 ) 1 [ f ( x0 )]2

x1  x0 

f
( x0 )
3
f ( x0 ) 2 [ f ( x0 )]
This is also known as Chebyshev’s formula
of third order
Numerical
Analysis
Lecture 8
Download