Secant Method - Derivation: A. Bracketing Methods

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

9/27/2016

A. Bracketing Methods Secant Method – Derivation


A.1. Bisection Method
A.2. Regula Falsi (False-position Method) The secant method can be derived from geometry:
f(x)
The Geometric Similar Triangles
AB DC

B. Open Methods f(xi) B AE DE
B.1. Newton Raphson's Method can be written as
f ( xi ) f ( xi 1 )
B.2. Secant Method 
C
xi  xi 1 xi 1  xi 1
f(xi-1)

E D A
On rearranging, the secant method
X
xi+1 xi-1 xi is given as

f ( xi )( xi  xi 1 )
Figure 2 Geometrical representation of xi 1  xi 
the Secant method. f ( xi )  f ( xi 1 )
1 2

Step 1
Calculate the next estimate of the root from two initial guesses

f ( xi )( xi  xi 1 )
xi 1  xi 
f ( xi )  f ( xi 1 )
Algorithm for Secant Method
Find the absolute relative approximate error

xi 1- xi
a =  100
xi 1

Step 2 Example 1
You are making a bookshelf to carry books that range from 8 ½ ” to 11” in height
Find if the absolute relative approximate error is greater than and would take 29”of space along length. The material is wood having Young’s
the prespecified relative error tolerance. Modulus 3.667 Msi, thickness 3/8 ” and width 12”. You want to find the maximum
vertical deflection of the bookshelf. The vertical deflection of the shelf is given by

If so, go back to step 1, else stop the algorithm.


v( x)  0.42493 x 10-4 x3  0.13533 x 10-8 x5  0.66722 x 10-6 x 4  0.018507 x
Also check if the number of iterations has exceeded the
maximum number of iterations. where x is the position where the deflection is maximum. Hence to find
dv
the maximum deflection we need to find wheref ( x)   0 and conduct
the second derivative test. dx

1
9/27/2016

Example 1 Cont. Example 1 Cont.


0.02
0.01883
The equation that gives the position x where the deflection is maximum is given by

f( x)  0.67665 x 10-8 x 4  0.26689 x 10-5 x3  0.12748 x 10-3 x 2  0.018507  0


0.01

Books 0
f ( x) 0

0.01
Bookshelf

Figure 2 A loaded bookshelf.


 0.01851 0.02
Use the secant method of finding roots of equations to find the position where 0 5 10 15 20 25 30
the deflection is maximum. Conduct three iterations to estimate the root of the 0
f(x)
x 29

above equation.
Figure 3 Graph of the function f(x).
Find the absolute relative approximate error at the end of each iteration f( x)  0.67665 x 10-8 x 4  0.26689 x 10-5 x3  0.12748 x 10-3 x 2  0.018507  0
7 8

Example 1 Cont. Example 1 Cont.


8.259110 15  10
0.03
0.027
Solution 4
Let us take the initial guesses of the root of f x   0 as x1  10 and x0  15
. x1  15 
Iteration 1 8.259110   8.4956 10 
4 3 0.02

The estimate of the root is  14.557 f ( x)

f ( x)
0.01

f x0 x0  x1 


0
f ( x) 0

x1  x0  secant( x)

f x0   f x1  f ( x) 0.01

f x0   0.67665 108 x04  2.6689 105 x03  0.12748 103 x02  0.018507 0.02

 0.67665 108 15  2.6689 105 15  0.12748 103 15  0.018507
4 3 2  0.027 0.03
0 5 10 15 20 25 30
0 x x 0  x 1'  x x 1 29

 8.2591104
f(x)
x'1, (first guess)
x0, (previous guess)

f x1   0.67665 10 x  2.6689 10 x  0.12748 10 x  0.018507


Secant line
8 4 5 3 3 2 x1, (new guess)
1 1 1

 0.67665 108 10  2.6689 105 10  0.12748 103 10  0.018507
4 3 2
Figure 4 Graph of the estimated
3 root after Iteration 1.
 8.4956 10 9 10

Example 1 Cont. Example 1 Cont.


Iteration 2
The absolute relative approximate error a at the end of Iteration 1 is The estimate of the root is
x1  x0 f x1 x1  x0 
x2  x1 
a 
x1
100 f x1   f x0 
14.557  15 f x1   0.67665 108 x14  2.6689 105 x13  0.12748 103 x12  0.018507
 100
 0.67665 108 14.557   2.6689 105 14.557   0.12748 103 14.557   0.018507
4 3 2
14.557
5
 3.0433 %  2.9870 10

x2  15 
 2.9870 10 14.557  15 5

 2.9870 10  8.259110  5 4

 14.572

