Question: For this problem you will test a few interpolation approaches for the application of generating interpolated data. We'll do this by interpolating data that is
For this problem you will test a few interpolation approaches for the application of generating interpolated data. We'll do this by interpolating data that is sampled from a known mathematical function. The same function can then be used to compute true values at the interpolated points to use in error calculations.
Consider the following mathematical function Runges function:
RUNGE's FUNCTION
Write a function mfile that uses this formula to generate a set of data points. Your function should use those points along with the interpolation approaches outlined below to generate interpolated data xi fi on a specified increment. Your function should accept the following inputs in order:
A vector of x values at which fx is to be evaluated to generate the sampled data.
A scalar input specifying the increment to use for the interpolated data.
Your function should use the following three approaches to generate interpolated data:
A polynomial of order N where N is the number of points in the sampled data
A linear spline
A clamped cubic spline with derivative end conditions set to values equal to the exact analytical derivative of fx evaluated at the end points.
Your function should have the following three outputs in order:
The interpolated data fi generated with polynomial interpolation column vector
The interpolated data fi generated with a linear spline column vector
The interpolated data fi generated with the clamped cubic spline column vector
Note this problem is similar to the humpsinterp.m example.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
