The wave equation

Suppose that u(x,t) describes the displacement from equilibrium of a vibrating string whose ends are fixed.  The fundamental equation governing this motion is

(Subscript[u, t t])=(c^2)(Subscript[u, x x]).

In this notebook, we take a look at the derivation of the 1D equation together with some solutions in 1D and 2D.

Derivation

The wave equation is essentially a consequence of Newton's second law.  We assume that the string has a uniform linear density ρ and constant tension T.  We then consider the motion of a small portion of the string over the interval from x to x+Δ x.  The vertical acceleration of this portion is due entirely to the vertical components of the tension in the string: V(x,t) and V(x+Δ x,t).

botPic = Plot[Sin[x],{x,0.9,1.3},
PlotStyle -> {Black,Dashing[{0.02}]}];
topPic = Plot[Sin[x],{x,1,1.2},
PlotStyle -> {Black,Thickness[0.007]}];
annotation = Graphics[{
Arrow[{{1,Sin[1]}, {1,Sin[1]}-0.05{1,Cos[1]}}],
Arrow[{{1,Sin[1]}, {1,Sin[1]}-0.05{0,Cos[1]}}],
Arrow[{{1.2,Sin[1.2]}, {1.2,Sin[1.2]}+0.05{1,Cos[1.2]}}],
Arrow[{{1.2,Sin[1.2]}, {1.2,Sin[1.2]}+0.05{0,Cos[1.2]}}],
Text[StyleForm["x",FontSize -> 14],{1,0.8}],
Text[StyleForm["x+Δx",FontSize -> 14],{1.2,0.8}],
{Dashing[{0.02}],
Line[{{1,0.81},{1,Sin[1]}}],
Line[{{1.2,0.81},{1.2,Sin[1.2]}}]}
}];
Show[{topPic,annotation},
AspectRatio -> Automatic,
Axes -> False, PlotRange -> All]

The total force on this portion of the string is the difference between these two components and, by Newton's second law, this total force must equal the mass of this portion times its acceleration. In symbols,

V(x+Δ x,t)-V(x,t) = ρ Δx (Subscript[u, t t])

or, dividing by Δ x,

((V(x+Δ x,t)-V(x,t))/(Δ x)) = ρ (Subscript[u, tt]).

After taking a limit as Δ x->0, we get (Subscript[V, x])=ρ (Subscript[u, t t]).  It turns out that the horizontal H and vertical V components of the tension at a point are related to one another via the slope of the string, (Subscript[u, x]): V=H (Subscript[u, x]).

botPic = Plot[Sin[x],{x,0.9,1.3},
PlotStyle -> {Black,Dashing[{0.02}]}];
topPic = Plot[Sin[x],{x,1,1.2},
PlotStyle -> {Black,Thickness[0.005]}];
annotation = Graphics[{
Arrow[{{1,Sin[1]},{1,Sin[1]} + {0.2,0.2Cos[1]}}],
Arrow[{{1,Sin[1]},{1,Sin[1]} + {0.2,0}}],
Arrow[{{1,Sin[1]}+{0.2,0},{1,Sin[1]} + {0.2,0.2Cos[1]}}],
Text[StyleForm["T",FontSize -> 16],{1.1,0.91}],
Text[StyleForm["H",FontSize -> 16],{1.1,0.825}],
Text[StyleForm["V",FontSize -> 16],{1.215,0.88}]
}];
Show[{botPic,topPic,annotation},
AspectRatio -> Automatic,
Axes -> False, PlotRange -> All]

Assuming the displacement of the string is small, H≈T.  Thus plugging T (Subscript[u, x]) for V into (Subscript[V, x])=ρ (Subscript[u, t t]), we get the wave equation in the form T (Subscript[u, x x])=ρ (Subscript[u, t t]).

Solutions

Basic solutions

It's pretty easy to see that any function of the form (Subscript[u, n])(x,t)=(Subscript[b, n])sin(n x)cos(c n t) is a solution.  Possible values for n are dictated by the length of the string.  If the length is π, then n may be any integer.  Here's an animation of perhaps the simplest such solution.

Animate[Plot[Sin[x] Cos[t], {x,0,Pi},
AspectRatio -> Automatic,
PlotRange -> {-1,1},
Ticks -> {{0,π},{-1,1}}],
{t,0,2Pi}]

