412 Chapter 7 Numerical Methods
i
m 01234
0 00000
1 0 0. 50. 50. 5 0
2 0 1. 21 1. 71 1. 21 0
3 0 1. 21 1. 91 1. 21 0
4 0 0. 00 0. 00 0. 00 0
5 0 − 2. 21 − 2. 91 − 2. 21 0
6 0 − 3. 62 − 5. 12 − 3. 62 0
7 0 − 2. 91 − 4. 33 − 2. 91 0
Table 8 Numerical solution of Eqs. (10)–(12)
(noteui( 0 )=0), with the replacement initial condition
ui( 1 )−ui(− 1 )
2 t =^0 ,
or
ui( 1 )=ui(− 1 )=
1
2
fori= 1 , 2 ,3. Now we have the top two lines of Table 8, and the rest are filled
using Eqs. (14) (with cos(π/ 4 ) 0 .71, and so forth). Entries in italics are given
data.
Thecompleteanalyticalsolutionofthisproblemis
u(x,t)=
32
π^2 tsin(πt)sin(πx)
+^32 π 3
∑∞
n= 3
1 −cos(nπ)
n(n^2 − 1 )
(
cos(πt)−cos(nπt)
)
sin(nπx).
Atx= 1 /2, the sum of the infinite series is 0, so
u
( 1
2 ,t
)
=
32
π^2 tsin(πt).
Comparison of the values of this function at timestmwith the middle column
of Table 8 shows the numerical solution off by a few percent. Note that the
growth inu(x,t)is due to resonance in the physical system, not to numerical
instability.
EXERCISES
1.Obtain an approximate solution of Eqs. (1), (2), and (3) withf(x)≡0and
g(x)≡1. Take x= 1 /4,ρ=1.