Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Bisection method
2. Newton-Raphson method
3. Secant method
4. False-Position methode
5. vim – a text editor
6. File transfer
Bisection Method
x
x
xu
Figure 1 At least one root exists between the two points if the function is
real, continuous, and changes sign.
2/21/2017 502041 - Roots of Equations 4
Basis of Bisection Method
f(x)
x x
xu
x xu
x x
x xu
xu x
x
x
x
xu
Figure 1
x xu
xm =
2
x xm
x
xu
Figure 5 Estimate of xm
2/21/2017 502041 - Roots of Equations 10
Step 3
Now check the following
a 100
m m
new
x m
where
xmold previous estimate of root
xmnew current estimate of root
2/21/2017 502041 - Roots of Equations 12
Step 5
Compare the absolute relative approximate error a with
the pre-specified error tolerance s .
Go to Step 2 using new
Yes upper and lower
Is a s ? guesses.
Hence
f xl f xu f 0 f 0.11 3.993 104 2.662 104 0
So there is at least on root between x and xu, that is between 0 and 0.11
2/21/2017 502041 - Roots of Equations 18
Example 1 Cont.
f xl f xm f 0 f 0.055 3.993 104 6.655 105 0
Hence the root is bracketed between xm and xu, that is, between 0.055
and 0.11. So, the lower and upper limits of the new bracket are
xl 0.055, xu 0.11
At this point, the absolute relative approximate error a cannot be
calculated as we do not have a previous approximation.
Hence the root is bracketed between x and xm, that is, between 0.055
and 0.0825. So, the lower and upper limits of the new bracket are
xl 0.055, xu 0.0825
xmnew xmold
a new
100
xm
0.0825 0.055
100
0.0825
33.333%
None of the significant digits are at least correct in the estimate root of
xm = 0.0825 because the absolute relative approximate error is greater
than 5%.
f xl f xm f 0.055 f 0.06875 6.655 105 5.563 10 5 0
Hence the root is bracketed between x and xm, that is, between 0.055
and 0.06875. So, the lower and upper limits of the new bracket are
xl 0.055, xu 0.06875
xmnew xmold
a new
100
xm
0.06875 0.0825
100
0.06875
20%
Still none of the significant digits are at least correct in the estimated
root of the equation as the absolute relative approximate error is
greater than 5%.
Seven more iterations were conducted and these iterations are shown in
Table 1.
2/21/2017 502041 - Roots of Equations 27
Table 1 Cont.
Table 1 Root of f(x)=0 as function of number of iterations for
bisection method.
Iteration x xu xm a % f(xm)
f x x 2
f x
f(x)
1
x
x
f(xi) x f x
i, i f(xi )
xi 1 = xi -
f (xi )
f(xi-1)
xi+2 xi+1 xi X
AB
f(xi) B tan(
AC
f ( xi )
f ' ( xi )
xi xi 1
C A X f ( xi )
xi 1 xi
f ( xi )
xi+1 xi
xi 1- xi
a = 100
xi 1
f x0
x1 x0
f ' x0
0.05
0.05 0.1650.05 3.993 10 4
3 2
30.05 0.330.05
2
1.118 10 4
0.05
9 10 3
0.05 0.01242
0.06242
0.06242
0.06242 0.1650.06242 3.993 10 4
3 2
30.06242 0.330.06242
2
3.97781 10 7
0.06242
8.90973 10 3
0.06242 4.4646 10 5
0.06238
2 m
The maximum value of m for which a 0.5 10 is 2.844.
Hence, the number of significant digits at least correct in the
answer is 2.
0.06238
0.06238 0.1650.06238 3.993 10 4
3 2
30.06238 0.330.06238
2
4.44 10 11
0.06238
8.91171 10 3
0.06238 4.9822 10 9
0.06238
roots.
f xi a %
Iteration
Number xi 4
–1.0000
3
0 3.00 3
f x sin x 0 0.5
x
Choose 0
x0 2.4 7.539822
-2 0 2 4 6 8 10
-0.06307 0.5499 4.461 7.539822
-0.5
x 2 6.2831853
-1.5
E D A
On rearranging, the secant
xi+1 xi-1 xi
X
method is given as
f ( xi )( xi xi 1 )
Figure 2 Geometrical representation of xi 1 xi
the Secant method. f ( xi ) f ( xi 1 )
66 2/21/2017 502041 - Roots of Equations
Algorithm for Secant Method
f ( xi )( xi xi 1 )
xi 1 xi
f ( xi ) f ( xi 1 )
Find the absolute relative approximate error
xi 1- xi
a = 100
xi 1
Iteration 1
The estimate of the root is
f x0 x0 x1
x1 x0
f x0 f x1
0.05
0.05 0.1650.05 3.993 10 0.05 0.02
3 2 4
0.06461
f x1 x1 x0
x2 x1
f x1 f x0
0.06461
0.06461 0.1650.06461 3.993 10 0.06461 0.05
3 2 4
0.06241
f x2 x2 x1
x3 x2
f x2 f x1
0.06241
0.06241 0.1650.06241 3.993 10 0.06241 0.06461
3 2 4
0.06238
f ( x)
0
f ( x) 0
f ( x)
2 2
10 5 0 5 10
10 x x guess1 x guess2 10
f(x)
prev. guess
new guess f x Sinx 0
Division by zero
f ( x)
f ( x)
0
f ( x) 0
secant( x)
f ( x)
2 2
10 5 0 5 10
10 x x 0 x 1' x x 1 10
f(x)
f x Sinx 0
x'1, (first guess)
x0, (previous guess)
Secant line
x1, (new guess)
Root Jumping
84 2/21/2017 502041 - Roots of Equations
False-Position Method
2/21/2017 http://numericalmethods.eng.usf.edu 85
85 2/21/2017 502041 - Roots of Equations
Introduction
f x
f ( x) 0 (1)
In the Bisection method
f xU
f ( xL ) * f ( xU ) 0 (2)
xL xU
Exact root xr (3)
xL 2
O xr xU x 1
86 f xL
86 Figure 1 False-Position
2/21/2017
Method
502041 - Roots of Equations
False-Position Method
f ( x L ) 0; xr xL 0
f ( xU ) 0; xr xU 0
xU f xL xL f xU
xr (5)
f xL f xU
88 2/21/2017 502041 - Roots of Equations
0.0611 0.0660
a 100 8%
0.0611
Iteration 3
xU f x L x L f xU
xm
f x L f xU
0.0660 1.132 10 5 0.0611 3.1944 10 5
1.132 10 5 3.1944 10 5
0.0624
0.0624 0.0611
a 100 2.05%
0.0624
Iteration xL xU xm a % f xm
1 0.0000 0.1100 0.0660 N/A -3.1944x10-5