408 Chapter 7 Numerical Methods
- ∂
(^2) u
∂x^2
=∂u
∂t
, u( 0 ,t)=0, ∂u
∂x
( 1 ,t)+u( 1 ,t)=1, u(x, 0 )=0.
9.
∂^2 u
∂x^2 =
∂u
∂t,
∂u
∂x(^0 ,t)=0, u(^1 ,t)=1, u(x,^0 )=x.
7.3 Wave Equation
The simple vibrating string problem we studied in Chapter 3,
∂^2 u
∂x^2
=∂
(^2) u
∂t^2
, 0 <x< 1 , 0 <t, (1)
u( 0 ,t)= 0 , u( 1 ,t)= 0 , 0 <t, (2)
u(x, 0 )=f(x),
∂u
∂t(x,^0 )=g(x),^0 <x<^1 , (3)
rarely needs treatment by numerical methods, because the d’Alembert solu-
tion provides a simple and direct means of calculating the solutionu(x,t)for
arbitraryxandt. However, if the partial differential equation containsuor an
inhomogeneity or if the boundary conditions are more complex, a series solu-
tion or a solution of the d’Alembert type may not be practical. In many such
cases, simple numerical techniques are quite rewarding.
In order to convert the wave equation (1) into a suitable difference equa-
tion, we first designate pointsxi=i x( x= 1 /n)and timestm=m tfor
which the approximation touwill be found:u(xi,tm)∼=ui(m). Then the par-
tial derivatives with respect to bothxandtare replaced by central differences:
∂^2 u
∂x^2
→ui+^1 (m)−^2 ui(m)+ui−^1 (m)
( x)^2
,
∂^2 u
∂t^2
→ui(m+^1 )−^2 ui(m)+ui(m−^1 )
( t)^2
.
The wave equation (1) becomes this partial difference equation
ui+ 1 (m)− 2 ui(m)+ui− 1 (m)
( x)^2 =
ui(m+ 1 )− 2 ui(m)+ui(m− 1 )
( t)^2
or, withρ= t/ x,
ui(m+ 1 )− 2 ui(m)+ui(m− 1 )=ρ^2
(
ui+ 1 (m)− 2 ui(m)+ui− 1 (m)
)
.
The replacement equations may be solved for the unknownsui(m+ 1 ),
yielding the equation
ui(m+ 1 )=ρ^2 ui− 1 (m)+ 2 ( 1 −ρ^2 )ui(m)+ρ^2 ui+ 1 (m)−ui(m− 1 ), (4)