18.303 Problem Set 5 Solutions Problem 1: (2+(5+10)+5) points)

advertisement
18.303 Problem Set 5 Solutions
Problem 1: (2+(5+10)+5) points)
(a) There are many possibilities of course, two of which are shown in Fig. 1. If c(x) < 0 everywhere, then it just
needs to decay fast enough to be integrable. If c(x) varies in sign, then the negative parts have to have a bigger
integral than the positive parts.
(b) Here:
(i) The (weak) derivative of u = e−|x|/L is u0 = ∓ L1 e−|x|/L for x > 0 (+) and x < 0 (−) respectively. For this
specific c(x) = −1 for x ∈ [−1, 1] and c(x) = 0 and this u(x) the numerator of the Rayleigh quotient (using
the fact that the integrand is an even function of x) is then:
ˆ ∞
ˆ 1
1
2
−2x/L
−2x/L
−2/L
e
dx
−
2
e
dx
=
−
L
1
−
e
,
L2 0
L
0
which is < 0 if 1 < L2 (1 − e−2/L ). This is obviously true for sufficiently large L, for example for L > 2.
(You were not required to find the precise point at which 1 = L2 (1 − e−2/L ), but you can easily solve
this transcendental equation with Julia to find that the Rayleigh quotient is < 0 for any L > L0 where
L0 ≈ 1.091032973014873. Any L0 bigger than this is acceptable as an answer.)
(ii) The numberator of the Rayleigh quotient is now
ˆ ∞
ˆ ∞
ˆ ∞
1
2
−2x/L
−2|x|/L
e
dx +
c(x)e
dx = +
c(x)e−2|x|/L dx.
L2 0
L
−∞
−∞
If we take the limit as L → ∞, then the first term is zero and the second term is
ˆ ∞
ˆ ∞
ˆ ∞
h
i
lim
c(x)e−2|x|/L dx =
c(x) lim e−2|x|/L dx =
c(x)dx < 0
L→∞
−∞
L→∞
−∞
−∞
by definition of c(x). Hence, for a sufficiently large finite L , the denominator must be < 0 and we have a
negative eigenvalue.
We were able to interchange the limit with the integration because of Lebesgue’s dominated convergence
theorem, since
c(x)e−2|x|/L ≤ |c(x)|
´∞
and −∞ |c(x)| dx is finite by the definition of c(x).
(c) Suppose Âu0 = λ0 u0 with λ0 < 0.√Evaluating this equation for |x| > X where c(x) = 0, we find −u000 = λ0 u0 . The
√
solutions to this equation are e± −λ0 x , noting that −λ0 is real. Excluding
solutions that grow exponentially
√
as |x| → ∞, this means that we must have u0 (x) proportional to e− −λ0 |x| for |x| > X, i.e. u0 is exponentially
decaying.
1.0
0.5
negative everywhere
varies in sign
possible c(x)
0.0
0.5
1.0
1.5
2.0 3
2
1
1
0
2
x
Figure 1: Two possible c(x) satisfying
´∞
1
−∞
3
4
c(x) < 0 and
5
´∞
−∞
|c(x)|dx < ∞.
ui,j+1 vi+0.5,j+1 ui+1,j+1
wi,j+0.5
wi+1,j+0.5
ui,j vi+0.5,j
ui+1,j
Figure 2: Diagram of grid to compute (v, w) = ∇u.
Problem 2: (10+10+10 points)
The answers to this problem are summarized here, but are mostly in an IJulia notebook posted along with the solutions.
(a) As seen in the notebook, we compute the first eigenvalue to about 1% accuracy compared to the analytical
solution. However, this accuracy only decreases (roughly) linearly with ∆x, i.e. first-order convergence. The
reason for this is that we are making a first-order error in the boundary conditions: the Dirichlet boundary
condition is imposed at points on a square grid which are ∼ ∆x away from the true boundary of the circular
domain.
∂/∂x
(b) The G matrix should compute the gradient, i.e. it should be a discretized
. Let’s call the result of
∂/∂y
this operation (v, w) = ∇u. If u(x, y) is discretized at the points umx ,my = u(mx ∆x, my ∆y), then we want
to discretize v(x, y) at vmx +0.5,my = v([mx + 0.5]∆x, my ∆y) in order to be able to use the center-difference
approximation:
umx +1,my − umx ,my
vmx +0.5,my ≈
.
∆x
Similarly, we want to discretize w(x, y) at wmx ,my +0.5 to use the center-difference approximation
wmx ,my +0.5 ≈
umx ,my +1 − umx ,my
.
∆y
A diagram of these grid locations is shown in Figure 2. If these operations are described by 1d finite-difference
matrices Dx and Dy , respectively, then G should be the matrix:
Iy ⊗ Dx
G=
,
Dy ⊗ Ix
using the Kronecker products as in class, where Iy is the Ny × Ny identity matrix and Ix is the Nx × Nx identity
matrix. Just as in 1d from class, Dx is a (Nx + 1) × Nx matrix and Dy is a (Ny + 1) × Ny matrix, hence G is
[(Nx + 1)Ny + Nx (Ny + 1)] × Nx Ny matrix. Just as we obtained ∇2 from −DT D in 1d, we can obtain it in 2d
from −GT G. To discretize ∇ · c∇, we need −GT Cg G where Cg is the diagonal matris
Cv
Cg =
Cw
that multiplies v (via Cv ) and w (via Cw ) by the corresponding c(x, y) values on the two grids.
(c) The results are shown in Figure 3. Compared to the c = 1 case, the solution is more concentrated at small r.
This is consistent with´what we expect
from the min–max theorem, since this eigenfunction “wants” to minimize
´
the Rayleigh quotient c|∇u|2 / |u|2 , so it “wants” to be concentrated in the regions of smallest c(r) = r2 + 1,
and this occurs in the center (small r).
2
0.025
c(r) = r2 +1
c =1
eigenfunctions u0 (r)
0.020
0.015
0.010
0.005
0.0000.0
0.2
0.4
radius r/R
0.6
0.8
1.0
Figure 3: Plot of first eigenfunction u1 (r) of −∇ · c∇, in a unit-radius cylinder with Dirichlet boundary conditions, for
c(r) = r2 + 1 and for c(r) = 1.
3
Download