Example 1.

Use the finite-difference method (2.10) to solve the wave equation for a vibrating string:

$\displaystyle u_{tt}=4u_{xx}$   for$\displaystyle \quad x\in[0,\,L]$   and$\displaystyle \quad t\in[0,T]$ (2.16)

with the boundary conditions

$\displaystyle u(0,t)=0\qquad u(L,t)=0.
$

Assume that the initial position and velocity are

$\displaystyle u(x,0)=f(x)=\sin(\pi x),$   and$\displaystyle \quad u_t(x,0)=g(x)=0.
$

Other parameters are:
Space interval $ L$ =10
Space discretization step $ \triangle x=0.1$
Time discretization step $ \triangle t=0.05$
Amount of time steps $ T=20$

First one can find the d'Alambert solution. In the case of zero initial velocity Eq. (2.8) becomes

$\displaystyle u(x,t)=\frac{f(x-2t)+f(x+2t)}{2}=\frac{\sin\pi(x-2t)+\sin\pi(x+2t)}{2}=\sin\pi x\cos 2\pi t,
$

i.e., the solution is just a sum of a travelling waves with initial form, given by $ \frac{f(x)}{2}$ . Numerical solution of (2.17) is shown on Fig. (2.1.3).
Figure 2.4: Space-time evolution of the initial distribution $ u(x,0)=f(x)$ , $ u_t(x,0)=0$ .
\begin{figure}\centering
\epsfig{file=wave_ex2.eps, width=8cm}
\end{figure}
Gurevich_Svetlana 2008-11-12