You are on page 1of 5

PREMIER UNIVERSITY, CHITTANGONG

Department of Computer Science &


Engineering

Report
Course Title :Computational Method for Experiment No : 01

Engineering Problem Experiment Name : Implementing


Laboratory. Bi-Section Method

Course Code : CSE – 302 Date of Performance : 06 – 08 – 2022


Gmail :robiulhosenpuc@mail.com Date of Submission : 02 – 09 - 2022
Mobile :01617-703090

SUBMITTED BY

Name : Robiul Hosen

Id : 190371020-1995

Year : 2022

Semester : 5th

Section : B2

Batch : 37th

Remarks:
Report No: 01

Report Name: Implementation of Bi-section Method .

Tools:

 Google Colab
 Matlab

Objective:

1. follow the algorithm of the bisection method of solving a nonlinear equation,


2. use the bisection method to solve examples of finding roots of a nonlinear equation, and
3. Enumerate the advantages and disadvantages of the bisection method.

Algorithm:

1. Start

2. Read y, a, b, e

3. Compute: f1 = f(a) and f2 = f(b)

4. If (f1*f2) > 0, then display initial guesses are wrong and goto (11).

Otherwise, continue.

5. x = (a + b)/2

6. If ([ (a – b)/ x] < e), then display x and goto (11).

7. Else, f = f(x)

8. If ((f*f1) > 0), then x1 = x and f1 = f.

9. Else, b = x and f2 = f.

10. Goto (5).

11. Stop
Source Code:

Output:
Source Code:

Output:
Discussion:
In this section I discussed the general problem of root finding and one specific method:
bisection. The clear advantage of this method is that, if properly implemented and applied to a
right object, it is doomed to succeed. Why would we need something else? The truth to be told:
this method is ridiculously slow, especially if one needs to solve thousands of problems with
high degree of accuracy. In the next section I will introduce a few other methods, which you will
analyze using Python. As a piece of advice, however, I would like to finish this section with the
following sentiment: If in your actual activity you need to solve just one specific equation f(x) =
0 and you surely know that the root you are looking for is within certain a and b then use
bisection, its elementary character and slow convergence notwithstanding. It will always lead
you in the right direction, slowly yet unavoidably.

You might also like