0% found this document useful (0 votes)
33 views1 page

Interpolation

The document discusses linear and polynomial interpolation techniques. It provides 4 problems: 1) write a program for linear interpolation given 3 data points to return y for any x from 1 to 5, exiting if x is outside this range. 2) Generalize the program to take data from a file. 3) Repeat problem 1 using a second order polynomial and compare the results. 4) Plot the polynomial and data points from problem 3.

Uploaded by

prahalad19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Interpolation

The document discusses linear and polynomial interpolation techniques. It provides 4 problems: 1) write a program for linear interpolation given 3 data points to return y for any x from 1 to 5, exiting if x is outside this range. 2) Generalize the program to take data from a file. 3) Repeat problem 1 using a second order polynomial and compare the results. 4) Plot the polynomial and data points from problem 3.

Uploaded by

prahalad19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Interpolation

Linear Interpolation

1. Given the three data points (x,y)= (1.0,8.0), (2.1,20.6) and (5.0,13.7), write a program to return the value of y for any arbitrary x in the range [1.0,5.0]. The program should exit if x is outside this range.

2. Generalize the above program to input data points from a data file points.dat (a sample program to read data from a data file is given here).

Polynomial Interpolation

3. Repeat problem 1. using a second order polynomial. Compare the y values from linear interpolation with those from the second order polynomial. 4. Plot the polynomial and the input data points for problem 3.

You might also like