Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 8

ENCE 203

Prof. Steven A. Gabriel


Spring 2002 Bisection Method Example
f(x)=x^2-4x+3

old old old old


Iteration a b f(a) f(b) T f(T)
0 0.000000 2.900000 3.000000 -0.190000 1.450000 -0.697500
1 0.000000 1.450000 3.000000 -0.697500 0.725000 0.625625
2 0.725000 1.450000 0.625625 -0.697500 1.087500 -0.167344
3 0.725000 1.087500 0.625625 -0.167344 0.906250 0.196289
4 0.906250 1.087500 0.196289 -0.167344 0.996875 0.006260
5 0.996875 1.087500 0.006260 -0.167344 1.042188 -0.082595
6 0.996875 1.042188 0.006260 -0.082595 1.019531 -0.038681
7 0.996875 1.019531 0.006260 -0.038681 1.008203 -0.016339
8 0.996875 1.008203 0.006260 -0.016339 1.002539 -0.005072
9 0.996875 1.002539 0.006260 -0.005072 0.999707 0.000586
10 0.999707 1.002539 0.000586 -0.005072 1.001123 -0.002245

E_a,d n
0.01 8.17990909

Bisection Method
Estimate of Root

1.600000

1.400000

1.200000

1.000000

0.800000

0.600000

0.400000

0.200000

0.000000
0 2 4 6 8 10 12
Iteration
f(x)=x

new new 5

a baru b baru E_a f(a).f(T)


4
0.000000 1.450000 1.450000 -2.092500
0.725000 1.450000 0.725000 1.876875

f(x)
3

0.725000 1.087500 0.362500 -0.104694 2


0.906250 1.087500 0.181250 0.122803
1
0.996875 1.087500 0.090625 0.001229
0.996875 1.042188 0.045312 -0.000517 0

0.996875 1.019531 0.022656 -0.000242 -1


-1
0 1

0.996875 1.008203 0.011328 -0.000102


0.996875 1.002539 0.005664 -0.000032 -2

0.999707 1.002539 0.002832 0.000004


0.999707 1.001123 0.001416 -0.000001

f(x) x_r f(x_r)


0 4.76 1.450 -0.698
0.7884375 3.84 0.725 0.626
0.65703125 3 1.088 -0.167
0.9034179688 2.24 0.906 0.196
1.0389306641 1.56 0.997 0.006
1.0163452148 0.96 1.042 -0.083
1.0050524902 0.44 1.020 -0.039
0.9994061279 0 1.008 -0.016
Method 0.9965829468 -0.36 1.003 -0.005
1.0008297491 -0.64 1.000 0.001
-0.84 1.001 -0.002
-0.96
x -1
-0.4 -0.96
-0.2 -0.84
0 -0.64
0.2 -0.36
0.4 0
0.6 0.44
0.8 0.96
1 1.56
Iteration
6 8 10 12
1.2 2.24
1.4 3
1.6 3.84
1.8
2
2.2
2.4
2.6
2.8
3
3.2
3.4
3.6
3.8
4
4.2
f(x)=x^2-4x+3

4
f(x)

0
-1 0 1 2 3 4 5
-1

x
-2
ENCE 203
Prof. Steven A. Gabriel
Spring 2002 False-Position Example
f(x)=x^2-4x+3
6
old old old old new new
Iteration x_l x_u f(x_l) f(x_u) x_r f(x_r) x_l x_u E_a 5

0 0.000 2.900 3.000 -0.190 2.727 -0.471 0.000 2.727 2.727 4


1 0.000 2.727 3.000 -0.471 2.357 -0.872 0.000 2.357 2.357

f(x)
3
2 0.000 2.357 3.000 -0.872 1.826 -0.970 0.000 1.826 1.826
3 0.000 1.826 3.000 -0.970 1.380 -0.616 0.000 1.380 1.380 2

4 0.000 1.380 3.000 -0.616 1.145 -0.269 0.000 1.145 1.145 1


5 0.000 1.145 3.000 -0.269 1.051 -0.099 0.000 1.051 1.051
6 0.000 1.051 3.000 -0.099 1.017 -0.034 0.000 1.017 1.017 0
-1
7 0.000 1.017 3.000 -0.034 1.006 -0.012 0.000 1.006 1.006 -1

8 0.000 1.006 3.000 -0.012 1.002 -0.004 0.000 1.002 1.002


-2
9 0.000 1.002 3.000 -0.004 1.001 -0.001 0.000 1.001 1.001
10 0.000 1.001 3.000 -0.001 1.000 0.000 0.000 1.000 1.000

E_a,d n False-Position Method


Estimate of Root

0.01 8.179909
3.000

2.500

2.000

1.500

1.000

0.500

0.000
0 2 4 6 8 10 12
Iteration
f(x)=x^2-4x+3

4
f(x)

0
-1 0 1 2 3 4 5
-1

x
-2

x f(x) x_r f(x_r)


-0.4 4.76 2.727 -0.471
-0.2 3.84 2.357 -0.872
0 3 1.826 -0.970
0.2 2.24 1.380 -0.616
0.4 1.56 1.145 -0.269
0.6 0.96 1.051 -0.099
0.8 0.44 1.017 -0.034
1 0 1.006 -0.012
1.2 -0.36 1.002 -0.004
1.4 -0.64 1.001 -0.001
1.6 -0.84 1.000 0.000
1.8 -0.96
2 -1
2.2 -0.96
2.4 -0.84
2.6 -0.64
2.8 -0.36
3 0
3.2 0.44
3.4 0.96
3.6 1.56
3.8 2.24
4 3
4.2 3.84
Bisection Bisection False-Position False-Position
Iteration x_r f(x_r) x_r f(x_r)
0 1.450 -0.698 2.727 -0.471

Estimate of Root
1 0.725 0.626 2.357 -0.872 Bisection vs. False
2 1.088 -0.167 1.826 -0.970
3 0.906 0.196 1.380 -0.616 3.000
4 0.997 0.006 1.145 -0.269
5 1.042 -0.083 1.051 -0.099 2.500
6 1.020 -0.039 1.017 -0.034
7 1.008 -0.016 1.006 -0.012 2.000
8 1.003 -0.005 1.002 -0.004
9 1.000 0.001 1.001 -0.001 1.500
10 1.001 -0.002 1.000 0.000
1.000

0.500

0.000
0 1 2 3 4 5 6 7
Iteration
Bisection vs. False-Position

Bisection
False-Position

1 2 3 4 5 6 7 8 9 10
Iteration

You might also like