[MUSIC] So what does our one dimensional finite-difference approximation to the acoustic wave equation look like in a Python code. And how does this run for our physical problem that we've just described? So let's see, I'm showing here, again, the algorithm as an extrapolation scheme for discrete pressure, p, at point i. And the time step n plus one. On the right hand side we see that we basically need to replace the second derivative of p by its finite difference approximation, which is given here. First of all we have to initialize our simulation with some parameters. We said we want to simulate ten kilometres so the maximum of X in metres is 10,000. We use 10,000 points for that, so we discretize approximately with dx in increment of 1 metre, and our velocity is 334 Meters per second. We put a at the center of our physical domain at nx over 2, and we would like to simulate 1,000 time steps with a time increment of 0.0002 seconds. So let us start initializing a source time function as first derivative of a Gaussian with twenty-five hertz and see what it looks like. So, first let's have a look at the source time function that we inject In the middle. It's given here, it's the first derivative of a Gaussian, defined over the entire time we would like to simulate. In this case, this is actually two seconds. And we can also see the amplitude spectrum here, so we can see that in this case, the dominant frequency is around 25 hertz. So let's start the simulation and see what happens. So what we can see here is at the start, we are injecting the source, and actually, now we're following the waveform that's propagating away from the source. And we see that actually a Gaussian shape, a waveform is propagating and x increasing as expected. And the waveform is kept the same and also the amplitude is basically constant. The maximum amplitude Of our phase. So the simulation has stopped, we've had about 1,000 time steps. And let's investigate a little what happens if we increase the frequency. We go back to the initialization, and increase the frequency to 50 hertz. And beware then what happens. If we increase the frequency, We basically decrease the spatial wavelength, in this case by a factor of two. And it also means we have less grid points per wavelength. So let's run it again and see what happens. So as we can see we have now a shorter wavelength. The waveform is the same. It's propagating in positive x direction, and if you see very carefully, at this part of the waveform, you actually see something is happening. And suddenly this nice Gaussian shape pulse seems to be disintegrating. So it's losing it's original form which we will actually later see it should not do. Let's further increase the frequency to 100. Hertz. That means again we're making the wavelength even smaller, so we have even less grid points per wavelength. And now you can see, actually, a dramatic change in the waveform. This is numerical dispersion, we will investigate this later. But that's certainly it seems something that we should try to avoid. Another aspect can be seen if we change the time increment dt. Now let's get back to the original 25 hertz wavelet and increase the time step from dt equals 0.002 to 0.003 and let's see what happens. So if you run that, see it starts again very nicely and now suddenly something dramatic happens. Actually, the solution explodes, and that's called unstable. You can see that the values actually are increasing, they would increase to infinity if you continue the simulation. So, it looks like we cannot arbitrarily choose the parameters that we would like to simulate and that's something we're now going to look at from a more analytical point of view. Now, I invite you to make use of this code that is accessible through the webpage. And to play around with the parameters. You can change the physical domain, you can change DX, you can change the length of the simulation and just play around with those parameters and see what happens. [MUSIC]