Sei sulla pagina 1di 1

The Bisection Algorithm Enter your choices for left boundary and right boundary in the boxes to the

Enter your choices for left boundary and right boundary in the boxes to the lower left. If a single solution exists
between the boundaries the worksheet will indicate with "OK". If either no solutions or multiple solutions exist
This simulation will use the bisection algorithm to the worksheet will state it. Use the graph below to determine a better intial choice for boundaries.
determine the solution for ex = 2x + 5. The user will Function: x^3 -3x+1= 0
enter an initial value (guess) for both the left bound
and the right bound. Excel will determine if a solution Enter Left Boundary: 1
exists, and use the Bisection Algorithm to numerically
approximate the solution by solving ex -2x - 5 = 0. Either no solutions or multiple solutions between left and right bounds.
Enter Right Boundary: 2

‫ذ‬
Graph 1: Initial Boundaries
n a b f[a] f[b] x f[x] 3.5
1 1 2 -1.0000 3.0000 1.0000 -1
2 1.5 2 -0.1250 3.0000 1.0526 -0.991543957 3
3 1.5 1.75 -0.1250 1.1094 1.1053 -0.965592652
4 1.5 1.625 -0.1250 0.4160 1.1579 -0.921271322 2.5
5 1.5 1.5625 -0.1250 0.1272 1.2105 -0.857705205
6 1.53125 1.5625 -0.0034 0.1272 1.2632 -0.774019536 2
7 1.53125 1.546875 -0.0034 0.0608 1.3158 -0.669339554
8 1.53125 1.5390625 -0.0034 0.0284 1.3684 -0.542790494 1.5
9 1.53125 1.5351563 -0.0034 0.0124 1.4211 -0.393497594
10 1.53125 1.5332031 -0.0034 0.0045 1.4737 -0.220586091 1
11 1.53125 1.5322266 -0.0034 0.0006 1.5263 -0.023181222
12 1.5317383 1.5322266 -0.0014 0.0006 1.5789 0.199591777 0.5
13 1.5319824 1.5322266 -0.0004 0.0006 1.6316 0.448607669
14 1.5319824 1.5321045 -0.0004 0.0001 1.6842 0.724741216 0
0.8000 1.0000 1.2000 1.4000 1.6000 1.8000 2.0000 2.2000
15 1.5320435 1.5321045 -0.0002 0.0001 1.7368 1.028867182
-0.5
16 1.532074 1.5321045 -0.0001 0.0001 1.7895 1.361860329
17 1.532074 1.5320892 -0.0001 0.0000 1.8421 1.724595422
-1
18 1.5320816 1.5320892 0.0000 0.0000 1.8947 2.117947223
19 1.5320854 1.5320892 0.0000 0.0000 1.9474 2.542790494
-1.5
20 1.5320873 1.5320892 0.0000 0.0000 2.0000 3

The bisection method checks the two initial boundary 'guesses' in


order to determine if a solution exists between them. If the product Graph 2: Boundaries after 20 iterations
of f(a)*f(b) < 0 at least one solution exists between the two values. If
f(a)*f(b) > 0 the function either doesn't cross the x-axis (no solutions) x f[x] -3.43634
or it crosses the axis more than once (multiple solutions). Graph 1 can 1.5320873 -3.436348121 1.5320872 1.5320874 1.5320876 1.5320878 1.532088 1.5320882 1.5320884 1.5320886 1.5320888 1.532089 1.5320892 1.5320894
be used to determine better left and right boundaries. 1.5320875 -3.43634762 -3.436341
1.5320877 -3.436347119 -3.436342
Once appropriate boundary values are entered the bisection algorithm
will determine the midpoint between the initial boundaries, m. The 1.5320879 -3.436346618
products of f(a)f(m) and f(b)f(m) are used to determine in which 1.5320881 -3.436346117 -3.436343
interval the solution exists. The process of using the midpoint to 1.5320883 -3.436345615
narrow the interval continues until 20 iterations are carried out. -3.436344
1.5320885 -3.436345114
Graph 2 shows the boundaries of the final iteration and the value at 1.5320887 -3.436344613 -3.436345
which the function crosses the x-axis. This graph allows for an accurate 1.5320889 -3.436344112
determination of the solution. 1.532089 -3.436343611 -3.436346
1.5320892 -3.436343109
-3.436347

-3.436348

Solution: 1.53208828 -3.436349

Potrebbero piacerti anche