Here's a higher frequency solution.

Animate[Plot[(1/3)Sin[3x] Cos[3t], {x,0,Pi},
AspectRatio -> Automatic,
PlotRange -> {-1,1},
Ticks -> {{0,π},{-1,1}}],
{t,0,2Pi}]

A fundamental property of linear PDEs is that solutions may be super-imposed.

Animate[Plot[Sin[x] Cos[t]+(1/3)Sin[3x] Cos[3t], {x,0,Pi},
AspectRatio -> Automatic,
PlotRange -> {-1,1},
Ticks -> {{0,π},{-1,1}}],
{t,0,2Pi}]

Just as with the heat equation, a major question is how to deal with more or less arbitrary conditions.  We will look quite closely at this question later.

Of course, we can investigate numerically.

Clear[u];
u[x_,t_] = u[x,t] /. First[NDSolve[{
Derivative[0,2][u][x,t]==Derivative[2,0][u][x,t],u[x,0]==x(1-x)(2-7x),
Derivative[0,1][u][x,0]==0,u[0,t]==0,u[1,t]==0},
u[x,t],{x,0,1},{t,0,2}]];
Animate[Plot[u[x,t],{x,0,1},PlotRange -> {-1,1}],
{t,0,2}]

Eigenfunctions

Note the form of the solutions we’ve seen to the 1D wave equation:

(Subscript[u, n])(x,t)=(Subscript[b, n])sin(n x)cos(c n t)

Note that the spatial component (Subscript[f, n])(x)=sin(n x) satisfies (Subscript[f, n])''(x)=-(n^2)(Subscript[f, n])(x) together with two boundary conditions (Subscript[f, n])(0)=0 and (Subscript[f, n])(π)=0. Taken together, these conditions form a differential eigenvalue problem and the functions (Subscript[f, n]) are called eigenfunctions. In the context of the wave equation, the eigenfunctions represent fundamental modes of vibration.

Two dimensions

In 2D, the wave equation takes the form

(Subscript[u, t t])=(c^2)(∇^2)u.

A wave problem additionally requires boundary conditions, as well as initial conditions on u and (Subscript[u, t]).

Time dependent vibration

Let’s solve a wave problem over the following region:

region = RegionDifference[
Polygon[{{-2,-2},{2,-2},{2,2},{-2,2}}],
Disk[{0,0},1]];
RegionPlot[region, PlotRange -> {{-3,3},{-3,3}}]

The problem will be completely described by

(Subscript[u, tt])=(∇^2)u
u(x,y,0)=(4-(x^2))(4-(y^2))(((x^2)+(y^2))-1)
(Subscript[u, t])(x,y,0)=0
u(x,y,t)=0 for (x,y) on the boundary of the region .

In Mathematica, that looks like so:

Clear[u];
u[x_,y_,t_] = NDSolveValue[{
Laplacian[u[x,y,t],{x,y}]==D[u[x,y,t],{t,2}],
u[x,y,0] == (4-x^2)(4-y^2)((x^2+y^2)-1),
Derivative[0,0,1][u][x,y,0]==0,
DirichletCondition[u[x,y,t]==0,True]},
u[x,y,t],{x,y}∈region,{t,0,8}]

Let’s generate an animation of the vibration.

pics = Table[Plot3D[u[x,y,t],{x,y}∈region,
BoundaryStyle -> Directive[Thick,Black],
PlotRange->{{-2,2},{-2,2},{-20,20}}],
{t,0,8,0.1}];
ListAnimate[pics,AnimationRunning->False]

The eigenfunctions

The NDEigensystem command generates numerical functions that represent the fundamental modes of vibration.

Clear[u];
{vals, funs} = NDEigensystem[{
-Laplacian[u[x,y],{x,y}],
DirichletCondition[u[x,y]==0,True]},
u[x,y],{x,y}∈region,9];

Table[Plot3D[funs[[k]],{x,y}∈region,
Background->None,Boxed->False,Axes->None,
PlotRange->{{-2,2},{-2,2},{-1,1}},
BoundaryStyle->Directive[Black, Thick]],
{k,1,9}]