12

2
9/27/2016

Example 1 Cont. Example 1 Cont.


Iteration 3
The absolute relative approximate error a at the end of Iteration 2 is
The estimate of the root is
f x2 x2  x1 
x2  x1 x3  x2 
a  100 f x2   f x1 
x2
f x2   0.67665 108 x24  2.6689 105 x23  0.12748 103 x22  0.018507
14.572  14.557
 100  0.67665 108 14.572  2.6689 105 14.572  0.12748 103 14.572  0.018507
4 3 2
14.572
 0.10611 %  6.0676 109

x2  14.572 
 6.0676 10 14.572  14.557
9

 6.0676 10   2.9870 10 


9 5

 14.572

13 14

Advantages
Example 1 Cont.
The absolute relative approximate error a at the end of Iteration 3 is

x2  x1 • Converges fast, if it converges


a  100
x2
• Requires two guesses that do not need to bracket
14.572  14.572 the root
 100
14.572
 2.1559 10 5%

15

Determine the roots of f(x)=-12-21x+18x2-2.75x3 Newton-Raphson Method


using secant method. Use the stopping criterion of
1%.  This method is more efficient than the Bisection and
Iteration methods.
If
 x is the real root and x0 is an initial approximation of
the real root of an equation f(x) = 0,
 f ´(x0) ≠ 0,
 f(x) has the same sign between x0 and x,

Then, the tangent at f(x0) can lead to the real root x.

3
9/27/2016

Newton-Raphson Method: Geometric Significance Newton-Raphson Method: Geometric Significance


Here,
f(x0)  The slope at x0 is tan (PTM) P
 tan (PTM) = PM/TM
 tan (PTM) = f (x0)/h
 Again, tan (PTM) = f ´(x0)
tangent at f(x0)  Therefore, f ´(x0) = f (x0)/h
 Or, h = f (x0)/ f ´(x0) M
T
 x1 = x0 – h
 Therefore, x1 = x0 – f (x0)/ f ´(x0)
 Similarly, x2 = x1 – f (x1)/ f ´(x1)

The initial guess

f(x1)

Newton-Raphson Method Newton-Raphson Method (Cont’d.)


Methodology  A better approximation than x0 is therefore given by x1 where
 Let x0 be an approximate root of f(x) = 0 and
f ( x0 )
 Let, x1 is the correct root such that x1 = x0 + h and f(x1) = 0. x1  x0  h  x0 
 Expanding f(x0+h) by Taylor’s series, we obtain, f ( x0 )
 Successive approximation are given by x2, x3, ….., xn, xn+1 where
h2
f ( x0 )  hf ( x0 )  f ( x0 )  ...  0
2! f ( xn )
xn 1  xn 
f ( xn )
 Neglecting the second and higher order derivatives, we have This formula is known as the Newton-Raphson formula.
f ( x0 )  hf ( x0 )  0
 Which gives
f ( x0 )
h
f ( x0 )

Newton-Raphson Method: Example Newton-Raphson Method: Example

Find the real root of the equation using Newton- Find the real root of the equation using Newton-
Raphson’s Method Raphson’s Method
f(x)= x3 + 4x2 – 1= 0 f(x)= x3 + 4x2 – 1= 0, f′(x) = 3x2 + 4*2x - 0
x  4x 1
3 2
f ( xn )
xn1  xn   xn  n 2 n
f ( xn ) 3xn  8 x

x0 0.5
x1 0.473684211
x2 0.472834787
x3 0.472833909
x4 0.472833909

4
9/27/2016

Determine the root of the function f(x)= 2x4+3x3-4x2-3x+2=0


using Newton Raphson with xo=0 and e<1%.

Application of Numerical Methods

The flow rate in a pipe system connecting two reservoirs Newton-Raphson Method: Example
(at different surface elevations) depends on the
characteristics of the pump, the roughness of the pipe,
Class work
the length and diameter of the pipe and the specific
1. Use Newton-Raphson’s Method to find a root of the
gravity of the fluid. For an 800 ft section of 6 in. pipe
equation correct to 2 decimal places.(=0.01)
connecting two reservoirs (with a 5 ft differential in
elevation) containing oil of specific gravity 0.8, with a 6 x3 – 2x – 5 = 0
hp pump, the equation for the flow rate Q is
2. UseNewton-Raphson’s Method to find a root of
the equation correct to 2 decimal places.(=0.01)
12Q3+5Q-40=0 x sin x = - cos x
Approximate the real root of the equation in the interval
0≤Q ≤ 2

You might also like