Mathematics, Sciences, and Technologies

ODEs 7-9 (PDEs): Wave Equation (Part 1)

,

Form and Intuitive Understanding of Wave Equation

The last major type of second-order linear PDEs to be discussed is the wave equation, which has the form of

\begin{align}
\frac{\partial^2 u}{\partial t^2} -c^2 \frac{\partial^2 u}{\partial x^2} = 0 \tag{1}
\end{align}

The reason why it is called this way is that (1) describes the propagation of waveforms, with a speed of \(c\) to both the left and right directions. To see this, let \(f(x)\) represent an arbitrary shape, then the function \( f(x-ct) \), which translates at the speed of \(c\) to the right, satisfies (1):

\begin{align}
&\quad \frac{\partial^2}{\partial t^2}(f(x-ct)) -c^2 \frac{\partial^2}{\partial x^2}(f(x-ct)) \\
&= (-c)^2f^{\prime\prime}(x-ct) -c^2f^{\prime\prime}(x-ct) = 0 \tag{2}
\end{align}

Similarly, \( f(x+ct) \) is also a solution to (1) and translates at the same speed \(c\) but to the left instead. Hence, the form of (1) supports wave motions.

In fact, for an unbounded domain \( -\infty < x < \infty \), the general formula of the solution to the wave equation is given by d’Alembert’s formula:

\begin{align}
u(x,t) = \frac{1}{2}(f(x-ct) + f(x+ct)) + \frac{1}{2c} \int_{x-ct}^{x+ct} g(s) ds \tag{3}
\end{align}

that corresponds to the initial conditions \( u(x,0) = f(x), \frac{\partial u}{\partial t}(x,0) = g(x) \). However, we will not go into depth for this. We will turn our attention to the bounded domain case, which uses our previous knowledge of ODEs and the technique of separation of variables.

Solving the One-dimensional Wave Equation

As before, let’s suppose that the solution looks like

\begin{align}
u(x,t) = X(x) T(t) \tag{4}
\end{align}

where \( X(x) \) is a function of \(x\) only and \( T(t) \) is a function of \(t\) only. The domain is given as \( 0 \leq x \leq L \), and the B.C.s may be Dirichlet or Neumann. The I.C.s will be something along the lines of

