Lagrange Interpolation Method | Numerical Methods Lab
Numerical Methods - Lagrange Interpolation

Lab 3: Lagrange Interpolation Method

Lab 3: Lagrange Polynomial Interpolation Method

Experiment Information

Experiment: Lagrange Interpolation Method

Course Code: Numerical Methods

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

Complete Lab Report PDF

1. Theory of Lagrange Interpolation

1.1 Mathematical formulation of Lagrange polynomial

1.2 Basis polynomials derivation

1.3 Error analysis and Runge’s phenomenon

2. Algorithm

2.1 Step-by-step procedure for interpolation

2.2 Computational complexity analysis

2.3 Comparison with Newton’s divided difference

3. Implementation

3.1 Python code with numpy

3.2 Input/output specifications

3.3 Visualization of interpolating polynomial

4. Observations

4.1 Data recording table

4.2 Sample calculations

4.3 Effect of number of points

5. Results

5.1 Interpolated value accuracy

5.2 Error analysis

5.3 Graphical results

6. Discussion

6.1 Advantages and limitations

6.2 Comparison with other interpolation methods

6.3 Applications in engineering problems

Python Implementation of Lagrange Interpolation

lagrange_interpolation.py
import numpy as np

# Known data points
x = np.array([1,2,3,4,5])
y = np.array([1,4,9,16,25])

# Point to interpolate
xp = 3.25

# Perform Lagrange interpolation
n = len(x)
yp = 0.0

for i in range(n):
    # Calculate the Lagrange basis polynomial L_i(xp)
    L_i = 1.0
    for j in range(n):
        if i != j:
            L_i *= (xp - x[j]) / (x[i] - x[j])
    
    # Add the contribution of L_i(xp) * y[i] to the result
    yp += L_i * y[i]

print("The value of Yp is", yp)
        
×

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