Lab assignment 1: Due Friday April 3, 18:00 EDT

For this assignment, you will need a set up to work with Python code, in particular, to develop Jupyter notebooks, as well as a GitHub account to share your notebooks.

We will solve the following boundary value problem by a finite element method. $$\begin{cases} -\Delta u = f&\textrm{in}\,\,\Omega,\\ u = g &\textrm{on}\,\,\partial\Omega. \end{cases}\qquad\qquad(*)$$

Part 1: Implementation

Reference: J. Alberty, C. Carstensen & S.A. Funken. Remarks around 50 lines of Matlab.
• Taking inspiration from the reference, implement an affine finite element method for the Poisson equation in 2D.
• Your code should be able to handle at least one convex domain (such as a square or a triangle), and a domain with a reentrant corner (such as an L-shaped domain).
• It should also be able to handle inhomogeneous Dirichlet boundary conditions.
• Implement either the red refinement or a bisection procedure for mesh subdivision.

Part 2: Numerical experiments

1. Pick a convex domain $\Omega$ and a smooth function $u$, and compute $f=-\Delta u$ in $\Omega$. Then solve (*) with $f$ just computed and with $g=u|_{\partial\Omega}$, on several grids with decreasing meshsize.
2. Plot the $H^1$-error of the finite element solution against the meshsize $h$ on a logarithmic scale, and estimate the convergence rate $\alpha$ in $error\sim h^\alpha$ from the graph. Is it consistent with theory?
3. Repeat the preceding exercise for the $L^2$-error of the finite element solution. Explain the results.
4. Repeat the preceding 3 exercises for a smooth function $u$ on a domain with a reentrant corner. Explain the results.
5. In a domain with a reentrant corner, consider a solution of the form $u(r,\theta)=r^a\sin(a\theta)$, where the coordinate origin is at the reentrant corner, and the rays $\theta=0$ and $\theta=\pi/a$ correspond to the two sides of the corner. For example, for an L-shaped domain, we would have $a=\frac23$. This is the function from Assignment 1, Problem 5. Repeat exercises 1–3. If your code allows, experiment with a couple of different values of $a$, that is, with different values of the reentrant angle. Explain the results.

How and what to submit

Please submit links to your Jupyter notebooks on GitHub by email, before Friday April 3, 18:00 EDT.
• Include theory and commentaries in your Jupyter notebooks, by using Markdown cells.
• Notebooks without sufficient commentaries will not be accepted.
• You can update your notebooks up to the time limit, but please do not commit any overdue updates.
The subject line of the email should be:
• [Math 579 Lab 1] Yourname