Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Experiment Number: 07

Experiment Name: Implementation of Newton’s Backward Interpolation Method on Python.

Objectives:

1. Grasp the concept of approximating functions using polynomial equations derived


from given data points.
2. Master the backward interpolation method formulated by Newton, utilizing backward
differences for function approximation.
3. Develop algorithms to compute backward differences and construct interpolation
tables for accurate function approximation.
4. Analyze the efficiency of Newton's backward interpolation in terms of time and space
complexity compared to other methods
5. Evaluate Newton's backward interpolation against alternative techniques like
Lagrange interpolation to understand its advantages and limitations.

Introduction: Newton's backward difference interpolation method is a numerical technique


utilized to estimate a function by formulating a polynomial that traverses through provided
data points. In this method, backward differences between consecutive data points are
calculated and utilized to derive coefficients for the polynomial. This approach is particularly
advantageous when the data points are equally spaced, streamlining the computation of
backward differences. The resultant polynomial offers an efficient means to interpolate values
within the given data points, rendering it indispensable across diverse engineering, scientific,
and computational domains.

NEWTON’S BACKWARD INTERPOLATION FORMULA:

x−x 0
p=
h

p ( p+1) 2 p( p+1)( p+2) 3 p ( p+1)(p +2)( p+ 3) 4 p ( p+1 ) ( p+ 2 ) … (


y ( x )= y 0 + p ∆ y 0 + . ∆ y 0+ . ∆ y0+ . ∆ y 0 +…+
2! 3! 4! n!
The Backward Difference Table:

Example:

1. Find Solution using Newton's Backward Difference formula

x f (x)

1891 46

1901 66

1911 81

1921 93

1931 101

x=1925

Algorithm for Newton's Backward Difference Interpolation:


1. Define the `u_cal` function to calculate coefficients `u`.

2. Define the `fact` function to compute factorial.

3. Define the number of data points (n) and initialize arrays for independent variable (x) and

dependent variable (y).

4. Populate the arrays `x` and `y` with the given data points.

5. Initialize the backward difference table (y) with the first column values of `y`.

6. Use nested loops to calculate the remaining values of the backward difference table.

7. Display the backward difference table.

8. Specify the value at which interpolation is required (`value`).

9. Initialize the sum with the first value of `y`.

10. Calculate the coefficient 'u' using the formula based on the specified value and the first

data point.

11. Use a loop to iteratively update the sum using the backward differences and 'u'.

12. Print the interpolated value at the specified point (`value`).

13. Optionally, implement error checking to ensure the specified point lies within the range of

the given data points.

14. Optionally, allow the user to choose the degree of the interpolation polynomial for

flexibility.

15. End.

Implement Code:
Output:
Conclusion: Newton's backward difference interpolation in Python is a handy method for
guessing values between given data points. By creating a polynomial that fits the data points
in reverse order, we can make pretty good guesses at values that didn't measure directly. This
method is especially helpful when the data points are evenly spaced out. It's used in lots of
areas like engineering and science for figuring out unknown values or filling in gaps in data.
Learning how to use Newton's backward difference interpolation in Python helps us get better
at estimating values and solving problems with data.

You might also like