CHAPTER 05.05: SPLINE METHOD: Quadratic Spline Interpolation: Example: Part 1 of 2
In the previous segment, we showed you how to do quadratic spline interpolation, with an example, and we found out what the coefficients of the quadratic splines are. In this segment, I just want to show you that how those coefficients are now used to find out what you are looking for. So to recap a little bit, we had . . . somebody gave us six data points from 0 to 30, and we were . . . we said that, hey, we need five quadratic splines to go through the six consecutive data points, and we'll have fifteen equations and fifteen unknowns. That's what we did in the last segment set up those fifteen equations, fifteen unknowns, and that's what we got as the individual coefficients of the spline. And when we substitute those in the . . . in each individual spline, this is what the splines we get. So these are the five splines we get. Of course, the first spline is a linear spline, because we assumed a1 equal to 0 as our fifteenth equation, and then the rest of them are quadratic splines as you are seeing there. So if I draw the quadratic splines, that's how they look in the graph. And now you've got to understand that each of these splines are valid between a certain point. So, for example, if I'm looking for any value of velocity between 15 and 20, that is the only spline which I can use, other splines are not valid for the range in between 15 and 20. So that's something which you have to be careful about whenever you're using spline interpolation, that each spline has a valid domain. That's the case also in polynomial interpolation, but once you find a polynomial interpolant, it is valid between the smallest value of independent you have to the largest value of the independent variable you have. Here, that's not the case. Now, the first problem which we were asked to solve was, hey, can you find out what the value of the velocity at 16 is? I have to do is, although I have found out all the five splines going from 0 to 30, I have to choose the right spline, and since this value is 16, I'll be choosing this spline here to be able to find out what the value of the velocity at 16 is, because this is the one which is valid between 15 and 20. So I take that spline, and I substitute time, t equal to 16 in there, and I get what the value of the velocity at 16 seconds is, which in this case turns out to be 394.24 meters per second. If I wanted to find the value of the velocity at, let's suppose, 25, then I will take this spline to find the value of the velocity at 25. Now, more problems were asked of you to do, you were also asked to find the acceleration at t equal to 16, but the splines which have are for the velocity. The splines which we have are for the velocity, but we are asked to find the acceleration at t equal to 16. So how I'm going to do that is by, again, choosing the proper velocity profile. The proper velocity profile is this one, because this is the velocity profile which is valid between 15 and 20. So what I'm going to do is I'm going to take that particular spline, I'm going to take its derivative with respect to time, and them I'm going to substitute the value of time, t equal to 16 in there, to be able to find out what the acceleration at 16 is. So remember, this is the spline which I have to take. So I take that spline, which is valid between 15 and 20, substitute it into this derivative equation, and this is what I get as the derivative of the acceleration. Now this acceleration which I have underlined there is valid between the times 15 and 20. So since it is valid between 15 and 20, I just simply substitute the value of time, t equal to 16 in there, and I get my acceleration to be 31.32 meters per second squared. So again, if I was asked to find the acceleration at any point between 15 and 20, I will still be using the same expression, but if it was at some other point, other than between 15 and 20, I'll have to choose the proper quadratic spline to be able to do that. Another problem which you might be asked to do is to find out what the distance covered of the rocket is from one point to another. So in order to be able to do that, that means that we have to integrate from 11 to 16 the velocity expression. The quadratic splines have been obtained for velocity, but what you are being asked to calculate is a distance between t equal to 11 to t equal to 16 seconds. So this is the integral calculus expression for finding out the distance covered by the rocket from 11 to 16 seconds. So one of the things which you've got to realize is that since you are integrating from 11 to 16, you don't have a single spline which is valid between 11 and 16. You have one spline which is valid between 10 and 15, so this particular spline is valid is valid between 10 and 15, while there is another spline which is valid between 15 and 20. So we're don't have a single spline which is valid between 11 to 16, so you'll have to use both of these splines. So what that means is that you'll have to break this integral . . . you'll have to break this integral going from 11 to 15, and then the other integral will go from . . . go from 15 to 16. So you'll have this integral, one integral going from 11 to 15, and the next integral going from 15 to 16 to be able to find this. So let's go ahead to the next slide to see that what we mean by that. So what I meant by that was that I've got to take two splines. So this is the spline which is going from 10 to 15, this is the spline which is going from 15 to 20. So I've got to break my integral, which is going from 11 to 16, so the integral which will go from 11 to 16, to two integrals, one which is going from 11 to 15, and the next integral, which is going from 15 to 16. So I substitute the . . . substitute the spline which is going from 11 to 15, which is this one . . . which is this one, 10 to 15 right there, that's what I substitute there, and then the next one, I substitute this spline to be able to do the integral of that one. So once I do those two integrals, because those are simply integrating second-order polynomials, and I do them separately, eventually the number which I get for the integral of velocity from 11 to 16 turns out to be 1595.9 meters. And that's the end of this segment. |