CHAPTER 02.03: DIFFERENTIATION OF DISCRETE FUNCTIONS: Divided Difference Approach
In this segment, we're going to talk about how we can differentiate functions which are given as discrete functions, which are given at discrete points. So we're going to limit our attention to the forward divided difference, backward divided difference, and the central divided difference scheme. I'm going to talk a little bit about how the scheme works, and then we'll take it through an example, because that's the best way to learn how to talk about differentiation of discrete functions. So let's suppose, now, in this case, the function is not given to you at . . . as a continuous function, but it's only given to you at certain points, so let's suppose somebody gives you the value of the function at certain points, and what they want you to do is they want you to calculate the derivative of the function.
So let's suppose they want you to calculate the derivative of this function at this point, xi. Now, one of the things which you can simply do is you can say, hey, I'm going to choose another point, x-sub-i-plus-1, right here, so this point here is xi, comma, yi, which is given to me, and this point is also which is given to me is as follows. So if this is xi and this is x-sub-i-plus-1, this just simply falls under the category of the forward divided difference method that you're going to simply find the slope of this line, and the slope of that line will give you that f prime at xi is approximately equal to y-sub-i-plus-1 minus yi, divided by x-sub-i-plus-1 minus xi, simply rise over run, but you're taking a point ahead of it. Now, if you are going to choose this point, which is x-sub-i-minus-1, y-sub-i-minus-1, then you are doing a backward divided difference, because you're using a point which is . . . which is behind it. So in that case . . . so this is the forward divided difference scheme. In that case, your derivative of the function can be approximated as yi minus y-sub-i-minus-1, divided by xi minus x-sub-i-minus-1, and that's the backward divided difference scheme. Now, you could very well choose another point, you could choose this point and this point now, which will give you the central divided difference scheme, because now you are going one point to the left and one point to the right, so this will be the slope which you'll be calculating. So in that case, f prime of xi will be equal to y-sub-i-plus-1 minus y-sub-i-minus-1, divided by x-sub-i-plus-1 minus x-sub-i-minus-1, this is central divided difference scheme. However, there's a caveat here that . . . if you want to use central divided difference scheme, this difference here, which is, let's suppose, h, has to be same as this difference, h, here, otherwise it's not central divided difference scheme. So, if you want to use central divided difference scheme at a particular point here, the point to the left and the point to the right has to be given to you h apart, the same distance apart, otherwise this formula which I have written for central divided difference scheme is not central divided difference scheme formula. So let's go ahead and take an example, so this seems to be a pretty straightforward way of finding the slopes, by using a point ahead, point behind, and one point to the left, one point to the right, equidistantly spaced, of course, and that's how we'll find out the derivatives of the function. So let's go ahead and take an example. So let's suppose there's an aircraft which is landing, and what we want to do is we want to find out the velocity at a particular point. So there's an aircraft landing taking place, and you are given the value of the aircraft landing location at different points.
So imagine this is an exercise in emergency landing which is taking place, and you are finding out what the locations at different points are, on the runway. So you have 0, 0.4, 1, 1.75, and 2.5. The value of x is given as 20, 71, 110, 161, and 178. So that's where you are on the runway at different . . . different times. Now let's suppose if somebody says, hey, I want you to find out what the value of the velocity is at 1.75. So you're given location as a function of time, location is in meters, time is in seconds, and you're asked to find out, hey, can you give me an estimate of the velocity at 1.75. So what I can do is I can say velocity at 1.75 is approximately equal to, if I choose a point ahead, so this is the point where I am, and this is the point ahead, and that will be the forward divided difference scheme, so that would be v at 2.5 minus the velocity at 1.75, divided by 2.5 minus 1.75. So this is the forward divided difference scheme which you are using here, because you're using a point ahead of 1.75. So the velocity at 2.5 is 178, the velocity at 1.75 is 161, divided by 2.5 minus 1.75, and the value here turns out to be equal to 22.66 meters per second, don't forget the units, it's 22.66 meters per second. So that's how we are able to use the forward divided difference scheme to find out what the value of velocity is at 1.75. Now, somebody might say, hey, can you use some other method to do so? Yes, what I can do is I can use the backward divided difference scheme, that is by choosing this point and this point right there. So I can choose these two points to calculate the backward divided difference scheme, because I want to calculate the velocity at 1.75, I know the velocity at 1, which is 110, so if I use the point which is behind it, I'll be able to calculate by using backward divided difference scheme. So let me go ahead and do that . . . do that now. So what I'm going to do is I'm going to erase this and put it on the same board here, so that you can see the data at the same time. So, in this case what I will have, velocity at 1.75 is approximately equal to the velocity at 1.75 minus the velocity at 1, divided by 1.75 minus 1, because you're going backwards here, so you are taking the velocity at 1.75 and at 1, and dividing by the difference between the two numbers. So what is the velocity at 1.75? It is 161, velocity at 1 is 110, divided by 1.75 minus 1, and the value turns out to be 68 meters per second. So, that's what you are getting as the value of the velocity from backward divided difference scheme. This is quite different from what you got from the forward divided difference scheme, where you got only 22.66 meters per second. So let's go ahead and see that whether . . . so this is the backward divided difference scheme, this is the backward divided difference scheme velocity value which you are getting from there. So let's go ahead and see that what kind of values will we get if we use the central divided difference scheme. So, again, I'm going to erase this so that you can see the data. So let me erase this. So if I want to see whether I can use central divided difference scheme, the first thing which I have to understand is that I will use three data points, so this is the value where I want to find out what the velocity is. And what is the difference between the times here? It is 0.75, and the time here is also 0.75. So that's the only reason why I can use central divided difference scheme to calculate the velocity at 1.75, because the difference between the time behind . . . so if this is 1, this is 1.75, and this is 2.5, the difference between the two is 0.75, and the difference between these two numbers for the time is 0.75. So I can take the velocity at 1 and the velocity at 2.5, and use the central divided difference scheme to calculate the value of the velocity at 1.75. So the value of the velocity at 1.75 is approximately equal to the velocity at 2.5 minus the velocity at 1, divided by 2.5 minus 1. Again, keep in mind, the only reason why I'm able to use the central divided difference scheme is because the points are equidistantly spaced from the point where I want to calculate the value of the velocity. So in this case it turns out to be equal to 178 minus 110, divided by 2.5 minus 1, and this value turns out to be 45.33 meters per second. So that's the value which I get by using the central divided difference scheme. So let me summarize these numbers now which I obtained for the value of the velocity at 1.75. So I obtained the value of the velocity to be approximately equal to 22.66 meters per second by using my forward divided difference scheme, I got it approximately equal to 69 meters per second by using my backward divided difference scheme, and approximately equal to 45.33 meters per second by using the central divided difference scheme. So that's what I obtained . . . obtained there. And that's the end of this segment. |