Secant Method
description
Transcript of Secant Method
![Page 1: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/1.jpg)
04/22/23http://
numericalmethods.eng.usf.edu 1
Secant Method
Civil Engineering Majors
Authors: Autar Kaw, Jai Paul
http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM
Undergraduates
![Page 2: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/2.jpg)
Secant Method
http://numericalmethods.eng.usf.edu
![Page 3: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/3.jpg)
http://numericalmethods.eng.usf.edu3
Secant Method – Derivation
)(xf)f(x - = xx
i
iii 1
f ( x )
f ( x i )
f ( x i - 1 )
x i + 2 x i + 1 x i X
ii xfx ,
1
1 )()()(
ii
iii xx
xfxfxf
)()())((
1
11
ii
iiiii xfxf
xxxfxx
Newton’s Method
Approximate the derivative
Substituting Equation (2) into Equation (1) gives the Secant method
(1)
(2)
Figure 1 Geometrical illustration of the Newton-Raphson method.
![Page 4: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/4.jpg)
http://numericalmethods.eng.usf.edu4
Secant Method – Derivation
)()())((
1
11
ii
iiiii xfxf
xxxfxx
The Geometric Similar Triangles
f(x)
f(xi)
f(xi-1)
xi+1 xi-1 xi X
B
C
E D A
11
1
1
)()(
ii
i
ii
i
xxxf
xxxf
DEDC
AEAB
Figure 2 Geometrical representation of the Secant method.
The secant method can also be derived from geometry:
can be written as
On rearranging, the secant method is given as
![Page 5: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/5.jpg)
http://numericalmethods.eng.usf.edu5
Algorithm for Secant Method
![Page 6: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/6.jpg)
http://numericalmethods.eng.usf.edu6
Step 1
0101
1 x
- xx = i
iia
Calculate the next estimate of the root from two initial guesses
Find the absolute relative approximate error)()())((
1
11
ii
iiiii xfxf
xxxfxx
![Page 7: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/7.jpg)
http://numericalmethods.eng.usf.edu7
Step 2Find if the absolute relative approximate error is greater than the prespecified relative error tolerance.
If so, go back to step 1, else stop the algorithm.
Also check if the number of iterations has exceeded the maximum number of iterations.
![Page 8: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/8.jpg)
http://numericalmethods.eng.usf.edu8
Example 1 You are making a bookshelf to carry books that range from 8 ½ ” to 11” in height and would take 29”of space along length. The material is wood having Young’s 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
xxxxxv 018507.010 x 66722.010 x 13533.010 x 42493.0)( 4-65-83-4
where x is the position where the deflection is maximum. Hence to findthe maximum deflection we need to find where and conduct the second derivative test.
0)( dxdvxf
![Page 9: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/9.jpg)
http://numericalmethods.eng.usf.edu9
Example 1 Cont.The equation that gives the position x where the deflection is maximum is given by
Use the secant method of finding roots of equations to find the position where the deflection is maximum. Conduct three iterations to estimate the root of the above equation. Find the absolute relative approximate error at the end of each iteration and the number of significant digits at least correct at the end of each iteration.
0018507.010x 12748.010 x 26689.010x 67665.0)f( 2-33-54-8 x xx x
Books
Bookshelf
Figure 2 A loaded bookshelf.
![Page 10: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/10.jpg)
http://numericalmethods.eng.usf.edu10
Example 1 Cont.
0018507.010x 12748.010 x 26689.010x 67665.0)f( 2-33-54-8 x xx x
Figure 3 Graph of the function f(x).
0 5 10 15 20 25 300.02
0.01
0
0.01
0.02
f(x)
0.01883
0.01851
0f x( )
290 x
![Page 11: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/11.jpg)
http://numericalmethods.eng.usf.edu11
Example 1 Cont.Let us take the initial guesses of the root of as and .Iteration 1The estimate of the root is
0xf 101 x 150 x
4
233548
20
330
540
80
102591.8
018507.0151012748.015106689.2151067665.0
018507.01012748.0106689.21067665.0
xxxxf
10
10001
xfxfxxxfxx
3
233548
21
331
541
81
104956.8
018507.0101012748.010106689.2101067665.0
018507.01012748.0106689.21067665.0
xxxxf
Solution
![Page 12: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/12.jpg)
http://numericalmethods.eng.usf.edu12
Example 1 Cont.
Figure 4 Graph of the estimated root after Iteration 1.
557.14104956.8102591.8
1015102591.815 34
4
1
x
0 5 10 15 20 25 300.03
0.02
0.01
0
0.01
0.02
0.03
f(x)x'1, (first guess)x0, (previous guess)Secant linex1, (new guess)
0.027
0.027
0
f x( )
f x( )
f x( )
secant x( )
f x( )
290 x x 0 x 1' x x 1
![Page 13: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/13.jpg)
http://numericalmethods.eng.usf.edu13
Example 1 Cont.The absolute relative approximate error at the end of Iteration 1 is
a
% 0433.3
100557.14
15557.14
1001
01
x
xxa
The number of significant digits at least correct is 1, because the absolute relative approximate error is less than 5%.
![Page 14: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/14.jpg)
http://numericalmethods.eng.usf.edu14
Example 1 Cont.Iteration 2The estimate of the root is
5
233548
21
331
541
81
109870.2
018507.0557.141012748.0557.14106689.2557.141067665.0
018507.01012748.0106689.21067665.0
xxxxf
01
01112 xfxf
xxxfxx
572.14102591.8109870.215557.14109870.215 45
5
2
x
![Page 15: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/15.jpg)
http://numericalmethods.eng.usf.edu15
Example 1 Cont.
Figure 5 Graph of the estimate root after Iteration 2.
0 5 10 15 20 25 300.03
0.02
0.01
0
0.01
0.02
0.03
f(x)x1 (guess)x0 (previous guess)Secant linex2 (new guess)
0.028
0.028
0
f x( )
f x( )
f x( )
secant x( )
f x( )
290 x x 1 x 0 x x 2
![Page 16: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/16.jpg)
http://numericalmethods.eng.usf.edu16
Example 1 Cont.The absolute relative approximate error at the end of Iteration 2 is
a
% 10611.0
100572.14
557.14572.14
1002
12
x
xxa
The number of significant digits at least correct is 2, because the absolute relative approximate error is less than 0.5%.
![Page 17: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/17.jpg)
http://numericalmethods.eng.usf.edu17
Example 1 Cont.Iteration 3The estimate of the root is
9
233548
22
332
542
82
100676.6
018507.0572.141012748.0572.14106689.2572.141067665.0
018507.01012748.0106689.21067665.0
xxxxf
12
12223 xfxf
xxxfxx
572.14109870.2100676.6557.14572.14100676.6572.14 59
9
2
x
![Page 18: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/18.jpg)
http://numericalmethods.eng.usf.edu18
Example 1 Cont.
Figure 6 Graph of the estimate root after Iteration 3.
Entered function along given interval with current and next root and the tangent line of the curve at the current root
0 5.8 11.6 17.4 23.2 290.03
0.02
0.01
0
0.01
0.02
0.03
f(x)x2 (guess)x1 (previous guess)Secant linex3 (new guess)
0.028
0.028
0
f x( )
f x( )
f x( )
secant x( )
f x( )
290 x x 2 x 1 x x 3
![Page 19: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/19.jpg)
http://numericalmethods.eng.usf.edu19
Example 1 Cont.The absolute relative approximate error at the end of Iteration 3 is
a
%102.1559
100572.14
572.14572.14
100
5
2
12
x
xxa
The number of significant digits at least correct is 6, because the absolute relative approximate error is less than 0.00005%.
![Page 20: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/20.jpg)
http://numericalmethods.eng.usf.edu20
Advantages
Converges fast, if it converges Requires two guesses that do not need
to bracket the root
![Page 21: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/21.jpg)
http://numericalmethods.eng.usf.edu21
Drawbacks
Division by zero
10 5 0 5 102
1
0
1
2
f(x)prev. guessnew guess
2
2
0f x( )
f x( )
f x( )
1010 x x guess1 x guess2
0 xSinxf
![Page 22: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/22.jpg)
http://numericalmethods.eng.usf.edu22
Drawbacks (continued)
Root Jumping
10 5 0 5 102
1
0
1
2
f(x)x'1, (first guess)x0, (previous guess)Secant linex1, (new guess)
2
2
0
f x( )
f x( )
f x( )
secant x( )
f x( )
1010 x x 0 x 1' x x 1
0Sinxxf
![Page 23: Secant Method](https://reader036.fdocuments.in/reader036/viewer/2022081422/56815e61550346895dccddf1/html5/thumbnails/23.jpg)
Additional ResourcesFor all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit
http://numericalmethods.eng.usf.edu/topics/secant_method.html