406 Chapter 7 Numerical Methods
i
m 01 2 34
0 00 .25 0.50 0.75 1
1 0 0. 25 0. 50 0. 75 0
2 0 0. 25 0. 50 − 0. 25 0
3 0 0. 25 − 0. 50 0. 75 0
4 0 − 0. 75 1. 50 − 1. 25 0
5 0 2. 25 − 3. 50 2. 75 0
Table 5 Unstable solution
lem in any sense. Indeed, they suffer fromnumerical instabilitydue to using a
time step too long relative to the mesh size. The analysis of instability requires
familiarity with matrix theory, but there are some simple rules of thumb that
guarantee stability.
First, write out the equations for eachui(m+ 1 ):
ui(m+ 1 )=aiui− 1 (m)+biui(m)+ciui+ 1 (m).
The coefficients must satisfy two conditions
- No coefficient may be negative.
- The sum of the coefficients is not greater than 1.
In the example, the replacement equations were
u 1 (m+ 1 )=ru 0 (m)+( 1 − 2 r)u 1 (m)+ru 2 (m),
u 2 (m+ 1 )=ru 1 (m)+( 1 − 2 r)u 2 (m)+ru 3 (m),
u 3 (m+ 1 )=ru 2 (m)+( 1 − 2 r)u 3 (m)+ru 4 (m).
The second requirement is satisfied automatically, becauser+( 1 − 2 r)+r=1.
But the first condition is satisfied only forr≤ 1 /2. Thus the first choice of
r= 1 /2 corresponded to the longest stable time step.
Example.
Different problems give different maximum values forr. For the heat conduc-
tion problem
∂^2 u
∂x^2 =
∂u
∂t,^0 <x<^1 ,^0 <t, (10)
u( 0 ,t)= 1 , ∂u
∂x
( 1 ,t)+γu( 1 ,t)= 0 , 0 <t, (11)
u(x, 0 )= 0 , 0 <x< 1 (12)