Question: TEST CODE Problem 4 (5 marks) Write a function interpolation which takes an input parameter y (a Python list or NumPy array of length N)

Problem 4 (5 marks) Write a function interpolation which takes an input  TEST CODE
parameter y (a Python list or NumPy array of length N) and

  

Problem 4 (5 marks) Write a function interpolation which takes an input parameter y (a Python list or NumPy array of length N) and returns a NumPy array c of length len (y) consisting of the coefficients of the unique polynomial p(x) = co + cx + cx + [] # YOUR CODE HERE such that p(n) = yn for each n = 0,..., N - 1. Use the function scipy.linalg.solve to solve the corresponding linear system Ac = y arising form the interpolation equations. The function numpy.vander may be helpful. + Caxa For example, the following code will plot the data y and interpolant polynomial p(x) with coefficients c.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!