\documentclass[12pt]{article}
\usepackage{fancyhdr,fancybox,amssymb,epsfig,amsmath,latexsym,bm}
\usepackage{enumerate}
\usepackage{tikz}
\usepackage[all]{xy}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.markings}

\tikzset{big arrow/.style={decoration={markings,mark=at position 0.6
      with {\arrow[scale=2]{>}}}, postaction={decorate}, shorten >=1pt}}

% Code to make an augmented matrix (Usage: \begin{bmatrix}[ccc|c])
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
  \hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{#1}}
\makeatother

\topmargin=-.5in
\headsep=0.2in
\oddsidemargin=0in
\textwidth=6.7in
\textheight=9.2in
\footskip=.5in

% Change this line to \def\bold{\mathbf} for ``upright boldface.''
\def\bold{\bm}

\newcommand{\F}{\mathbb{F}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\def\0{\bold{0}}
\def\A{\bold{A}}
\def\B{\bold{B}}
\def\C{\bold{C}}
\def\I{\bold{I}}
\def\M{\mathcal{M}}
\def\R{\bold{R}}
\def\U{\bold{U}}
\def\b{\bold{b}}
\def\c{\bold{c}}
\def\f{\bold{f}}
\def\u{\bold{u}}
\def\v{\bold{v}}
\def\x{\bold{x}}
\def\y{\bold{y}}
\def\<{\langle}
\def\>{\rangle}
\DeclareMathOperator{\Span}{Span}
\DeclareMathOperator{\rank}{rank}

\renewcommand{\footrulewidth}{1pt}
\newenvironment{proof}[1][Proof.]{\smallskip\begin{trivlist}
    \item[\hskip \labelsep {\sffamily #1}]}{\qed\end{trivlist}\bigskip}
\newenvironment{sol}[1][Solution.]{\smallskip\begin{trivlist}
    \item[\hskip \labelsep {\sffamily #1}]}{\qed\end{trivlist}\bigskip}
\newenvironment{fminipage}
{\setlength{\fboxsep}{15pt}\begin{Sbox}\begin{minipage}}
{\end{minipage}\end{Sbox}\fbox{\TheSbox}}
\newcommand{\qed}{\hfill \ensuremath{\Box}}
\newcommand{\disp}{\displaystyle}


\pagestyle{fancy} \lhead{{\sf Homework 7 $|$ Due February 28 (Friday) }}
\rhead{\thepage} \cfoot{{\sf Math 3110 $|$ Linear Algebra $|$ Spring 2014 
    $|$ M.~Macauley}}


\begin{document}

$\;$

\noindent\emph{Read}: Strang, Section 8.2. \emph{Suggested short
  conceptual exercises}: \#15--18. \\


% Made up mostly from stracth, loosely following the outline of Strang
% Chapter 8.1, #1-7.
\noindent Consider the graph shown below, on $n=4$ vertices and $m=4$
edges.
\[
\begin{tikzpicture}[scale=1.25, >=stealth', shorten >= 4pt]
  \draw[fill=black] {(0,1) circle (1.5pt) node[label=left:$\mathbf{1}$]{}};
  \draw[fill=black] {(0,-1) circle (1.5pt) node[label=left:$\mathbf{2}$]{}};
  \draw[fill=black] {(1.86,0) circle (1.5pt) node[label=above:$\mathbf{3}$]{}};
  \draw[fill=black] {(3.86,0) circle (1.5pt) node[label=above:$\mathbf{4}$]{}};
  {\draw[big arrow] (0,1)--(0,-1);} {\draw[big arrow] (0,-1)--(1.86,0);} 
  {\draw[big arrow] (0,1)--(1.86,0);} {\draw[big arrow] (1.86,0)--(3.86,0);} 
  \draw {(-.4,0) node{$1$}}; \draw {(2.86,-.4) node{$4$}};
  \draw {(1,.9) node{$2$}}; \draw {(1,-.9) node{$3$}};
\end{tikzpicture}
\]
Answer the following questions. \emph{Write clearly and concisely}! Part of
your grade will be on the presentation of your solutions.
\begin{enumerate}
\item Write down the $4\times 4$ incidence matrix $\A$ for this graph,
  given the vertex and edge labels above. Compute the rank of $\A$ and
  solve $\A\x=\0$, thereby finding its nullspace. The components of
  $\x$ are the \emph{potentials} at the vertices. Describe in a
  sentence what a vector $\x$ in $N(\A)$ physically represents. What
  type of graph would have $N(\A)$ of dimension greater than $1$?
  
\item Solve $\A^T\y=\0$ for $\y$, thereby finding the left nullspace
  of $\A$. Recall that $\rank \A=\rank\A^T$. The components of $\y$
  are \emph{currents} on the edges. Describe in a sentence what a
  vector $\y$ in $N(\A^T)$ physically represents.
  
\item Use elimination to find the ordinary echelon matrix $\U$ of
  $\A$. What \emph{spanning tree} corresponds to the nonzero rows of
  $\U$? Sketch this tree on the network.
  
\item Determine the requirement(s) that the $b_i$'s must satisfy for
  $\A\x=\b$ to have a solution. The physical interpretation of this is
  \emph{Kirchoff's voltage law} (KVL) -- the components of $\A\x$ add
  to zero around every loop (so no voltage drop). How are the feasible
  $\b$'s related to your answer to Problem 2?  Decribe in a sentence
  what such a feasible $\b$ physically represents, and what a vector
  $\x$ solving $\A\x=\b$ represents.
  
\item The equation $\A^T\y=\f$ is \emph{Kirchoff's current law} (KCL),
  and physically represents that at each vertex, flow in equals flow
  out (including sources). The vector $\f=(-1,0,0,1)$ lies in
  $C(\A^T)$, and so $\A^T\y=\f$ has a solution.
  Solve for $\y$, and sketch the physical situation of the
  potential, current flows, and voltage sources and sink on the
  network. 

\smallskip
  
  \end{enumerate}

\noindent \emph{Ohm's Law} states that current is $\y=-\C\A\x$, where
the $\C$ is the \emph{conductance matrix} which is diagonal where the
$(i,i)$-entry is the conductance $c_i$ on edge $i$. The relationship
between potentials, currents, and voltage sources and sinks is
summarized in the diagram below.
\[
\xymatrix{\mbox{node potentials} &
  \x\ar@{-->}[rrrr]^{\A^T\C\A}\ar[dd]_\A &&&& \A^T\C\A\x=\f & \mbox{KCL}  \\ \\
  \mbox{potential differences; KVL} & \A\x\ar[rrrr]^{\C}_{\mbox{Ohm's law}} &&&& 
  \y=\C\A\x\ar[uu]_{\A^T} & \mbox{(neg.) currents}}
\]

\noindent\emph{Remark}. In circuit theory (in physics and electrical
engineering), current flows from higher potential to lower potential,
which is why current is $\y=-\C\A\x$, rather than $\y=\C\A\x$. This
artificial negative sign does not appear when this equation arises in
mechanical engineering, where $\y=\C\A\x$ is called \emph{Hooke's Law}
for mass-spring systems, and $\C$ is the diagonal matrix of the spring
elasticities.

\begin{enumerate}\setcounter{enumi}{5}
  
\item First, consider the case when all conductances are $1$, so
  $\C=\I$, and compute $\A^T\C\A=\A^T\A$ (recall that it is
  symmetric!). Next, suppose the potentials at the nodes are given by
  $\x=(1,0,1,0)$. Compute the resulting currents $\y=-\C\A\x$ and the
  vector $\f$ of sources and sinks. Note that $\f=\A^T\A\x$, by
  KCL. Sketch the network and include the potentials $\x$, the
  currents $\y$, and the sources and sinks $\f$ on the graph. Remember
  that at each node, flow in must equal flow out!

\item Now, suppose the conductances are $c_1=1$ and $c_2=c_3=c_4=2$.
  Moreover, let $\f=(1,-3,4,-2)$ be the vector of sources and
  sinks. Determine the potentials at each node by solving
  $\A^T\C\A\x=\f$ for $\x$. Sketch the network and include the
  potentials $\x$, the currents $\y$, and the sources and sinks
  $\f$. Compare your answer to that of the previous problem.

\end{enumerate}


\end{document}
