Wave Equation
Wave Equation
Wave Equation
s(x2 ) − s(x1 ) = [x2 + u(x2 )] − [x1 + u(x1 )] = (x2 − x1 ) + (u(x2 ) − u(x1 )).
ds
(x) − 1 = ux (x).
dx
Applying the Newton’s law to the section [x1 , x2 ], we have
Z x2
ρ utt (x, t) dx = Eux (x2 , t) − Eux (x1 , t).
x1
Since
Z x2
ux (x2 , t) − ux (x1 , t) = uxx (x, t) dx,
x1
we have
Z x2 Z x2
ρ utt (x, t) dx = E uxx (x, t) dx.
x1 x1
1
2. Solutions consist of traveling waves
Suppose that u(x, t) satisfies the wave equation (1.1). We introduce new
variables
ξ = x + c t and η = x − c t,
and define the function
v(ξ, η) = u(x, t). (2.1)
Then, by the chain rule, we have
ux = vξ ξx + vη ηx = vξ + vη
uxx = vξξ + 2vξη + vηη .
Similarly, we have
utt = c2 (vξξ − 2vξη + vηη ).
Thus, as a consequence of the wave equation (1.1), we have
2
3. Traveling waves solutions of the Cauchy problems
Consider the Cauchy problem of the wave equation (1.1) with initial data
1 1
f0 = (c ϕ0 + ψ) and g 0 = (c ϕ0 − ψ),
2c 2c
and thus, by integration, we have
Z x
1 1
f (x) = c1 + ϕ(x) + ψ(s) ds, (3.6)
2 2c 0
Z x
1 1
g(x) = c2 + ϕ(x) − ψ(s) ds, (3.7)
2 2c 0
where c1 and c2 are integral constants. Since ϕ(x) = f (x) + g(x) (see (3.3)),
by (3.6) and (3.7), we have
c1 + c2 = 0.
3
Example 1. Consider the Cauchy problem
2
utt = c uxx , x ∈ R, t > 0,
u(x, 0) = 0, x ∈ R, (3.9)
u (x, 0) = cos(x), x ∈ R.
t
Notice that here ϕ(x) = 0 and ψ(x) = cos(x), it follows from (3.8) that the
solution to (3.9) is given by
Z x+c t
1 1
u(x, t) = cos(s)ds = (sin(x + c t) − sin(x − c t))
2c x−c t 2c
1
= cos(x) sin(c t).
c
It is interesting to see that the solution separates the variables, i.e. the solution
can be written in the form of separation of variables
u(x, t) = X(x) T (t). (3.10)
4
problems, since the boundary effect must be taken into account. For example,
the waves can not simply travel because of the existence of the boundaries,
they may be absorbed, reflected by the boundaries, and there may be incom-
ing waves traveling into the domain through the boundaries. In general, the
problem is much more complicated because of the boundary effects introduced
by the boundary conditions.
Let us try to find solutions of the form (3.10) to the initial boundary value
problem (4.1). Inserting the ansatz u(x, t) = X(x)T (t) into the wave equation
(4.1a), we obtain
T 00 (t) X 00 (x)
= . (4.2)
T (t) X(x)
Since the left hand side is independent of x, while the right hand side is inde-
pendent of t, both expressions must be independent of x and t, and therefore,
be a constant. That is
T 00 (t) X 00 (x)
= = −λ (4.3)
T (t) X(x)
for a suitable λ ∈ R. In particular, this and the boundary conditions (4.1b)
imply that the functions X(x) are the solutions to the eigenvalue problem
(
−X 00 (x) = λX(x), x ∈ (0, 1),
(4.4)
X(0) = X(1) = 0.
λ = λk = (kπ)2 , k = 1, 2, . . . . (4.6)
5
Thus, the general real solution to the problem (4.7) is of the form
satisfy the wave equation (4.1a) and the boundary conditions (4.1b), and so
do the functions of their linear combinations
N
X
u(x, t) = sin(kπx)(ak cos(kπt) + bk sin(kπt)). (4.10)
k=1
then, at least formally, the solution of the initial-boundary value problem (4.1)
is given by
∞
à !
X b̃k
u(x, t) = sin(kπx) ak cos(kπt) + sin(kπt) . (4.13)
k=1
kπ
6
we have
∞
X 8
x(1 − x) = sin((2k − 1)πx),
k=1
π 3 (2k− 1)3
where the first part is the elastic energy, and the second part is the kinetic en-
ergy. We are going to see how the energy evolves with time. By differentiating
E(t) with respect to t, we obtain
Z 1
0
E (t) = 2 (ux (x, t)uxt (x, t) + ut (x, t)utt (x, t)) dx. (5.2)
0
where the last equality follows from the homogeneous boundary conditions at
x = 0, 1. Inserting this into (5.2) and noticing that u solves the wave equation
(4.1a), we otain
E 0 (t) = 0.
This implies
E(t) = E(0), ∀t ≥ 0. (5.3)
7
Hence, for the wave equation, the mechanical energy E(t) is preserved for all
time. Especially, if at the initial time t = 0, E(0) = 0, then E(t) ≡ 0.
Let u1 and u2 be two solutions of (4.1) with initial data (f1 , g1 ) and (f2 , g2 )
respectively, and let w = u1 − u2 . Then, it is easily verified that w is a solution
of (4.1) with initial data (f1 − f2 , g1 − g2 ). Hence, it follows from (5.3) that
Z 1 Z 1
£ 2 ¤ £ ¤
wx (x, t) + wt2 (x, t) dx = (u1 − u2 )2x (x, t) + (u1 − u2 )2t (x, t) dx
0 0
Z 1 £ ¤
= (f1 − f2 )2x (x) + (g1 − g2 )2 (x) dx. (5.4)
0
This equality implies the stability of the system with respec to the initial data,
more precisely, it states that if the initial data of the solutions are close to each
other, then the solutions will remain close for all time. In particular, it impleas
the following uniqueness result:
Proof. Since the initial data are the same, it follows from (5.4) that u1,x =
u2,x and u1,t = u2,t . Hence, the two solutions can only differ by a constant.
However, since they have the same initial and boundary data, the constant
must be zero, and thus we have u1 ≡ u2 . ¤
8
Suppose that u(x, t) is suffciently smooth, then, we have
Z x2 Z t2
[ut (x, t) + cux (x, t)] dt dx, ∀x1 < x2 , t1 < t2 . (6.2)
x1 t1
ut + cux = 0. (6.3)
The convection equation, also known as the advection equation, may be re-
garded as a first order wave equation. To see this, we introduce a new variable
η = x − c t,
and define
u(x, t) , u0 (x − c t) = u0 (η). (6.4)
Suppose that the function u0 is smooth, then, by the chain rule, we have
ut (x, t) = u00 (η)ηt = −c u00 (η) and ux (x, t) = u00 (η)ηx = u00 (η).
This implies that u(x, t) given by (6.4) satisfies the convection equation (6.3).
Notice that u(x, t) = u0 (x − c t) is a traveling wave moving at speed c, if c > 0,
it moves to the right, and if c < 0, it moves to the left, in particular, at the
initial time t = 0, u(x, 0) = u0 (x). Hence the solution to the initial value
problem of the convection equation
(
ut (x, t) + c ux (x, t) = 0, ∀x ∈ R, ∀t > 0,
(6.5)
u(x, 0) = u0 (x),
dX
(t) = c (6.6)
dt
the characteristic equation of the convection equation (6.3), and we call the
lines satisfying the characteristic equation the characteristic lines.
9
Example 3. For u0 (x) = sin(πx), the solution of the initial value problem of
the convection equation (6.5) is
1 ¡ iπ(x−c t) ¢
u(x, t) = sin(π(x − c t)) = e − e−iπ(x−c t)
2i
= sin(πx) cos(πc t) − cos(πx) sin(πc t).
Notice that the above solution can also be written in the form of a linear
combination of functions with separated variables. This inspired us to try to
solve the convection equation (6.3) by the method of separation of variables,
i.e. to find particular solutions of the form u(x, t) = X(x)T (t). Inserting
u(x, t) = X(x)T (t) into the equation, we obtain
X 0 (x) −1 T 0 (t)
= = iλ,
X(x) c T (t)
X 0 (x) −1 T 0 (t)
= = µ + iλ,
X(x) c T (t)
10
It follows from the suer-position principle, the Fourier series method can be
easily applied to solving the initial value problem of the convection equation.
∞
X
u0 (x) = {ak cos(kπx) + bk sin(kπx)} .
k=1
∞
X
u(x, t) = {ak cos(kπ(x − c t)) + bk sin(kπ(x − c t))}
k=1
∞
X
= {ak [cos(kπx) cos(kπc t) + sin(kπx) sin(kπc t)]
k=1
ut + c ux = 0, ∀x ∈ (0, 1), ∀t > 0,
u(x, 0) = u0 (x), ∀x ∈ (0, 1), (7.1)
u(0, t) = g(t), ∀t > 0.
11
While for c < 0, a proper initial-boundary value problem of the convection
equation is given as
ut + c ux = 0, ∀x ∈ (0, 1), ∀t > 0,
u(x, 0) = u0 (x), ∀x ∈ (0, 1), (7.2)
u(1, t) = g(t), ∀t > 0.
as long as u0 and g are smooth and satisfy certain consistent conditions (for
example, if u0 (0) = g(0) for c > 0 and u0 (1) = g(0) for c < 0, then the above
defined functions are globally continuous).
and
Ujn+1 − Ujn n
Uj+1 − Ujn
+c = 0, if c < 0, (8.2)
4t 4x
Ujn+1 − Ujn
ut (xj , tn ) ≈ ,
4t
12
and ux (xj , tn ) is approximated by the first order backward (c > 0) or forward
(c < 0) finite difference in the space variable x with the space step 4x
Ujn − Uj−1
n n
Uj+1 − Ujn
ux (xj , tn ) ≈ , if c > 0; ux (xj , tn ) ≈ , if c < 0.
4x 4x
The key point here is that the information needed to compute the unknown
Ujn+1 is picked up from the upwind direction.
To see how accurate the convection equation (6.3) is approximated by the
upwind scheme, substitute a smooth solution of the equation into the scheme,
and by applying the Taylor expasions at (xj , tn )
1
un+1
j = unj + 4t ut (xj , tn ) + (4t)2 utt (xj , tn ) + O((4t)3 ),
2
1
unj−1 = unj − 4x ux (xj , tn ) + (4x)2 uxx (xj , tn ) + O((4x)3 ),
2
1
unj+1 = unj + 4x ux (xj , tn ) + (4x)2 uxx (xj , tn ) + O((4x)3 ),
2
we obtain
un+1
j − unj unj − unj−1 1
+c = [ut + c ux ]nj + [4tutt − 4xc uxx ]nj
4t 4x 2
+ O((4t)2 + (4x)2 ), if c > 0, (8.3)
un+1
j − unj unj+1 − unj 1
+c = [ut + c ux ]nj + [4tutt + 4xc uxx ]nj
4t 4x 2
+ O((4t)2 + (4x)2 ), if c < 0, (8.4)
In fact, for any smooth function u(x, t), donote r = 4t/4x, denote 4+x and
4−x the first order forward and backward finite difference operators for the
space variable, denote 4+t the first order forward finite difference operator for
the time, we have
£ ¤
((4t)−1 4+t + c (4x)−1 4−x ) − (∂t + c ∂x ) unj
1
= − c 4x (1 − c r) [uxx ]nj + O((4x)2 ), if c > 0. (8.5)
2
13
£ ¤
((4t)−1 4+t + c (4x)−1 4+x ) − (∂t + c ∂x ) unj
1
= c 4x (1 + c r) [uxx ]nj + O((4x)2 ), if c < 0, (8.6)
2
It follows from the definition that the truncation error of the upwind scheme
of the convection equation is O(4x), and the leading term of the truncation
error is
1
− 4x|c|(1 − |c| r)uxx . (8.7)
2
4t
0 ≤ |c| = |c| r ≤ 1. (8.8)
4x
Recall that the convection equation has traveling wave solutions eikπ(x−c t) ,
k = 0, 1, 2, · · · , as a sequence of particular solutions (see (6.7)). We may as
well work out a sequence of particular solutions that a finite difference scheme
has, and compare them with the corresponding traveling wave solutions. We
seek solutions of separation of variables of the form
arg(λk )
Ujn = λnk eikπj4x = |λk |n eikπ(j4x+ c kπ 4t c n4t) .
14
Substitute it into the upwind scheme (8.1) and (8.2), we see that the amplifi-
cation factor λk must satisfy
This yields
hence the corresponding particular solution Ujn = λnk̂ eik̂πj4x grows exponen-
tially fast. Noticing that this is also the fastest growing frequency, we con-
clude that in such a case the numerical solutions are unstable and will soon
be dominated by the exponentially growing mesh size oscillation, since errors
with all frequencies will inevitably appear in numerical computations.
On the other hand, if |c| r < 1, then, it follows from (8.10) that there exists
damping effect for all frequencies, and the higher the frequency the stronger
1
the damping effect (for k ≤ k̂ = 4x
). For low frequencies with k4x ¿ 1, since
sin kπ4x ≈ kπ4x in such a case, we have
1
|λk | ≈ 1 − |c| r(1 − |c| r)k 2 π 2 (4x)2 ,
2
which means a drop of the amplitude by O((4x)2 ) in each time step. Compare
with the corresponding traveling wave solutions, we see that the amplitude of
the numerical solutions has a global error of O(4x).
15
To see how accurate the numerical solution recovers the speed of the travel-
ing waves, we need to calculate arg(λk ), which represents the phase increment
in a time step. By (8.9), we have
µ ¶
− sign(c) |c| r sin kπ4x
arg(λk ) = arctan . (8.12)
(1 − |c| r) + |c| r cos kπ4x
For low frequencies with k4x ¿ 1, by Taylor expansion, we have
· ¸
1 2
arg(λk ) = − sign(c) |c| rkπ4x 1 − (1 − |c| r)(1 − 2|c| r)(kπ4x) + · · ·
6
· ¸
1 2
= −c kπ4t 1 − (1 − |c| r)(1 − 2|c| r)(kπ4x) + · · · .
6
Hence, the corresponding wave travels at speed
· ¸
1 2
ck = c 1 − (1 − |c| r)(1 − 2|c| r)(kπ4x) + · · · . (8.13)
6
This shows that the error of the speed (or the phase angle) is O((k4x)2 ).
Compare with the error of the amplitude, which is O(k4x), this is almost
negligible. We also notice that, for ν = c r < 21 , ck < c, this correspond to a
phase lag, while for ν = c r > 12 , ck > c, this correspond to a phase adavance.
Remark 8.1. The upwind scheme can be modified to obtain higher order finite
difference schemes. For example, we may use the second order central finite
difference operator to replace the second order differential operator in (8.5) or
(8.6). Since
unj+1 − 2unj + unj−1
2
= [uxx ]nj + O((4x)2 ),
(4x)
the induced finite difference scheme
1 1
Ujn+1 = c r(1 + c r)Uj−1
n
+ (1 − c2 r2 )Ujn − c r(1 − c r)Uj+1
n
, (8.14)
2 2
known as the Lax-Wendroff Scheme, is of order ((4x)2 ). It can be shown that,
for the Lax-Wendroff scheme, the global error of the amplitude is O((k4x)3 ),
while the error of the speed (or the phase angle) is O((k4x)2 ). Obviously, in
this case, compared with the error of the speed, the error of the amplitude is
16
almost negligible. In other words, for the Lax-Wendroff scheme, the error of
the speed is of main concern. In fact, we may observe some artificial oscilla-
tions in numerical solutions, which is caused by the numerical dispersion (a
phenomenon which reflects the fact that waves of different frequencies travel
in different speed).
Remark 8.2. Let a linear numerical scheme of the convection equation be given
as
U n+1 = N (U n )
with the truncation error
un+1 − N (un )
τn = .
4t
Let en = un −U n be the error of the numerical solution. Suppose, the numerical
scheme is stable in the sense that
kN (V )k ≤ kV k, ∀4x > 0 and for all mesh function V ,
4t
whenever the ratio of the mesh size r = 4x
satisfies a certain specified stability
condition. Then, we have
This implies that, for a stable linear numerical scheme, the error of the numer-
ical solution is of the same order as its truncation error, provided its initial
data is approximated accordingly.
In the stability analysis using Fourier modes, the norm kU n k = kU n k2 ,
P
( j |Ujn |2 4x)1/2 is used. The idea can be easily applied to other equations and
P
other norms. For example, L1 -norm kU n k1 , ( j |Ujn |4x)1/2 and L∞ -norm
kU n k∞ , supj |Ujn |.
Remark 8.3. CFL condition is a necessary condition for the stability. However,
in genergal, it is not a sufficient condtion. For example, the scheme using the
central difference instead of the one-sided upwind difference is always unstable.
17
9. Finite difference method for the wave equation
Naturally, using the second order central finite difference operator to ap-
proximate the second order differential operators for both the time and the
space variables, we obtain the following second order finite difference scheme
for the wave equation
or
Ujn+1 = ν 2 Uj−1
n
+ 2(1 − ν 2 )Ujn + ν 2 Uj+1
n
− Ujn−1 , (9.2)
1 1
u(xj , s) = u(xj , 0) + s ut (xj , 0) + s2 utt (xj , 0) + s3 uttt (xj , 0) + O(s4 )
2 6
1 1
= f (xj ) + s g(xj ) + s2 c2 uxx (xj , 0) + s3 c2 uxxt (xj , 0) + O(s4 )
2 6
1 1
= f (xj ) + s g(xj ) + s2 c2 fxx (xj ) + s3 c2 gxx (xj ) + O(s4 ).
2 6
Recall that there are two traveling waves with speed c and −c, so there
are two characteristic lines (X 0 = ±c) passing through each point (x, t) (see
also the form of the d’Alembert solution (3.8)), hence the CFL condition for
the scheme (9.1) is
c 4t
ν , cr = ≤ 1. (9.4)
4x
18
We may also seek solutions of separation of variables of the form
arg(λk )
Ujn = λnk eikπj4x = |λk |n eikπ(j4x+ c kπ 4t c n4t) .
Substitute it into the scheme (9.2), we see that the amplification factor λk
must satisfy
|λ+ −
k | ≤ 1 and |λk | ≤ 1 ⇔ sk ≤ 4. (9.7)
Proof. If sk = 0, then λ± ±
k = 1. If sk = 4, then λk = −1.
λ+
k = ρk e
i θk
and λ−
k = ρk e
−i θk
for some ρk > 0 and θk ∈ (0, π). Furthermore, it follows from (9.5) that the
product of the roots is 1, i.e.
λ+ − 2
k λk = ρk = 1.
Hence, |λ+ −
k | = |λk | = ρk = 1.
If sk > 4, then λ+ − + −
k and λk are two distinct real roots satisfying λk λk = 1.
Hence, one of them must have absolute value greater than 1. ¤
19
amplitude of the traveling waves (unlike the upwind scheme for the convection
equation). On the other hand, we have
q
2ν sin 21 kπ4x 1 − ν 2 sin2 21 kπ4x
arg λ±
k = ± arctan
1 − 2ν 2 sin2 12 kπ4x
µ ¶
1
= ±c kπ4t 1 − (1 − ν 2 )(kπ4x)2 + · · · . (9.8)
24
Hence, in general, the error to the speed (the relative phase error) is O((k4x)2 ),
and the numerical waves always travel at speeds slower than that of the an-
alytical waves. Since there is no damping, the phase lag effect of the scheme
should be apparently observable in certain cases.
We may also consider the implicit finite difference schemes of the wave
equation (1.1) in the following form
"
Ujn+1 − 2Ujn + Ujn−1 2
n+1
Uj+1 − 2Ujn+1 + Uj−1
n+1
= c θ
(4t)2 (4x)2
#
n−1
n
Uj+1 n
− 2Ujn + Uj−1 Uj+1 − 2Ujn−1 + Uj−1
n−1
+(1 − 2θ) +θ , (10.1)
(4x)2 (4x)2
into the scheme (10.1), we obtain the equation for the amplification factor
¡ ¢
λ2k − 2λk + 1 = (θν 2 λ2k + (1 − 2θ)λk + θν 2 ) eikπ4x − 2 + e−ikπ4x ,
20
or equivalently
µ ¶
4ν 2 sin2 12 kπ4x
λ2k − 2− λk + 1 = 0. (10.2)
1 + 4θν 2 sin2 12 kπ4x
4ν 2 sin2 21 kπ4x
Denote sk = 1+4θν 2 sin2 21 kπ4x
, and by Lemma 9.1, we conclude that the scheme
(10.1) is stable if
(
(1 − 4θ)ν 2 ≤ 1, ∀θ ∈ (0, 14 );
(10.3)
unconditional, ∀θ ∈ [ 41 , 1].
U n+1 = An U n + bn .
To show the stability, we only need to check that, for some matrix norm k · k,
Q
there exists a constant C such that k ni=0 Ai k ≤ C, for all n. For example, if
Ai = A for all i, then, we only need to show that
kAn k ≤ C, ∀n.
21
In particular, if
kAk ≤ 1,
then, the scheme is stable.
Notice that for different mesh size 4x, the size of the matrix A is also
different, and its norm kAk is in general a function of 4x and 4t.
22