|
Practical work #2. Bisection (or Bolzano) method
This method is based on the repeated application of intermediate value property.
Let the function f (x) be continuous between a and b. For definiteness, let f (a) be (–)ve and f (b) be (+)ve. Then the first approximation to the root is x 1 = (a + b).
If f (x 1) = 0, then x 1 is a root of f (x) = 0, otherwise, the root lies between a and x 1 or x 1 and b according to f (x 1) is (+)ve or (–)ve. Then we bisect the interval as before and continue the process until the root is found to the desired accuracy.
In the adjoining figure, f (x 1) is (+)ve so that the root lies between a and x 1. The second approximation to the root is x 2 = (a + x 1). If f (x 2) is (–)ve the root lies between x 1 and x 2. The third approximation to the root is x 3 =
(x 1 + x 2), and so on.
FLOW-CHART
Example. Find the real root of the equation x log10 x = 1.2 by Bisection method correct to four decimal places. Also write its program in C-language.
Sol. f (x) = x log10 x – 1.2
Since f (2.74) = –.000563 i.e., (–)ve
and f (2.75) =.0081649 i.e., (+)ve
Hence, the root lies between 2.74 and 2.75.
∴ First approximation to the root is
Now f (x 1) = f (2.745) =.003798 i.e., (+)ve
Hence, the root lies between 2.74 and 2.745.
∴ Second approximation to the root is
Now f (x 2) = f (2.7425) =.001617 i.e., (+)ve
Hence, the root lies between 2.74 and 2.7425.
∴ Third approximation to the root is
=2.74125
Now f (x 3) = f (2.74125) =.0005267 i.e., (+)ve
Hence, the root lies between 2.74 and 2.74125.
∴ Fourth approximation to the root is
Now f (x 4) = f (2.740625) = –.00001839 i.e., (–)ve.
Hence, the root lies between 2.740625 and 2.74125.
∴ Fifth approximation to the root is
Now f (x 5) = f (2.7409375) =.000254 i.e., (+)ve
Hence, the root lies between 2.740625 and 2.7409375.
∴ Sixth approximation to the root is
Now f (x 6) = f (2.74078125) =.0001178 i.e., (+)ve
Hence, the root lies between 2.740625 and 2.74078125.
∴ Seventh approximation to the root is
Now f (x 7) = f (2.740703125) =.00004973 i.e., (+)ve
Hence, the root lies between 2.740625 and 2.740703125
∴ Eighth approximation to the root is
Now f (x 8) = f (2.740664063) =.00001567 i.e., (+)ve
Hence, the root lies between 2.740625 and 2.740664063.
∴ Nineth approximation to the root is
Since x 8 and x 9 are the same up to four decimal places, the approximate real root is 2.7406. C-program for above problem is given below:
Дата добавления: 2015-09-10; просмотров: 250 | Поможем написать вашу работу | Нарушение авторских прав |