The numerical solution of PDEs is often neglected in the undergraduate
physics curriculum even though it can lead to useful insights into the
underlying physics.[15,16] Their solution is
hardly more difficult than the solution of ordinary differential
equations, once the notation required to work with more than one
variable is mastered. Since computers have a finite amount of memory,
we must limit our knowledge of the solution,
, to a finite
number of points in space and time. This process of discretizing space
and time is accomplished by letting the continuous variables x and
t take on the values given by

The wave amplitude
is now described by a N by M matrix, where
subscripts and superscripts refer to spatial and
temporal variables, respectively:

The bottom row of this matrix
is the
disturbance at time t=0. You will select values for this row
when you pull down the [Init]
menu in the program. The first and
last columns are determined by the boundary conditions. The task at
hand is to find an algorithm that will allow us to generate any row in
the matrix from a previous row or rows. As a first step, we write
finite-difference approximations for the first derivatives of the function
as
and the second derivatives as
The algorithms obtained when eq:Der1E and eq:Der2E are
substituted into the appropriate equation will have the same
relationship to partial differential equations that the Euler algorithm
has to ordinary differential equations; they are a useful staring point
for further discussion. They may not be accurate, stable, or
computationally efficient.