CHAPTER 07.06: DISCRETE DATA INTEGRATION: via Spline Interpolation
In this segment, I'm going to show you how to integrate discrete functions. So these are functions which are given to you only at certain points, but not as continuous functions. We already talked about how to integrate discrete functions by other methods, such as the trapezoidal rule with unequal segments, or the polynomial method, and this is one more method to show you how we can integrate discrete functions, and we're going to learn about this through an example. So here is data given to us as a function of time. So you are given velocity as a function of time at different, at six different data points, so you've got six different data points given to you, and what you are asked to do is to find out what is the distance covered between t equal to 11 and t equal to 16 seconds? So you are finding out . . . so what that means is that you want to integrate the velocity expression from 11 to 16. Now, this might seem to be straightforward, that you are asked to integrate the velocity expression from 11 to 16, but velocity is only known at the discrete points as given in the table. So you cannot just simply replace velocity by some continuous expression without calculating it first. So that's what we're going to do is we're going to find the quadratic splines for the velocity expression so that we can integrate from 11 to 16 to be able to find out the distance covered from 11 to 16 seconds. So again, I'm showing you here the data, but I'm also showing you the plot so that we're clear about what we are trying to do. So we'll have to find out the quadratic splines going through the . . . through the six consecutive data points, and this is what we might obtain. And then we are interested in only finding the area under the curve from 11 to 16 seconds, that's what we're interested in, because once we are able to find out what this area is, that is the distance covered by the rocket from 11 to 16 seconds. So in that case, I need to know what this spline is, and I need to know what this spline is, so I need to know the third spline, and I need to know the second spline to be able to calculate what the value of the distance covered is from 11 to 16 seconds. So let's go through the process of seeing that how this is done. It is as follows, that you're going to have . . . you have six consecutive data points, so you're going to have five splines, and since you have five splines, you're going to have fifteen unknowns, because each spline has three unknowns. Now, how to find these splines is shown in a separate segment, and so I'm going to assume that you're going to look at that segment, and be able to find out what those splines are, and this is what you get. So these are the spline coefficients which you're going to get, you get fifteen equations, fifteen unknowns, you are able to get the splines which are valid from 0 to 10, then 10 to 15, and so on and so forth. Now, here what you are seeing is that in order to calculate the distance covered from 11 to 16 seconds, I need to properly choose which splines to use. So since it's from 11 to 16, I don't have a single spline which goes from 11 to 16, because I have one spline going from 10 to 15, and I have another spline going from 15 to 20. So what that means is that I might have to break this integral into two parts so that it goes from 11 to 15, because that's the end of this spline, and then go from 15 to 16, because that's the start of the next spline, so let's go ahead and see how that works out. So since we have to use two splines, and that's what I was showing you, that I need to use a spline which goes from 10 to 15, the other spline which goes from 15 to 20. So I am interested in finding out what the distance covered from 11 to 16 seconds is, so s is simply the location of the rocket, so if I subtract the location at 16 minus the location at 11, that will give me the distance covered by the rocket from 11 to 16 seconds. So I'm breaking the integral from 11 to 16 into two integrals, 11 to 15 and 15 to 16, because I don't have a single spline available to me for finding the integral from 11 to 16. So I'll have to use the spline which is valid between 11 and 15 here, and the spline which is valid between 15 and 16 here. So which spline is valid between 11 and 15? This is the spline which is valid between 11 and 15, and this is the spline which is valid between 15 and 16. So that's the substitutions which we are making right here, so if you're looking at the substitutions, that is the velocity expression from 10 to 15, this is the velocity expression from 15 to 20, but again, keep in mind that you are only integrating from 15 to 16 here, and only integrating from 11 to 15 for the first spline, and once you do the integration, because it's a simply integration, because all you are doing is you are integrating a second-order polynomial, and everybody knows how to integrate a second-order polynomial by using the integral calculus knowledge, this is what turns out to be the distance covered by the rocket from 11 to 16 seconds. And that's how you use a spline interpolation to be able to integrate a function which is given at discrete data points. And that's the end of this segment.