\documentclass{article}
\usepackage{fullpage}
\usepackage[tbtags]{amsmath}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{subfigure}
\newcommand{\bigo}{\ensuremath{\mathcal{O}}}
\newcommand{\XX}{\ensuremath{\mathcal{X}}}
\newcommand{\X}{\ensuremath{x}}
\begin{document}
\begin{center}
{\bf CME306 / CS205B Extra Credit 2 (Theory Track)}
\end{center}
Consider the Poisson equation:
\begin{equation}
\begin{cases}
\nabla\cdot\frac{1}{\rho}\nabla p = \nabla\cdot\mathbf{u}^\star & \mbox{ in $\Omega$} \\
p = p_0(x,y) & \mbox{ on $\partial\Omega_1$} \\
\mathbf{u}\cdot \mathbf{n} = u_0(x,y) & \mbox{ on $\partial\Omega_2$}
\end{cases}
\end{equation}
Where $\partial\Omega_1$ is the region whose boundary conditions are specified as {\em Dirichlet}, and $\partial\Omega_2$ is the region whose boundary conditions are specified as {\em Neumann}. Note that $\partial\Omega_1\cup\partial\Omega_2=\partial\Omega$, the entire boundary of the domain.
Create a $64\times64$ MAC grid for $\Omega=(0,1)\times(0,1)$. Fill the velocity field with random numbers and treat these values as $\mathbf{u}^\star$; then solve the Poisson equation (with your choice of boundary conditions). Apply the resulting pressure to $\mathbf{u}^\star$ in order to get a divergence-free velocity field, and submit plots of the initial condition, the pressure, and the resulting velocity field. Do this for $4$ different velocity fields, with a variety of choices for the boundary conditions.
You can (and should) take $\rho$ to be constant. You must consider several different choices of $\partial\Omega_1$ and $\partial\Omega_2$, including at least one which has $\partial\Omega_1=\emptyset$ (i.e.\ the boundary must be all Neumann). You are encouraged to use Matlab, which provides the backslash operator ``$\backslash$'' -- this makes solving a linear system of equations $Ax = b$ to be a simple call: ``$x=A\backslash b$''.
Submit these plots (there should be 12 in total), along with a short (one to two page) description of your implementation, and your sourcecode. In your write-up, you should prove that the boundary conditions on $\partial\Omega_2$ are equivalent to first {\em setting} $\left.\mathbf{u}^\star\cdot\mathbf{n}\right|_{\partial\Omega_2} = \left.u_0\right|_{\partial\Omega_2}$ and then solving the Poisson equation with $\nabla\cdot p=0$.
\end{document}