Professional Documents
Culture Documents
Another classical example of a hyperbolic PDE is a wave equation. The wave equa-
tion is a second-order linear hyperbolic PDE that describes the propagation of a
variety of waves, such as sound or water waves. It arises in different fields such as
acoustics, electromagnetics, or fluid dynamics. In its simplest form, the wave equa-
tion refers to a scalar function u = u(r,t), r ∈ Rn that satisfies:
∂ 2u
= c2 ∇2 u . (4.1)
∂ t2
Here ∇2 denotes the Laplacian in Rn and c is a constant speed of the wave propaga-
tion. An even more compact form of Eq. (4.1) is given by
2 u = 0 ,
The wave equation for the scalar u in the one dimensional case reads
∂ 2u ∂ 2u
= c2 2 . (4.2)
∂t 2 ∂x
The one-dimensional wave equation (4.2) can be solved exactly by d’Alembert’s
method, using a Fourier transform method, or via separation of variables. To illus-
trate the idea of the d’Alembert method, let us introduce new coordinates (ξ , η ) by
use of the transformation
ξ = x − ct , η = x + ct . (4.3)
35
In the new coordinate system one can write
1
uxx = uξ ξ + 2 uξ η + uηη , utt = uξ ξ − 2 uξ η + uηη ,
c2
and Eq. (4.2) becomes
∂ 2u
= 0. (4.4)
∂ξ∂η
That is, the function u remains constant along the curves (4.3), i.e., Eq. (4.3) de-
scribes characteristic curves of the wave equation (4.2) (see App. B). Moreover, one
can see that the derivative ∂ u/∂ ξ does not depends on η , i.e.,
∂ ∂u ∂u
=0 ⇔ = f (ξ ) .
∂η ∂ξ ∂ξ
utt = c2 uxx , t ≥ 0,
u(x, 0) = f (x) , (4.6)
ut (x, 0) = g(x) .
To write down the general solution of the IVP for Eq. (4.2), one needs to exspress
the arbitrary function F and G in terms of initial data f and g. Using the relation
∂ ∂
F(x − ct) = −c F ′ (x − ct) , where F ′ (x − ct) := F(ξ )
∂t ∂ξ
one becomes:
Hence
Z x Z x
1 1 1 1
F(x) = f (x) − g(y) dy + C, G(x) = f (x) + g(y) dy − C ,
2 2c 0 2 2c 0
where the integration constant C is chosen in such a way that the initial condition
F(x) + G(x) = f (x) is fullfield. Alltogether one obtains:
1 x+ct
1
Z
u(x,t) = f (x − ct) + f (x + ct) + g(y) dy . (4.7)
2 2c x−ct
The first idea is just to use central differences for both time and space derivatives,
i.e.,
j+1 j j−1 j j j
ui − 2ui + ui 2 ui+1 − 2ui + ui−1
= c , (4.8)
△t 2 △x2
or, with α = c△t/△x
u1i − u−1
ut (xi , 0) = g(xi ) = i
+ O(△t 2) .
2△t
u t j+1
3 6kQ
Q
Q
u u Qu tj
Fig. 4.1 Schematical visu-
alization of the numerical
scheme (4.9) for (4.2). q u q t j−1
xi−1 xi xi+1
With gi := g(xi ) one can rewrite the last expression as
u−1 1 2
i = ui − 2△tgi + O(△t ) ,
1
u1i = △tgi + (1 − α 2) fi + α 2 ( fi−1 + fi+1 ) , (4.10)
2
In order to investigate the stability of the explicit scheme (4.9) we start with the
usual ansatz (1.21)
εij+1 = g j eikxi ,
which leads to the following expression for the amplification factor g(k)
After several transformations the last expression becomes just a quadratic equation
for g, namely
g2 − 2β g + 1 = 0 , (4.11)
where
k△x
β = 1 − 2α 2 sin2 .
2
Solutions of the equation for g(k) read
g1,2 = β ± β2 − 1.
p
Notice that if β > 1 then at least one of absolute value of g1,2 is bigger that one.
Therefor one should desire for β < 1, i.e.,
g1,2 = β ± i β 2 − 1
p
and
|g|2 = β 2 + 1 − β 2 = 1 .
That is, the scheme (4.9) is conditional stable. The stability condition reads
k△x
−1 ≤ 1 − 2α 2 sin2 ≤ 1,
2
q q q tj
Fig. 4.2 Schematical visual-
ization of the implicit numeri-
cal scheme (4.12) for (4.2). u u u t j−1
xi−1 xi xi+1
c△t
α= ≤ 1.
△x
One can try to overcome the problems with conditional stability by introducing an
implicit scheme. The simplest way to do it is just to replace all terms on the right
hand side of (4.8) by an average from the values to the time steps j + 1 and j − 1,
i.e,
β g2 − 2g + β = 0
with
k△x
β = 1 + α 2 sin2 .
2
One can see that β ≥ 1 for all k. Hence the solutions g1,2 take the form
1±i 1−β2
p
g1,2 =
β
and
1 − (1 − β 2)
|g|2 = = 1.
β2
That is, the implicit scheme (4.12) is absolute stable.
Now, the question is, whether the implicit scheme (4.12) is better than the explicit
scheme (4.9) form numerical point of view. To answer this question, let us analyse
dispersion relation for the wave equation (4.2) as well as for both schemes (4.9) and
3.5
α=1
3 α=0.8
α=0.2
2.5
α=1
2 α=0.8
ω∆ t/α
α=0.2
1.5
Fig. 4.3 Dispersion relation
for the one-dimensional wave 1
ω = ±ck ,
i.e, all Fourier modes propagate without dispersion with the same phase velocity
ω /k = ±c. Using the ansatz uij ∼ eikxi −iω t j for the explicit method (4.9) one obtains:
One can see that for α → 0 both methods provide the same result, otherwise the
explicit scheme (4.9) always exceeds the implicit one (see Fig. (4.3)). For α = 1 the
scheme (4.9) becomes exact, while (4.12) deviates more and more from the exact
value of ω for increasing α . Hence, for Eq. (4.2) there are no motivation to use
implicit scheme instead of the explicit one.
4.1.3 Examples
Example 1.
Use the explicit method (4.9) to solve the one-dimansional wave equation (4.2):
u(0, t) = 0 u(L, t) = 0 .
2
u
−2
25
20
15
t
10
Fig. 4.4 Space-time evolution
of Eq. (4.15) with the initial 5 10
8
distribution u(x, 0) = sin(π x), 2
4
6
0 x
ut (x, 0) = 0. 0
Example 2.
Solve Eq. (4.15) with the same boundary conditions. Assume now, that initial dis-
tributions of position and velocity are
0, x ∈ [0, x1 ];
u(x, 0) = f (x) = 0 and ut (x, 0) = g(x) = g0 , x ∈ [x1 , x2 ];
0, x ∈ [x2 , L] .
Use the explicit method (4.9) to solve the wave equation for a vibrating string:
u(0,t) = 0 u(L,t) = 0 .
0 0 0
−1 −1 −1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
0 0 0
−1 −1 −1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Fig. 4.6 Standing waves in a string. The fundamental mode and the first five overtones are shown.
The red dots represent the wave nodes.
4.2 The Wave Equation in 2D
4.2.1 Examples
4.2.1.1 Example 1.
Use the standart five-point explicit method (4.9) to solve a two-dimansional wave
equation
utt = c2 (uxx + uyy ), u = u(x, y,t)
on the rectangular domain [0, L] × [0, L] with Dirichlet boundary conditions. Other
parameters are:
Space interval L=1
Space discretization step △x = △y = 0.01
Time discretization step △t = 0.0025
Amount of time steps T = 2000
Initial condition u(x, y, 0) = 4 x2 y (1 − x) (1 − y)
Numerical solution of the problem for two different time moments t = 0 and t = 500
can be seen on Fig. (4.7)
t =0 t = 500
Fig. 4.7 Numerical solution of the two-dimensional wave equation, shown for t = 0 and t = 500.