Math 6630, Spring 2016, Problem Set 2 Due – Monday March 7, 2016. 1) Variable coefficient Poisson problem Consider the scheme 1 h −(L u)j,l ≡ − 2 βj,l−1/2 uj,l−1 + βj−1/2,l uj−1,l + βj+1/2,l uj+1,l + βj,l+1/2 uj,l+1 h − (βj,l−1/2 + βj−1/2,l + βj+1/2,l + βj,l+1/2 )uj,l = fj,l for the variable coefficient Poisson equation −∇ · (β∇v) = f for x ∈ R ≡ [0, 1]2 with homogeneous Dirichlet boundary conditions. Here β(x) is a smooth function that satisifes β(x) ≥ β0 > 0. (Note that Lh is the variable-coefficient analog of the 5 point discrete Laplacian ∆h discussed in class.) The local truncation error of this scheme τ = O(h2 ), that is −Lh v − f = O(h2 ) for the solution v(x) of the differential equation problem. Show that the global error |vj,l − uj,l | = O(h2 ) for all grid points in R. (Hint: Use a maximum principle argument after establishing that a maximum principle holds for Lh .) What can you say about the solvability of the discrete equations −Lh u = f with specfied boundary conditions? 2) Consider the problems 00 −u (x) = ex , (1) for 0 < x < 1, with boundary conditions Set A: u(0) = 1 and u(1) = 0 or Set B: u0 (0) = 1 and u(1) = 0. a) Write a code to solve Eq. 1 using finite-differences with BC Set A. Use the obvious discrete BCs for this problem. Perform a convergence study as the meshsize h is reduced. What is the convergence order? What happens to the convergence order if you mistakenly set the discrete BC at x = 1 to u(1) = h? What happens if instead you mistakenly set the value of the right-hand-side of Eq. 1 at x = 1/2 to e1/2 + h? b) Write a code to solve Eq. 1 using finite differences with BC Set B. For the BC at x = 0, try both options (u1 − u0 )/h = 1 and (−3u0 + 4u1 − u2 )/(2h) = 1, and comment on the rates of convergence for the two choices. What happens to the convergence if you mistakenly set (u1 − u0 )/h = 1 + h? What happens to the convergence if you mistakenly set (−3u0 + 4u1 − u2 )/(2h) = 1 + h? 3) Briggs Chapter 5, problem 8. 4) Briggs Chapter 5, problem 12. 5) Briggs Chapter 5, problem 13. 1 6) Consider the problem −u00 (x) = f (x) (2) for 0 < x < 1 with u(0) = 0 and u(1) = 0. Write a multigrid code that performs V-cycles using weighted-Jacobi relaxation with ω = 2/3, full-weighting restriction, and linear-interpolation. The code should be able to handle at least four grid levels. Test your code with an arbitrary initial guess for the problem with f (x) = 0. How many V-cycles does it take to reduce the initial error by a factor of 105 ? How does this change as h is halved? Read Briggs, Chapter 4 for advice in checking whether your code is performing as it should be. 2