CHAPTER 07.04: ROMBERG INTEGRATION: Multiple Segment Trapezoidal Rule: Example
In this segment, what we're going to do is we're going to take an example for the multiple segment trapezoidal rule error and we're going to take an example, and see that what it means by . . . by looking at the formula for the multiple segment trapezoidal rule. The true error for the multiple segment trapezoidal rule is exactly given as minus b minus a, whole cubed, divided by 12 n squared, times the summation of second derivatives of the function at certain points, divided by n right there. So this, all this is coming from when you are trying to integrate a function from point a to point b, so you're trying to integrate a function from point a to point b using n segments, so using n segments here, so you have a plus h here, so this h means you're dividing the width of the interval by n segments, by n, hence getting the width of the segment to be b minus a, divided by n. So the true error is exactly equal to the cube of the interval difference, divided by 12 n squared, where n is the number of segments, and multiplied by this quantity here, and keep in mind this alpha-i is some number between each of those lower and upper limits of each of the segments. So alpha-i is the point between the lower limit of this integration and upper limit of integration for that particular segment, so it's some point between a and b, but it is denoted by a particular value of the lower limit and upper limit in that particular segment. However, this particular number here will give you approximately the average value of the second derivative of the function, that's what it's going to give you. It's not going to be a constant, but it is, as you keep on increasing the value of n, this number is going to become a constant. So that number is not going to change much as you start increasing the number of segments, especially when you have large number of segments. So the only thing which you are basically able to see is that the true error is going to be approximately proportional to 1 by n squared, because that's the only quantity which is now changing. This quantity is also changing, so keep in mind that this is not a constant quantity, but this quantity is also changing, but what is happening is that it's not going to change very much for large values of n, this is not going to change, because that's the lower and upper limit of integration, and 12 of course is a constant, and minus is a constant, so what you're going to find out is the true error is approximately proportional to 1 by n squared. What does this mean? It is that if you're going to double the number of segments, your error is going to get quartered. Intuitively, you might think that if you're going to double the number of segments, your error is going to get halved, but actually it gets quartered, because as you can see from this particular formula, that the true error is inversely proportional to 1 by n squared. Now what I wanted to show you is I'm going to take a particular integral, as an example, and show you whether the true error does get approximately quartered or not. So let's look at this example here, it's a real life example. Let's suppose somebody gives me this integral here, or first gives me the velocity, that the velocity of a rocket is given by this, 2000 log, 14 . . . 140000, divided by 140000 minus 2100 t, minus 9.8 t, let's suppose, and what somebody is telling me, hey, go ahead and find out what the distance covered is, from 8 to 30 seconds, let's suppose. So let's suppose this is given as the velocity of a rocket, upward velocity of a rocket, and somebody is saying, hey, can you calculate what the distance covered is between 8 and 30 seconds. So all I have to do in this case is to simply integrate. So if I wanted to calculate this distance here, which is the distance covered by the rocket from 8 to 30 seconds, then that x will be simply the integral going from 8 to 30, v of t dt, simply the value of the area under the curve of the velocity profile, going from 8 to 30. And what I have done is that I have drawn a table, which I already calculated these values, and I have drawn a table for that if I am going to use the multiple segment trapezoidal rule, if n is the number of segments which I am going to use, what is the approximate value which I get by using the multiple segment trapezoidal rule, and then here I'm going to calculate what the true error is. Now, the exact value of this integral, up to five significant digits, is 11061, that is the exact value, and that you obtain by using your integral calculus knowledge. So that might be considered to be a homework for you, so go ahead and try to calculate the exact value of the integral by using your integral calculus knowledge, and that's what you're going to get, 11061, up to five significant digits. But these are the values which I obtained by using different number of segments for the multiple segment trapezoidal rule. So what I'm doing is I'm starting with two segments, then four, then eight, then sixteen, and the reason why I'm doubling it is because then I can really see that whether the true error is getting quartered or not, so that's why I'm showing you the doubling of the segments. And this is the . . . value which I get, 11266, then I get 11113 for four segments, then I get 11074 for eight segments, and 11065 for sixteen segments, and those are the values which I obtained from the multiple segment trapezoidal rule, these values which I have there. So the true error will be basically the exact value, which I have right here, minus the approximate value, so in this case, it turns out to be -205, and in this case it turns out to be -50 . . . 48, so the true error here is -48, the true error here is -13, and the true error here is just -4. So those are the true errors which I get by subtracting the exact value . . . subtracting the approximate value from the exact value for these 2, 4, 8, and 16 segments here. So, but if I divide by 4, if I divide the true error by 4, I get -51.25, I get -12, I get minus . . . 4 times 3, 3.75 . . . -3.25, and so on and so forth. So . . . so what you are finding out is that, look at this number right here, it is almost the quarter of that. So when I quarter this, I get -51.25, and that's very close to -48, then I look at this number here, that's very close to this number here, because when I quarter -48, I get -12, and that's the true error for 8 segments. So as you can see from here that as you are doubling the number of segments, what is happening is that your true error is getting almost quartered. It doesn't get exactly quartered, because we have that second derivative average function in the formula, and that's not a constant number. It does become constant as you make n to be very large. Now, somebody might say, hey, what is the advantage of learning about this? It's a numerical analysis which we are looking at, is that this forms the basis for something called the Romberg method, which we'll be discussing separately. So it uses this knowledge of error being quartered to be able to develop a much better Romberg . . . much better integration method, which is like an extrapolation method, to be able to find the value of the integrals. And that's the end of this segment. |