Tip:
Highlight text to annotate it
X
2D Now let's calculate some example velocities that we can expect if we're not at the magic time step.
And in order to do this, let's now solve -- let's go back to our numerical dispersion relation and solve for K tilde.
In this case we'll get 1 over delta X inverse co-sine. We'll get this -- the relationship I've put at the top of this screen.
And what we're going to do is we're going to let S, which is the numerical stability factor, and we'll be covering this a bit more later on,
S is going to be defined as V delta T over delta X.
And N sub lambda, this is going to be defined as the number of points per wavelength, the number of grid points that we have per wavelength.
So we can find that by dividing lambda divided by delta X. So this is the grid sampling resolution.
Also let's assume that omega tilde in this case is real and equal to -- and equal to omega.
So it's the numerical angular frequency is equal to the physical angular frequency.
Then in this case omega tilde delta T, which we have here, we can rewrite as omega delta T, which is also equal to 2 pi F.
In this case I'm going to rewrite 2 pi F as 2 pi V over lambda. And S delta X over V.
So in this case I used -- I replaced DT with S delta X over V. Here's T. And the omega I rewrote as 2 pi F or 2 pi V over lambda.
So this then will be equal to 2 pi S over N lambda. And therefore then our K is equal to 1 over delta X.
I'm just rewriting this, using these terms, 1 plus 1 over S squared co-sine 2 pi S and lambda minus 1.
So it's the same equivalent to the one at the top of the screen, but we are now using terms that are going to allow us to
quickly look at how using different grid sampling resolutions, for example, will change the accuracy of our solution.
So let's look at a couple of examples or a few examples that will help us understand these relationships.
In example 1 we're going to take delta X is equal to lambda knot over 10. So in this case N lambda is equal to 10.
Delta T is equal to delta X over 2 C. So S is equal to .5. Remember that S equal to 1 is our magic time step. We get the exact solution.
So here we're at half of that. We're also going to assume that we're in free space. So V can be equal to C.
Now, we can plug into -- our relationship that we just got for K, plug these values in, and what we'll get is about 0.6364 over delta X.
And VP in this case, if we want to solve for the phase velocity, is omega.
There's no tilde there, because we said that omega tilde is equal to omega. Equal to K real.
And then we'll get 2 pi C, because we're in free space, over lambda knot. And then our K that we just solved for. So 0.6364 over delta X.
This is going to give us 0.9873 C or an error of minus 1.27 percent. --
We'll look at a couple more examples, and then we'll be able to graphically see what all this, put it all together.
So in this case now let's keep S equal to .5 and instead let's now change N lambda to be equal to 20. So we have more points per wavelength.
We've doubled the number of grid cells that we have per wavelength. So this is a higher resolution.
So if you think about it, are you going to expect lower error or higher error if you keep S the same and you increase the grid cell resolution.
You can stop and answer that and then let's see now if we get what you expect.
So K tilde, in this case plugging it in, will give us 0.31514 over delta XV. We can plug in our omega K real that we just solved for.
This case will get .99689 C and so this is an error of minus .31 percent, and
indeed this is smaller than what we had when the grid resolution was 10.
So intuitively we would expect that. We increase the resolution.
We already solved previously we saw if you -- as you go have delta X 10 to 0 or delta T 10 to 0, that
you're converging on the exact solution, and in this case we see that we're getting a higher accuracy.
And exactly what kind of accuracy are we getting here? What kind of a reduction in the error did we get? Note that we had a 2 to 1 reduction.
We reduced delta X by 2. Reduction in delta X. And from this we got a 4 to 1, we reduced our error by a factor of 4.
And we would expect this because the scheme that we're using, the central differencing, if you recall, is second order accurate.
So our error changes as delta X squared. So if delta X changes by a factor of 2, then the 2 squared will have reduction of 4 in the error.
So second order accurate. And it's second order accurate in both space and in time.