Question: (Any help with this python assignment) Write a function called findNearest that takes in three arguments: an array of values the value of a desired

(Any help with this python assignment)

  1. Write a function called findNearest that
    1. takes in three arguments:
      • an array of values
      • the value of a desired interpolation point
      • and the number of nearest point you needed (k).
    2. return a list of the index values of k nearest points. Hint: The numpy.argsort() (Links to an external site.) function and the slicing operator (:) may be helpful. This article on finding the nearest point in an array (Links to an external site.) might be of interest to you as well.
  2. Use your findNearest function to grab the necessary portions of the data arrays above and calculate the polynomial interpolated value at the expected operating point of 351 K. You are welcome to use the Lagrange interpolating function from SciPy (scipy.interpolate.lagrange (Links to an external site.)), or implement a Newton interpolation algorithm as used in the study guide. You code should display a simple table comparing the predicted values for a linear, quadratic, cubic, and quartic polynomial (order 1 through 4). I have provided my table below for you to check your work.
  3. On one plot, show the provided data and the four polynomial interpolation functions. The polynomials should only be plotted over their respective applicable ranges.
  4. Analyze your plot and the interpolation table, and identify what is the most likely value of the thermal conductivity at the operating temperature.

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 Databases Questions!