\documentclass[11pt,letterpaper]{article}

\usepackage{fullpage}
\usepackage{amsmath}
\newcommand{\uu}{\mathbf{u}}
\newcommand{\uuh}{\hat{\uu}}
\newcommand{\MM}{\mathbf{M}}
\newcommand{\vv}{\mathbf{v}}
\newcommand{\dvv}{\Delta\vv}
\newcommand{\vvh}{\hat{\vv}}
\newcommand{\dvvh}{\hat{\Delta\vv}}
\newcommand{\xx}{\mathbf{x}}
\newcommand{\dxx}{\Delta\xx}
\newcommand{\xxh}{\hat{\xx}}
\newcommand{\dxxh}{\hat{\Delta\xx}}
\renewcommand{\AA}{\mathbf{A}}
\newcommand{\BB}{\mathbf{B}}
\newcommand{\nn}{\mathbf{n}}
\newcommand{\DD}{\mathbf{D}}
\newcommand{\GG}{\mathbf{G}}
\newcommand{\LL}{\mathbf{L}}
\newcommand{\FFh}{\hat{\FF}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\ww}{\mathbf{w}}
\newcommand{\z}{\mathbf{0}}
\newcommand{\gp}[1]{{\left({#1}\right)}}
\newcommand{\ip}[1]{{\left\langle{#1}\right\rangle}}
\newcommand{\mx}[1]{\gp{\begin{array}{c} #1 \end{array}}}
\newcommand{\dd}[2]{\frac{d{#1}}{d{#2}}}

\begin{document}

\title{CS 205b / CME 306}
\author{Application Track}
\date{Homework 9}
\maketitle

\begin{enumerate}
\item Let $\ip{\uu,\vv}$ and $\ip{\uu,\vv}_\rho$ denote the two inner products defined by
$$ \ip{\uu,\vv} = \int_\Omega \uu \cdot \vv \,dV \quad\quad \ip{\uu,\vv}_\rho = \int_\Omega \rho \uu \cdot \vv \,dV, $$
where $\uu \cdot \vv$ denotes the standard pointwise dot product, and $\rho$ is the density.  The two new inner products take two vector fields to produce a single scalar.  The dot
product is well-defined for vectors of any dimension.  You may assume for this assignment that all fields have as many derivatives defined as desired.  By regarding scalars as 1D
vectors, the above inner products can also be defined for scalar fields such as pressure.  If $\uu$ is the velocity, what is $\frac{1}{2} \ip{\uu,\uu}_\rho$?
\item Let $\GG$ and $\DD$ be the operators defined by
$$ \GG : \phi \to \frac{1}{\rho} \nabla \phi \quad\quad \DD : \uu \to \frac{1}{\rho} \nabla \cdot \uu. $$
Show that the operators $\GG$ and $\DD$ are linear operators.
\item The linear operator $\BB$ is said to be the transpose of the linear operator $\AA$ with respect to an inner product $(\cdot,\cdot)$ if for any vectors $\uu$ and $\vv$, it is true
  that $(\BB \uu,\vv) = (\uu,\AA \vv)$.  Show that this definition of a transpose corresponds precisely to the definition of a matrix transpose (even for non-square matrices) when the
  standard inner product is used: $(\uu, \vv) = \uu^T \vv$.
\item Show that the operator $-\DD$ is the transpose of $\GG$ with respect to the inner product $\ip{\cdot,\cdot}_\rho$ if and only if a particular boundary condition is satisfied, and
  find that boundary condition.  The boundary condition should not contain any volume integrals.
\item Show that both Dirichlet and Neumann boundary conditions satisfy this boundary condition.  (Hint: write out the boundary condition obtained in the previous question with pressure
  and velocity as the two arbitrary fields.  Then, show that Dirichlet and Neumann boundary each suffice.  Take Dirichlet to imply $p=0$ at the boundary and Neumann to imply $\uu \cdot
  \nn$ at the boundary.)
\item A linear operator is said to be symmetric with respect to an inner product if it equals its transpose with respect to that inner product.  Show that $\DD \GG$ is symmetric with
  respect to $\ip{\cdot,\cdot}_\rho$.  You may assume for this and all subsequent problems that suitable boundary conditions will be met.
\item Show that the operator $\LL$ defined by
  $$ \LL : \phi \to \nabla \cdot \gp{\frac{1}{\rho} \nabla \phi} $$
  is symmetric with respect to the inner product $\ip{\cdot,\cdot}$.

  A few \textit{rules of thumb} might be taken from what has been shown above, even though you have not considered discretizations.
  \begin{itemize}
  \item It was not an accident that the Poisson equation obtained in class was symmetric negative semidefinite.  In particular, when discretized, the gradient and divergence operators
    will be matrices.
  \item If suitable boundary conditions are not used, the Poisson operator will not be symmetric.
  \item Provided suitable boundary conditions are applied, there will be a \textit{preferred} discretization of divergence corresponding to any discretization of gradient which will
    result in a symmetric negative definite system, and the two discretizations, written as matrices, will be negative transposes of each other.
  \item Once you have chosen a discretization for gradient or divergence, the negative transpose relationship can be used to derive the other discretization.
  \end{itemize}

\item What are you doing for your final project?  (This question is optional if you are not taking the application track or receive project approval from the CA by email prior to the due
date of this assignment.)  This question will be graded.
\item In 3D, there are three \textit{special} spatial derivatives: gradient, curl, and divergence.
  \begin{itemize}
  \item Show that the curl of a gradient is identically zero.
  \item Show that the divergence of a curl is identically zero.
  \item Assume that a vector field $\uu$ can be decomposed as $\uu = \nabla \phi + \nabla \times \ww$.  Show that $\phi$ can be obtained by solving Poisson's equation.
  \item This question is optional and will not be graded.  Initialize a (2D) grid with random (2D) vectors and decompose the perform the decomposition by solving the Poisson equation.
    The divergence-free part should look rather like a fluid flow field.  Also visualize the curl-free part and the scalar field $\phi$.
  \end{itemize}

\end{enumerate}

\end{document}

