Scientific Computing

This module illustrates fully discrete finite difference methods for
numerically solving the wave equation. The wave equation in one
dimension is the partial differential equation
*u*_{tt} = *c*
*u*_{xx},*u*(*t*, *x*)*t* and the spatial variable *x*, and subscripts
indicate partial differentiation with respect to the given independent
variable. Considering the wave equation as an initial-boundary value
problem, the equation is defined for any *x* in a given interval
*a*, *b*]*t*. The
initial conditions are given by *u*(0, *x*) =
*f*(*x*)*u*_{t}(0,
*x*) = *g*(*x*)*f* and *g*. Boundary conditions are given by
*u*(*t*, *a*) = *h*(*t*)*u*(*t*, *b*) = *k*(*t*)*h* and *k*. For simplicity, here we take
*c* = 1,*a* = −1,*b* = 1,*h*(*t*) =
*k*(*t*) = 0

The user begins by selecting initial conditions *f* and
*g*. The initial function *f* is plotted over the interval

To view the numerical solution, the user chooses between
two-dimensional and three-dimensional display modes and clicks
*Start*. The approximate solution is advanced time step by time
step, and the plot of the solution is updated accordingly. In
two-dimensional display mode, the solution at the current time is
plotted as a curve on the spatial interval *t* = 2.5*Stop*. When
the solution process is stopped before *t* = 2.5*Start*. Clicking *Reset* clears
any solution that may be partially calculated and redisplays the
initial condition, allowing the user to select different initial
conditions, a different solution method, or different step sizes.

Information about the finite difference methods implemented in this module can be found in the references mentioned below. The standard method is discussed in Heath [1], the explicit and implicit 2-4 methods are discussed by Strikwerda [2], and the stable implicit method is discussed by Evans, Blackledge, and Yardley [3].

**References:**

- Michael T. Heath,
*Scientific Computing, An Introductory Survey*, 2nd edition, McGraw-Hill, New York, 2002. See Section 11.2.2, especially Figure 11.5 and Example 11.3. - John C. Strikwerda,
*Finite Difference Schemes and Partial Differential Equations*, SIAM, Philadelphia, 2004. See Section 8.2. - G. Evans, J. Blackledge, and P. Yardley,
*Numerical Methods for Partial Differential Equations*Springer, New York, 2000. See Section 3.4.

**Developers:** Evan VanderZee and Michael Heath