Linear Spline Interpolation

                In this segment, we'll talk about linear spline interpolation. It's a method of interpolating data where the function is given only a discrete point. So, let's go and see how linear spline interpolation works.

                We are given n plus one data points right here, so we will be drawing straight lines through the two consecutive data points. Let's suppose, in this case x naught comma y naught and x1 comma y1, then we will draw another straight line going from x1, y1 to x2, y2. And since we have n plus one data points, which will have n such straight lines. And we are using the Newton's divided difference polynomial format for our straight lines because it directly gives us what the equation of a straight line will be. You can always start from y is equal to mx plus c, but then you have to set up two equations two unknowns to be able to find out what the slope and the intercept is. There's no need to do so if we use the Newton's divided difference polynomial method and hence, it reduces our computational effort as well. But keep in mind that this particular straight line, let's suppose this one is going from this one is this straight line right here, it's only valid between x naught and x1. That's extremely important to understand that, if you're drawing these straight lines, they are only valid for a certain domain. And same thing here, this is the second straight line which we have here, but it is only valid between x1 and x2. And the last one is right here and is valid between x sub n minus 1 and x_n, and that's how you do linear spline interpolation.

                Let's take an example here, so we are given six data points for velocity versus time data. It is plotted right here, and what we want to be able to do is we want to find the velocity at 16 seconds; that's what we want to be able to do. So, the first thing which we have to see, is that we're not going to draw the all the straight lines for the linear spline interpolant, because if we're only interested in finding the velocity at 16 we simply can only, we can simply use the part of the linear spline interpolant, which goes from 15 to 20 because 16 is the closest point to 15 and 20. The closest points to 16 are 15 and 20, which also bracket that particular point. So, you might say that hey, this sounds very similar to linear polynomial interpolation, and it is.

                So, the solution involves finding the straight-line approximation of the velocity from 15 to 20, which is this one right here. We take the velocity at 15, velocity at 20, and we put it into this particular equation right here. The velocity at t naught is 362.78, and the velocity at t1 is517.35, and we know that t1 is 20 and t2, t naught is 15. That allows us to do the proper substitutions here, and gives us the expression for the, for the linear spline part from 15 to 20. We don't need to simplify this because in order to find the value of the velocity at 16, we can simply substitute the value of t equal to 16 there and be able to find out what we are trying to find in the first place. And it turns out to be 393.7 meters per second, and that is the end of this segment.