18.336 Homework 3 :: Spring 2010 :: Due April 15

advertisement
18.336 Homework 3 :: Spring 2010 :: Due April 15
1. (10 pts) Consider the PDE
ut = ±uxxxx ,
x ∈ R,
with initial condition u(x, 0) = u0 (x).
(a) What sign should you choose in ± to obtain stable solutions? Justify.
(b) For this choice of sign, the Euler explicit method still would not be an efficient time-stepping
scheme (regardless of the discretization of the spatial derivatives, and disregarding boundary
conditions). Very briefly describe why that is the case, and what you would do to remedy the
problem (again, disregarding boundary conditions).
Biharmonic diffusion is sometimes used as a physical dissipation mechanism in fluid mechanics, to
damp high frequencies proportionately more so than regular diffusion does.
2. (30 pts) Consider the system of equations
ut = α2 ∆u + f (u) − σv,
τ vt = α2 ∆v + u − v,
where
f (u) = λu − u3 − κ.
This is called the FitzHugh-Nagumo model. In ODE form (when α = 0), it is a model for neuron firing
that has a limit cycle for some values of the parameters. As a PDE, it is an example of a reactiondiffusion system. It is not unlike the Allen-Cahn equation on p.137 of Trefethen’s book.
Consider the numerical values
λ = 14,
κ = 2.5,
σ = 9,
τ = 0.5,
α = 0.02.
For the spatial variables let (x, y) ∈ [0, 1]2 , with periodic boundary conditions. Consider the initial
condition
" 4 4 #
y − 0.5
x − 0.5
−
,
u0 (x, y) = −2 + 4 exp −
4α
2α
and v0 (x, y) = 0.
(a) Solve this system of equations numerically with a method that discretizes the Laplacian via the
discrete Fourier transform. Explain your choice of ∆t. Show a picture of what you believe is the
solution in the steady state.
(b) For fixed time T , large enough for the solution to have reached the steady state regime, test
convergence of the numerical approximation to
Z
E(T ) =
u2 (T, x, y)dxdy
[0,1]2
as the grid spacing tends to zero, i.e. plot the log of this quantity as a function of log h. Repeat this
convergence test for the numerical method that uses the 5-point Laplacian instead. Comment
on the orders of accuracy of both methods.
(c) (Bonus, 10 pts.) Explicit time-stepping schemes may be convenient but quite slow for this problem. In two or more dimensions, implicit schemes are harder to implement because the matrices
to invert are not simply tridiagonal. Some time ago, Peaceman and Rachford found a smart way
around this issue via a method they called “alternating direction implicit”, explained in section 9.8
of LeVeque’s 2007 book. Implement this refinement. Document the speed gain and explain how
much larger you can now take the time step.
3. (60 pts) The hyperbolic system for 2D acoustics considered in homework 2 is
ut = −px ,
vt = −py ,
pt = −ux − vy .
Consider the same domain, initial conditions, and boundary conditions as previously.
(a) Implement a spectral method for this problem, by discretizing the equation on a tensor-product
Chebyshev grid and computing the derivatives using the idea of Chebyshev polynomials.
(b) Test convergence numerically as the grid is refined, i.e. produce a plot of the log of the error
for the solution at time T = 0.75 as a function of the number of gridpoints per dimension. Do
you observe “spectral” accuracy? Show the corresponding curve for a finite difference method of
your choice, on the same plot.
(c) The better comparison between spectral and FD methods is as follows. Fix N , the number of grid
points per dimension, to be a reasonable power of 2 like 64 or 128. Consider the initial condition
p0 (x, y) = sin(Bπx) sin(Bπy),
u0 (x, y) = v0 (x, y) = 0,
for various integer values of B, so that the explicit solution is a known standing wave. Produce a
plot of the log of the error of the solution at time T = 0.75, as a function of B, both for the spectral
method and a finite difference method. Draw a conclusion concerning the number of points per
wavelength that each method requires in order to get a fixed error level like 10−3 (3 digits).
(d) (Bonus, 5 points). Same plot as above, but with a fourth-order method or better in time.
The baseline for grading will be half credit if instead of solving the full acoustic system, you only solve
the equation for p (that’s ptt = ∆p with homogeneous Dirichlet boundary conditions.) Indicate on your
copy in case you choose to go this way. As usual, please include a printout of your codes in what you
turn in.
Download