18.303 Problem Set 7 Solutions Problem 1: (10 points)

advertisement
18.303 Problem Set 7 Solutions
Problem 1: (10 points)
As in class, we solve for wn+1 to obtain
h
i
−1
wn+1 = (1 − D∆t/2) (1 + D∆t/2) wn .
Since D is anti-Hermitian, its eigenvalues λ are purely imaginary, i.e. λ = −iω for some real ω. Hence the eigenvalues
of the bracketed term [· · · ] in the equation for wn+1 are of the form
1 + iω∆t/2
.
1 − iω∆t/2
Since the absolute value of this expression is 1 for all real ω, wn+1 cannot blow up for any ∆t—the scheme is
unconditionally stable.
Problem 2: (10+10+5)
We are discretizing
2
∂ u
∂u
=i
+
V
(x)u
.
∂t
∂x2
(Note: the usual Schrödinger equation would have a minus sign in the V term if we interpret V as a potential energy.
However, this doesn’t affect its mathematical nature as a wave equation.)
(a) We can do an explicit leap-frog center-difference scheme if we write u = a + ib and then separate the equations
for the real and imaginary parts a and b:
∂2a
∂b
=
+ V a,
∂t
∂x2
∂a
∂2b
= − 2 − V b.
∂t
∂x
n+0.5
We then discretize this on a staggered grid similar to we did for the scalar wave equation anm and bm
. (Note
that because we are taking the second derivative in space, we only need to stagger the grid in time and not in
space.) Discretizing with center differences, we now obtain
n−0.5
an
− 2anm + anm−1
− bm
bn+0.5
m
= m+1
+ Vm anm ,
∆t
∆x2
+ bn+0.5
bn+0.5 − 2bn+0.5
an+1
− anm
m
m−1
m
= − m+1
− Vm bn+0.5
.
m
∆t
∆x2
That is, we update b and then a, alternately, in the usual leap-frog manner.
(b) To analyze the stability, as in class, it is convenient to first combine these into a single equation, say for a,
analogous to taking a time derivative to obtain an ∂ 2 a/∂t2 = −∂ 4 a/∂x4 equation:
n
an+1
m −am
∆t
−
∆t
n−1
an
m −am
∆t
an+1 − 2anm + an−1
m
= m
=−
∆t2
=−
=−
=−
n+0.5
bm+1
−bn−0.5
m+1
∆t
−2
n
n
an
m+2 −2am+1 +am
∆x2
anm+2 −
n+0.5
bn+0.5
+bn+0.5
m+1 −2bm
m−1
∆x2
bn+0.5
−bn−0.5
m
m
∆t
∆x2
+
−
∆t
n−0.5
bn−0.5
+bn−0.5
m+1 −2bm
m−1
∆x2
n−0.5
bn+0.5
m−1 −bm−1
∆t
n
n
n
an
an −2an
m+1 −2am +am−1
m−1 +am−2
+ m
∆x2
∆x2
∆x2
4anm+1 + 6anm − 4anm−1 + anm−2
.
∆x4
−2
Letting anm = eik∆xm−iω∆tn as in class and dividing through by eikm−iωn , we obtain:
−4 sin2 (ω∆t/2)
2 cos(2k∆x) − 8 cos(k∆x) + 6
2[cos(2k∆x) − 1] − 8[cos(k∆x) − 1]
16 sin2 (k∆x/2) − 4 sin2 (k∆
=−
=−
=−
2
4
4
∆t
∆x
∆x
∆x4
1
4.5
finite−difference
exact
4
3.5
3
ω∆t
2.5
2
1.5
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
k∆x/π
0.6
0.7
0.8
0.9
1
Figure 1: Plot of ω∆t versus k∆x/π for both the numerical dispersion relation (solid blue line) from von-Neumann
analysis of the center-difference scheme and also the exact Schrödinger equation (dashed red line).
or
∆t2 4 sin2 (k∆x/2) − sin2 (k∆x) .
∆x4
This is conditionally stable. In order to be stable, the right hand side must be in [0, 1] so that ω is real. It
is easily verified that 4 sin2 (k∆x/2) − sin2 (k∆x) lies between 0 (for k∆x = 0) and 4 for (k∆x = ±π), so this
sin2 (ω∆t/2) =
2
2
∆t
means that 4 ∆x
4 ≤ 1 or ∆t ≤ ∆x /2 for stability.
2
∆t
81
(c) Let us choose, for example, ∆t = 0.9 · ∆x2 /2, in wich case ∆x
4 = 400 and
r
81 2
−1
ω(k) = ±
sin
4 sin2 (k∆x/2) − sin2 (k∆x) .
∆t
400
Actually, the sign is not arbitrary—we lost some information about the sign of ω by combining the a and b
equations into a single equation that is second-order in time. If we plug u = ei(kx−ωt) into the original equation,
we immediately saw in class that ω = +k 2 , and similarly a closer inspection of the a and b equation turns out to
show that we should choose the positive sign of the square root to obtain a positive ω(k).
For plotting, it is convenient to plot ω∆t as a function of k∆x. The corresponding “exact” formula ω = k 2
∆t
2 9
then becomes ω∆t = (k∆x)2 ∆x
2 = (k∆x) 20 . We compare the two results in figure 1. We can see several
things from the figure. First, the curves coincide for k∆x 1, as they must—the finite-difference scheme
must converge to the exact answer as the wavelength (2π/k) becomes much larger than the grid spacing ∆x.
The finite-difference curve approaches the exact curve from below and has smaller slope at any given ω or k,
so we know that the finite-difference solutions move slower than the exact solutions, with their speed going
to zero (zero slope) as k∆x → π [the “Nyquist frequency” of the grid where the wave is simply u ∼ (−1)m ].
Wave dispersion in the discrete case, furthermore, exhibits some phenomena qualitatively different from that
of the exact solution (although again they coincide in the limit of small k). For example, it is obvious that the
discrete ω(k) has an inflection point where its second derivative changes sign, corresponding to a point where
d2 k/dω 2 = 0 and pulse spreading is very slow. And at k∆x = π the dispersion d2 k/dω 2 diverges, corresponding
to the fact that pulses will spread arbitrarily fast for propagation over a given distance (simply because the pulse
takes longer and longer to travel a given distance because the group velocity is going to zero).
2
Download