Math 6630, Spring 2016, Problem Set 1 Due – Friday Feburary 12, 2016. 1) We often use the eigenvalues and eigenvectors of the discrete Laplacian operator and being able to derive them is important. One way to do this uses the theory of solutions of linear difference equations. Recall that an equation k X aj yn+j = 0 (1) j=0 is called a kth order linear constant coefficient difference equation, and that it has solutions yn = rn where r satisfies k X aj rj = 0. (2) j=0 If the k roots r1 , r2 , ..., rk of (2) are distinct, the general solution of (1) has the form yn = k X cj rjn (3) j=1 for constants c1 , c2 , ..., ck . Consider the discretization −h−2 (uj−1 − 2uj + uj+1 ) = fj , j = 1, ..., N u0 = uN +1 = 0, (4) with (N + 1)h = 1 for −v 00 (x) = f (x) on 0 ≤ x ≤ 1, with boundary conditions v(0) = v(1) = 0. The corresponding eigenvalue problem/eigenvector problem is to find x = (x1 , ..., xN )T 6= 0 and λ such that −h−2 (xj−1 − 2xj + xj+1 ) = λxj , j = 1, ..., N x0 = xN +1 = 0. (5) a) Use the theory described above for solutions of linear difference equations to determine the eigenvalues and eigenvectors for this system. b) Do the same thing for the same difference scheme but with discrete Neumann boundary conditions (u1 − u0 )/h = 0 and (uN +1 − uN )/h = 0. 2) Show that the upwind scheme and Lax-Wendroff scheme for vt + cvx = 0 (with c > 0) can be derived as follows. To determine ujn+1 , trace the characteristic curve in the xt-plane for the PDE back to time level tn . If the CFL condition holds (assume it does), the intersection of the characteristic with the line t = tn will occur between xj−1 and xj . The solution of the PDE at (xj , tn+1 ) is the value of the solution of the PDE at this intersection point. But we don’t know the value at this point if it is not a grid point. Show that the upwind scheme is obtained if this value is interpolated from (xj−1 , unj−1 ) and (xj , unj ), and that the 1 Lax-Wendroff scheme is obtained if the value is interpolated from (xj−1 , unj−1 ), (xj , unj ), and (xj+1 , unj+1 ). 3) vt = vxx , 0 < x < 1 v(0, t) = 1, v(1, t) = 0 ( 1 if x < 0.5 v(x, 0) = 0 if x ≥ 0.5 1. Use Crank-Nicolson with grid spacing h = 0.02 and time step 0.1 to solve the problem up to time t = 1. Comment on your results. What is wrong with this solution? 2. Give a mathematical argument to explain the unphysical behavior you observed in the numerical solution. 3. Experiment with smaller time steps. How small does the time step need to be to get reasonable results? 4. What happens to the numerical solution as k → 0 with the ratio k/h fixed? Explain. Would this same behavior occur using backward Euler in place of Crank-Nicolson? Explain. 4) Derive the modified equation for the Lax-Friedrich’s scheme for vt + cvx = 0 through terms of first order. Compare this modified equation to that for the upwind scheme and make predictions about their relative performance. 5) Write programs to solve the advection equation vt + cvx = 0, on [0, 1] with periodic boundary conditions using upwinding and Lax-Wendroff. For smooth solutions we expect upwinding to be first-order accurate and Lax-Wendroff to be secondorder accurate, but it is not clear what accuracy to expect for nonsmooth solutions. 1. Let a = 1 and solve the problem up to time t = 1. Perform a refinement study for both upwinding and Lax-Wendroff with k = 0.8h with a smooth initial condition. Compute the rate of convergence in the 1-norm, 2-norm, and max-norm. Note that the exact solution at time t = 1 is the initial condition, and so computing the error is easy. 2. Repeat the previous problem with the discontinuous initial condition ( 1 if |x − 1/2| < 1/4 v(x, 0) = 0 otherwise 2 NOTE: See Appendix A LeVeque’s book for information on carrying out a convergence study as asked for in this problem. 6) Consider three-point explicit schemes for the linear advection equation in the real line of the form un+1 = unj − C unj − unj−1 + D unj+1 − unj . j Show that X X n un+1 − un+1 ≤ uj − unj−1 j j−1 j (6) j if C ≥ 0, D ≥ 0, and C + D ≤ 1. When the numerical solution of a scheme satisfies (6) the scheme is total variation diminishing or TVD. Put upwinding and Lax-Wendroff into the above form, and show that upwinding is TVD when it is stable and that Lax-Wendroff is not TVD. Give an interpretation for the meaning of TVD and explain how this relates to the numerical solutions from problem 5. 7) Consider the forward time, centered space discretization un+1 − unj unj+1 − unj−1 unj−1 − 2unj + unj+1 j +a =b , k 2h h2 to the convection-diffusion equation, vt + avx = bvxx , b > 0. 1. Let ν = ak/h and µ = bk/h2 . Use Fourier analysis to show that the scheme is stable if µ ≤ 1/2. 2. Let a = 80, b = 1, h = 0.05. Generate a numerical solution on the spatial domain [0, 1] with periodic boundary conditions using k = 0.25h2 /b with initial condition v(x, 0) = exp(−20(x − 0.5)2 ). What happens? Does your stability analysis predict this? 3. Since the solution to the PDE does not grow in time, it seems reasonable to require that the numerical solution not grow in time. Show that the numerical solution does not grow (in 2-norm) if and only if ν 2 ≤ 2µ ≤ 1. This is called strict or practical stability, and as the name suggests it is the restriction one would use in practice. 4. Generate a numerical solution up to time t = 10−2 . 3