The simple discretization
Last updated
Last updated
Below is an example of what can be done with the work from this section. Physically, it represents the movement of a string with fixed boundaries.
As mentioned earlier, we are going to approximate the value of the function of in a discrete domain. To do this, ñets start by defining a discrete domain:
In every point of space and time, the function f will be defined. To simplify the notation, we shall name:
We will now remember a very useful formula from calculus. It helps us calculate second order derivatives:
With this formula in mind, we can substitute the partial derivatives inside the wave equation with these subtractions, the result is the following:
The nice thing about the obtained expression is that we can solve for f at a later time in terms of known values from the past:
With this expression, we can calculate the function on a later time if we know the value of the function on the 2 prior times. To start the evolution, we require initial conditions. We must have the initial function (called g(x)) and the time partial derivative (called h(x)). With these two functions we can calculate 2 time steps and get the evolution going. The first time step would be:
But, for the second time step, we are gonna have to Taylor expand the function to the past:
The second derivative that appears in the expression can be computed using the same approximation used above. And this is all what we need to solve the wave equation in one dimension. The only detail missing are the boundary contidions, which will be discussed in the next section. To replicate the animations from above, the parameters and initial conditions needed are: