%begin preamble
\documentclass[11pt,titlepage]{article}
\usepackage[margin=1in,noheadfoot]{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{wrapfig}
\usepackage{calligra}
\DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n}
\DeclareFontShape{T1}{calligra}{m}{n}{<->s*[2.2]callig15}{}
\newcommand{\scriptr}{\hspace{-.1ex}\ensuremath{\mathcalligra{r}}\,}
\newcommand{\dslash}{d \hspace{-0.5ex}\rule[1.2ex]{0.6ex}{.1ex}}

\newcommand{\e}[1]{\times 10^{#1}}
\newcommand{\q}{\mathrm}
\newcommand{\where}[1][where]{\qquad\mbox{#1}\qquad}
\newcommand{\bs}[1]{\boldsymbol{#1}}
\newcommand{\bh}[1]{\hat{\boldsymbol{#1}}}
\newcommand{\bv}[1]{\vec{\boldsymbol{#1}}}
\newcommand{\bt}[1]{\tilde{\boldsymbol{#1}}}
\newcommand{\flow}[1]{\mathcal{E}_{#1}}
\newcommand{\flux}[1]{\Phi_{#1}}
%end preamble

\begin{document}
\begin{center}
  {\bf Arizona State University, Physics 311 \\
    Problem Set \#5, Rev. A, due Wednesday, 2014-02-26 }
\end{center}

\vspace{.3 in}

1.~{\bf Finite Element Method}.  In this problem we will investigate one of
the most common methods of solving partial differential equations numerically
(especially involving the Laplacian).  This method is very flexible and can be
used to solve PDEs on irregularly shaped domains (like cars, or electrodes for
your awesome new experiment).  This problem is self-contained, but for extra
details or hints, refer to the article
\href{http://en.wikipedia.org/wiki/Finite_element}
{http://wikipedia.org/wiki/Finite\_element}.

\quad a) Show that 
\begin{equation}
\int_R (\nabla^2 u) v d\tau = \oint_{\partial R} (\nabla u) v
\cdot {\bs{da}} - \int_R \nabla u \cdot \nabla v  d\tau.
\end{equation}
Assuming that
$v=0$ on the boundary, this means that the equation $\nabla^2 u=f$ can be
written 
\begin{equation}
  - \int_R \nabla u \cdot \nabla v  d\tau = \int_R f v d\tau,
  \label{integral_eq}
\end{equation} 
which is now a first order integral equation, which must be true for any {\it
  test function} $v({\bs r})$.

\quad b) In a one-dimensional space, Eq.~\ref{integral_eq} can be discretized
by choosing appropriate ``basis functions'' for $v({\bs r})$.  Define the
{\it tent function}
\begin{equation}
v_i(x) = (1-|x-i|)\;
\theta(1-|x-i|),
\end{equation}
where $\theta(x)= \{ 1$ if $x>0$, and $0$ if $x<0 \}$ is the Heaviside step
function and $i=1,2,3,4$.  Plot each of these functions on the same graph.

\quad c) Sketch the function $f(x)=2 v_1(x) + 4 v_2(x) + 3 v_3(x) + 1 v_4(x)$.
In the same way, any function defined on $0<x<5$ can be approximated by a
linear combination of these basis functions $f(x)\approx \sum_{i=1}^4 f_i
v_i(x)$, where $f_i = f(i)$.

\quad d) Convert Eq.~\ref{integral_eq} into a matrix equation by substituting
$v(x) \to v_i(x)$ for $i=1,2,3,4$, approximating $u(x)=\sum_j u_j v_j(x)$ and
$f(x)=\sum_j f_j v_j(x)$, and performing the integrals
$\int_{-\infty}^{\infty} v_i(x) v_j(x) dx$ and $\int_{-\infty}^{\infty} \nabla
v_i(x) \cdot \nabla v_j(x) dx$.  Note that $\nabla = d/dx$ in one dimension.
 
\quad e) Use part d) to solve the boundary value problem $\nabla^2 u = 3$ on
the region $0<x<5$, with boundary conditions $u(0)=0$ and $u(5)=0$, by solving
the above matrix equation for $u_i$.  
%You can use \verb|http://toolpaq.com/en/matrix_inverter/| to invert matrices.
 
\quad f) Find the analytic solution $u(x)$ of part e) and compare with the
finite element result.
 
\quad g) Describe how this method could apply to higher dimensions.  Hint:
Define the 2-dimensional tent function $v_{ij}(x,y) = v_i(x) \; v_j(y)$.  Plot
this basis function, and evaluate at least two of the integrals that would be
needed to form the matrix equation.  We won't do a 2- or 3-dimensional
problem, because the matrices become very large.  However there are packages
like FlexPDE (\href{http://www.pdesolutions.com/index.html}
{http://www.pdesolutions.com}, free student version) and COMSOL
(\href{http://comsol.com}{http://comsol.com}) which do all the bookkeeping to
implement this method for arbitrary geometries and complex differential
equations, which you specify using a graphical user interface (GUI).

\vspace{.25 in}

Also, Griffiths 3ed[4ed] Ch.~3, \#%
1[1], %p115, average potential sphere
2[2], %p115, Earnshaw's theorem, electric confinement
5[5], %p121, Uniqueness theorem
10[11] %p126, Image charge, perpendicular planes.

\end{document}