\begin{align}
\left\{\begin{aligned}
u(x,0) &= f(x) \\
\frac{\partial u}{\partial t}(x,0) &= g(x)
\end{aligned}\right. \text{(for \(0 \leq x \leq L\))} \tag{5}
\end{align}

similar to the unbounded case. Substituting this into (1) leads to

\begin{align}
X(x) T^{\prime\prime}(t) -c^2 X^{\prime\prime}(x) T(t) &= 0 \\
\frac{1}{c^2}\frac{T^{\prime\prime}(t)}{T(t)} &= \frac{X^{\prime\prime}(x)}{X(x)} \tag{6}
\end{align}

By separation of variables, we set both L.H.S. and R.H.S. equal to \(-\lambda\), the \(x\) part gives

\begin{align}
X^{\prime\prime} + \lambda X &= 0 \tag{7}
\end{align}

Similar to the heat equation situation, given either Dirichlet or Neumann homogeneous B.C.s, the solution to (7) will comprise countably infinite eigenfunctions, usually sines or cosines, let’s say \( X_{\lambda_1}, X_{\lambda_2}, \ldots \), corresponding to the eigenvalues \( \lambda_1, \lambda_2, \ldots \). Subsequently, the \(t\) part may be proceeded as

\begin{align}
T^{\prime\prime} + c^2\lambda T &= 0 \tag{8}
\end{align}

and it will have the general solution of

\begin{align}
T = A \cos(\sqrt{\lambda} ct) + B\sin(\sqrt{\lambda} ct) \tag{9}
\end{align}

(negative \(\lambda\) is not allowed, since otherwise \( X \) will be exponential and cannot satisfy the B.C.s.) The general solution to (1) is then, again a superposition of

\begin{align}
u(x,t) = \sum_{j=1}^{\infty} (A_j \cos(\sqrt{\lambda_j} ct) + B_j \sin(\sqrt{\lambda_j} ct)) X_{\lambda_j}(x) \tag{10}
\end{align}

The time derivative (velocity, not to be confused with the wave propagation speed \(c\)) is then

\begin{align}
\frac{\partial u}{\partial t}(x,t) = \sum_{j=1}^{\infty} (-c\sqrt{\lambda_j} A_j \sin(\sqrt{\lambda_j} ct) + c\sqrt{\lambda_j}B_j \cos(\sqrt{\lambda_j} ct)) X_{\lambda_j}(x) \tag{11}
\end{align}

And finally, we have to match (10) and (11) with the I.C.s (5) at \(t = 0\). This will determine the coefficients \( A_j , B_j \) by orthogonally projecting them onto the eigenfunctions \( X_{\lambda_j} \).

Example

Solve the wave equation

\begin{align}
u_{tt} = c^2 u_{xx} \tag{12}
\end{align}

over \( 0 < x < L \), with the Dirichlet boundary conditions \(u(0,t) = u(L,t) = 0\), and the initial conditions \(u(x,0) = x -L/2\), \(u_t(x,0) = 1\).

Following the instructions above, we know that from the Dirichlet B.C.s:

\begin{align}
X = \sin(\sqrt{\lambda}x) = \sin(\frac{n\pi}{L}x) \tag{13}
\end{align}

with \( \sqrt{\lambda} = n\pi/L, n = 1,2,\ldots \). The form of the solution will then be, by (10)

\begin{align}
u(x,t) = \sum_{n=1}^{\infty} (A_n \cos(\frac{nc\pi}{L}t) + B_n \sin(\frac{nc\pi}{L}t)) \sin(\frac{n\pi}{L}x) \tag{14}
\end{align}

Now what remains is to match the I.C.s. The derivative of \(u\) is

\begin{align}
u_t(x,t) = \sum_{n=1}^{\infty} (-\frac{nc\pi}{L} A_n \sin(\frac{nc\pi}{L}t) + \frac{nc\pi}{L} B_n \cos(\frac{nc\pi}{L}t)) \sin(\frac{n\pi}{L}x) \tag{15}
\end{align}

Plugging in the I.C.s at \( t = 0 \), we have

\begin{align}
u(x,0) &= \sum_{n=1}^{\infty} (A_n(1) + B_n(0)) \sin(\frac{n\pi}{L}x) \\
&= \sum_{n=1}^{\infty} A_n \sin(\frac{n\pi}{L}x) = x -L/2 \tag{16}
\end{align}

By the orthogonality of the Fourier sine basis, we can compute the coefficients \( A_n \) as

\begin{align}
A_n &= \frac{2}{L} \int_0^L (x -\frac{L}{2}) \sin(\frac{n\pi}{L}x) dx \\
&= \frac{2}{L} \int_0^L x \sin(\frac{n\pi}{L}x) dx -\int_0^L \sin(\frac{n\pi}{L}x) dx \\
&= \frac{2}{L} ([-\frac{Lx}{n\pi}\cos(\frac{n\pi}{L}x)]_0^L + \frac{L}{n\pi} \int_0^L\cos(\frac{n\pi}{L}x) dx) + [\frac{L}{n\pi}\cos(\frac{n\pi}{L}x)]_0^L \\
&= [-\frac{2x}{n\pi}\cos(\frac{n\pi}{L}x)]_0^L + [\frac{2L}{n^2\pi^2} \sin(\frac{n\pi}{L}x)]_0^L + [\frac{L}{n\pi}\cos(\frac{n\pi}{L}x)]_0^L \\
&= -\frac{2L(-1)^n}{n\pi} + (0) + \frac{L[(-1)^n-1]}{n\pi} = -\frac{L[(-1)^n+1]}{n\pi} \tag{17}
\end{align}

Similarly,

\begin{align}
B_n &= \frac{2}{L} \frac{L}{nc\pi} \int_0^L \sin(\frac{n\pi}{L}x) dx \\
&= \frac{2}{nc\pi} [-\frac{L}{n\pi} \cos(\frac{n\pi}{L}x)]_0^L \\
&= -\frac{2L((-1)^n-1)}{n^2c\pi^2} \tag{18}
\end{align}

Hence the full solution is

\begin{align}
u(x,t) = -\sum_{n=1}^{\infty} (\frac{L[(-1)^n+1]}{n\pi}\cos(\frac{nc\pi}{L}t) +\frac{2L((-1)^n-1)}{n^2c\pi^2}\sin(\frac{nc\pi}{L}t)) \sin(\frac{n\pi}{L}x) \tag{19}
\end{align}

Exercise

For a guitar, the vibration of its strings follows the wave equation. Of a typical guitar, the scale length (the effective length of its strings) is \(L = 63.5\) cm. It is possible to tune the strings to the required pitches by having them more/less taut (and thereby changing the value of \(c\)). It is known that the fourth string should be tuned to have a frequency of \(196.00\) Hz (G3) when unpressed. By analyzing the corresponding PDE problem, find the required value of \(c\) for the fourth string to play the desired note of G3 as the first harmonic (the lowest eigen-frequency). The boundary conditions at both ends are of the Dirichlet type (\(u(0, t) = u(L, t) = 0\)).

Similarly, explain why pressing down the string somewhere in its middle will make a higher note. Particularly, how to make the string play a note with an octave higher (double the base frequency)?

Answer

The B.C.s and thus the general form of solution will be the same as the above example (14):

\begin{align}
u(x,t) = \sum_{n=1}^{\infty} (A_n \cos(\frac{nc\pi}{L}t) + B_n \sin(\frac{nc\pi}{L}t)) \sin(\frac{n\pi}{L}x)
\end{align}

From this, we can infer the frequency of the sinusoidal part oscillating in time as

\begin{align}
\frac{1}{2\pi} \frac{nc\pi}{L} = \frac{nc}{2L}
\end{align}

The \( \frac{1}{2\pi} \) factor is needed to convert from angular frequency to the linear one. The first harmonic then has an eigen-frequency of \(c/2L\) when \(n = 1\). For it to match \(196.00\) Hz, we have the required value of \( c = \frac{196.00}{2(0.635)} = 248.92\) m/s.

Finally, pressing down the string reduces \(L\). To play a note an octave higher, press down the string at its middle exactly.

Leave a Reply

I’m Benjamin

Welcome to my Mathematical World! Here you can find posts and tutorials related to applied topics like Linear Algebra, Calculus, Differential Equations, and Programming. Feel free to leave comments and suggestions!