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

Lab 2: Secant Method for Non-linear Equations

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

Experiment Information

Experiment: Solution of Non-linear equations using Secant method

Course Code: ENSH 202 – NUMERICAL METHODS

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

Complete Lab Report PDF

1. Theory of Secant Method

1.1 Mathematical derivation

1.2 Convergence criteria

1.3 Error analysis and order of convergence

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 Comparison with Newton-Raphson method

4. Observations

4.1 Data recording table

4.2 Sample calculations

4.3 Convergence behavior

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 problems

Python Implementation of Secant Method

secant_method.py
from math import *
import matplotlib.pyplot as plt
def f(x):
    return f
def secant(f,a,b,tol=5e-9,MaxItr=50):
    count=0
    while True:
        count+=1
        if count>MaxItr or abs(f(b)-f(a)) < tol:
            return None
        c=(a*f(b)-b*f(a))/(f(b)-f(a))
        a,b=b,c
        if abs(f(c)) < tol:
            return c
f=lambda x:x**3+3*x**2-5
a=float(input("Enter the value of a:"))
b=float(input("Enter the value of b:"))

sol=float(secant(f,a,b))
print("The Solution is :",round(sol,6))

        
×

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