Question: Please do all parts in Python 3. Interpolation (a) Write a program to read in a two column table from a file and per- form

Please do all parts in Python
3. Interpolation (a) Write a program to read in a two column table from a file and per- form linear interpolation at an arbitrary point. You may assume that the data is evenly spaced in the independent variable (this makes it easier to determine which points to use for interpolation). (b) Use the program on the following input data: y -1. 0.03846154 -0.5 0.13793103 0. 1. 0.5 0.13793103 1. 0.03846154 and provide a linear estimate of y at x = 0.75. (c) Write a program using Nevilles algorithm to fit a 4th order poly- nomial to the above data and provide an estimate of y at x = 0.75. (See notes on Neville's algorithm, Ch3 in Numerical Recipes book, or e.g. Wikepedia for help.) a 1 = (d) The actual function tabulated above is y (1+25x2): Compare the actual value at x = : 0.75 with the linear interpolation and the 4th order polynomial interpolation, and comment on why one is more accurate than the other. While polynomial interpolation is a reasonable way to proceed when there are a limited number of points as above, when there are a large number of points it can have strange behavior (especially at the end points, called Runge's phenomenon'. As a result, the most popular way to interpolate is with cubic splines
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
