Bisection Method Lab Report | ENSH 202 – NUMERICAL METHODS
Numerical Methods - Bisection Method

Lab 2: Bisection Method for Non-linear Equations

Lab 2: Solution of Non-linear Equations using Bisection Method

Experiment Information

Experiment: Solution of Non-linear equations using Bisection method

Course Code: ENSH 202 – NUMERICAL METHODS

Description: Complete lab report covering theory, algorithm, Python implementation and analysis of Bisection method

Complete Lab Report PDF

1. Theory of Bisection Method

1.1 Intermediate Value Theorem

1.2 Convergence criteria

1.3 Error analysis

2. Algorithm

2.1 Step-by-step procedure

2.2 Flowchart

2.3 Stopping criteria

3. Implementation

3.1 Python code

3.2 Input/output specifications

3.3 Graphical visualization

4. Observations

4.1 Data recording table

4.2 Sample calculations

5. Results

5.1 Solution approximation

5.2 Convergence rate

5.3 Error analysis

6. Discussion

6.1 Advantages and limitations

6.2 Comparison with other methods

6.3 Applications in engineering

Python Implementation of Bisection Method

bisection_method.py
import matplotlib.pyplot as plt from math import * def f(x): return x*sin(x)+cos(x) a= float(input(“Enter The value of a: “)) b= float(input(“Enter The value of b: “)) d= int(input(“Enter no. of Decimal Precision: “)) e=5*10**(-d-1) A=a B=b n=(log(abs(b-a))-log(e))/log(2) if f(a)*f(b)>0: raise Exception(“ERROR”) elif f(a)*f(b)==0: if f(a)==0 : print(a) if f(b)==0: print(b) else: count=0 c=(a+b)/2 while abs(f(c))>e: if f(c)*f(a)<0: b=c else: a=c c=(a+b)/2 count +=1 if count>2*n: raise Exception(“DISCOUNTINUS FUNCTION”) print(round(c,d)) plt.figure() N=100 h=(B-A)/N xp=[A+i*h for i in range (N+1)] yp=[f(num) for num in xp] plt.plot(xp,yp,color=”green”, label=(“f(x)”)) plt.axhline(0,color=”blue”,linestyle=”–“,label=”X-Axis”) plt.plot(c,0,marker=”o”,linestyle=””,color=”orange”,label=”root”) plt.grid() plt.legend() plt.show() plt.savefig(“root_solution.png”)
×

Disclaimer

The educational materials provided on this website are intended as supplementary resources to support your learning journey. These lab reports are sample documents designed to help students understand proper formatting and content organization.

We have made every effort to ensure the accuracy of the content. However, we recommend students to perform their own experiments and prepare original reports. These samples should be used as references only.

We respect intellectual property rights. If you believe any content should be credited differently or removed, please don’t hesitate to contact us. We’re happy to make appropriate corrections or give proper attribution.

Leave a Comment

Scroll to Top