
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Consider the one-dimensional wave equation
utt(x, t) = c^2 uxx(x, t); 0 < x < L, 0 < t ≤ T ; u(0, t) = u(L, t) = 0; u(x, 0) = f (x), ut(x, 0) = g(x).
Denote by ∆t = τ the step size in time, and by ∆x = h, in space; set m^2 = τ 2 c^2 /h^2 , xi = (i−1)h, i = 1 ,... , M + 1; tj = (j − 1)τ, j = 1,... , N + 1. Note that L = M h = xM +1, T = N τ = tN +1. Write ui,j for the approximation of u(xi, tj ), We approximate utt(xi, tj ) by the central difference at xi:
utt(xi, tj ) ≈
τ 2
(ui,j+1 − 2 ui,j + ui,j− 1 )
and uxx(i∆x, j∆t), by the average of the corresponding central differences at tj+1 and tj− 1 :
uxx(i∆x, j∆t) ≈
h^2
(ui+1,j+1 − 2 ui,j+1 + ui− 1 ,j+1) +
h^2
(ui+1,j− 1 − 2 ui,j− 1 + ui− 1 ,j− 1 )
)
The result is
ui,j+1 − 2 ui,j + ui,j− 1 =
m^2
( (ui+1,j+1 − 2 ui,j+1 + ui− 1 ,j+1) + (ui+1,j− 1 − 2 ui,j− 1 + ui− 1 ,j− 1 )
)
or
−m^2 ui+1,j+1 + 2(1 + m^2 )ui,j+1 − m^2 ui− 1 ,j+1 = 4ui,j + m^2 ui+1,j− 1 − 2(1 + m^2 )ui,j− 1 + m^2 ui− 1 ,j− 1. (1)
With zero boundary conditions, you get u 1 ,j = uM +1,j = 0. For i = 2,... , M, use the initial conditions to get ui, 1 = u(xi, 0) = f ((i − 1)h), ui, 2 ≈ ui, 1 + τ g((i − 1)h) + τ^ 2 2 utt(xi,^ 0); from the equation, utt(xi, 0) = c^2 uxx(xi, 0) = c^2 f ′′(xi) ≈ c^2 (f (ih) − 2 f ((i − 1)h) + f ((i − 2)h))/h^2. Then, for each j+1 = 3,... , N , (1) is a linear system for the unknown vector (u 2 ,j+1,... , uM,j+1), and all you need is to solve this system. The matrix A of this system is of size (M − 1) × (M − 1), with 2(1+m^2 ) on the main diagonal, −m^2 just above and below the main diagonal, and 0 elsewhere. If you write U (j) for the vector-column (u 2 ,j ,... , uM − 1 ,j ), then the system to solve is AU (j + 1) = 4U (j) − AU (j − 1).