ColoState Spring 2016 Math 451 Homework 5 Due Mon. 05/02/2016 Name: CSUID: Problem 1. Write a new Matlab function for generating a uniform triangular mesh Gen_UnfmTriMesh1_RectDom.m by modifying the sample code on the class webpage. In the new function, the nodes are labelled from left to right and then from bottom to top. Use the sample code on the class webpage to plot your mesh results with nx = 4, ny = 3: show_TriMesh_labels.m Problem 2. Comparison the numerical solutions from FDM and FEM. Consider the Poisson equation −∆u = f on the unit square Ω = [0, 1]2 with the homogeneous Dirichlet boundary condition and f (x, y) = 8π 2 sin(2πx) sin(2πy). Note that you could solve this problem • By the finite difference method on a uniform grid with nx = ny = n interior nodes in both x- and y- directions; • By the finite element method on a uniform triangular mesh with nx = ny = n interior nodes in both x- and y- directions (with node-labeling specified in Problem 1). Make a table to show comparison for each case of n = 4, 8, 16, 32, 64 and observe convergence orders. (1) The maximal absolute difference of the nodal values of the exact solution and the FDM solution; (2) The maximal absolute difference of the nodal values of the exact solution and the FEM solution; (3) The maximal absolute difference of the nodal values of the FDM and FEM solutions; Hint: It is known that the exact solution is u(x, y) = sin(2πx) sin(2πy). Problem 3. Consider the reference triangle K with vertices (0, 0), (1, 0), (0, 1) (oriented counterclockwise) (1) Write down the three Lagrange P1 basis functions ϕi (i = 1, 2, 3); (2) Find the gradients of these three basis functions ∇ϕi (i = 1, 2, 3). Problem 4. Consider the reference triangle K defined in Problem 3. (1) Calculate the 3 × 3 element stiffness matrix [∫ ] ∇ϕi · ∇ϕj dxdy K 1≤i≤3,1≤j≤3 (2) Calculate the 3 × 3 element mass matrix [∫ ] ϕi ϕj dxdy K 1≤i≤3,1≤j≤3 Problem 5. Consider a generic triangle T with three vertices Pi (xi , yi )(i = 1, 2, 3) oriented counterclockwise. Use your Linear Algebra knowledge to establish a mapping from the reference triangle K to this generic triangle so that (0, 0) is mapped to (x1 , y1 ), (1, 0) is mapped to (x2 , y2 ), and (0, 1) is mapped to (x3 , y3 ). Find the Jacobian of this mapping. Problem 6. Implement the third option for the starter solver for the finite difference method for the wave equation. Problem 7. Apply the explicit finite difference method to solve the wave equation utt = uxx for 0 ≤ x ≤ 1, 0 < t < 2 with the homogeneous boundary conditions and initial conditions: u(x, 0) = 0, ut (x, 0) = sin(πx). Consider these three cases of spatial and temporal discretizations: (i). h = 1/10, k = 1/10; (ii). h = 1/20, k = 1/10; (iii). h = 1/20, k = 1/20. Indicate which starter solver you have used. Present graphics results for the numerical solutions and brief explanation. Problem 8. Apply the explicit finite difference method to solve the wave equation utt = uxx for −1 ≤ x ≤ 1, 0 < t < 2 with the homogeneous boundary conditions and initial conditions: u(x, 0) = 1 − |x|, ut (x, 0) = 0. Consider these three cases of spatial and temporal discretizations: (i). h = 1/10, k = 1/10; (ii). h = 1/20, k = 1/10; (iii). h = 1/20, k = 1/20. Indicate which starter solver you have used. Present graphics results for the numerical solutions and brief explanation. Problem 9. Textbook p.666 Computer Problems #2.