Here is our example data, modified slightly to exaggerate behavior, and interpgui modified to include the 'v5cubic' option of interp1. ![]() Because the abscissa are equally spaced, the v5 cubic can be evaluated quickly by a convolution operation. The resulting piecewise cubic does not have a continuous second derivative and it does not always preserve shape. I'll tell you later where the coefficients of the cubics come from. These functions are formed by adding cubic terms that vanish at the end points to the linear interpolatant. We have the y-values at the knots, so in order to get a particular PCHIP, we have to somehow specify the values of the derivative, y', at the knots.Ĭonsider these two cubic polynomials in $x$ on the interval $1 \le x \le 2$. Just as two points determine a linear function, two points and two given slopes determine a cubic. Since we want the function to go through the data points, that is interpolate the data, and since two points determine a line, the plip function is unique.Ī PCHIP, a Piecewise Cubic Hermite Interpolating Polynomial, is any piecewise cubic polynomial that interpolates the given data, AND has specified derivatives at the interpolation points. There is a different linear function between each pair of points. ![]() ![]() So I added the title plip because this is a graph of the piecewise linear interpolating polynomial. With line type '-o', the MATLAB plot command plots six 'o's at the six data points and draws straight lines between the points. Here is the data that I will use in this post.
0 Comments
Leave a Reply. |