Question: Interpolation A. Write two python functions. The first should implement the function: The second should take a set of exact dataponts, , and a set
Interpolation
A.
Write two python functions. The first should implement the function:
The second should take a set of exact dataponts, , and a set of interpolated datapoints , and compute the root mean square error by:
B.
Write a python program that uses the above functions to interpolate between the values of sampled uniformly at points in the interval .
Create a series of plots below where you compare the points to the following:
-
The function computed with the above function.
-
Nearest neighbor interpolation
-
Linear interpolation
-
Cubic spline interpolation
-
Lagrange polynomial interpolation.
For each of these, compute estimated datapoints using a uniform spacing of over the range . Be sure to use appropriate symbols and legends to identify different curves/points use multiple plots as needed for clarity. For each interpolation use the function you wrote above to compute the RMSE.
C
Repeat part B, but sample with and uniformly distributed points.
D.
In table form, compare the RMSEs for the different interpolation mechanisms with and datapoints. Comment on the results. Which curves look the best representing the function ? Does this change as you change the number of datapoints?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
