\documentclass[11pt]{article}
 \setlength{\textheight}{10.4in}
 \setlength{\topmargin}{-1in}
 \setlength{\headheight}{0in}
 \setlength{\topsep}{0in}
 \setlength{\marginparwidth}{0in}
 \setlength{\marginparsep}{0in}
 \setlength{\oddsidemargin}{0in}
 \setlength{\evensidemargin}{0in}
 \setlength{\textwidth}{6.4in}
 \setlength{\parskip}{4pt}
 \setlength{\parindent}{0pt}
\usepackage{quiz}
\usepackage{alltt}
%\usepackage{email}
\usepackage{hyperref}
\usepackage{graphicx}
\begin{document}
\section*{Quiz 6}
\rule{\textwidth}{0.5ex}
{\bf Quiz6 Problem 1}. {\bf Resistive Network} with 2 Loops and DC Sources.

\includegraphics[scale=1.0]{figures/resistor-circuit-DC-2loops-edit2.png}


The {\bf Branch Current Method} can be used to find a $3\times 3$ linear system for the {\bf branch currents} $I_1,I_2,I_3$.
$$\begin{array}{rcrcrcrl}
  I_1 &-&   I_2 &-& I_3 &=& 0    &\mbox{~~~KCL, upper node} \\
3 I_1 &+& 2 I_2 & &     &=& 18   &\mbox{~~~KVL, left loop} \\
      && 2 I_2 &-& 2I_3  &=& 5    &\mbox{~~~KVL, right loop}
\end{array}$$
Symbol {\bf KCL} means {\em Kirchhoff's Current Law}, which says the algebraic sum of the currents at a node is zero. Symbol {\bf KVL} means {\em Kirchhoff's Voltage Law}, which says the algebraic sum of the voltage drops around a closed loop is zero.

(a) Solve the equations to find the currents $I_1, I_2, I_3$ in the figure.
 % $I_1=\frac{62}{16}, I_2=\frac{51}{16}, I_3=\frac{11}{16}$ Amperes.

(b) Compute the voltage drops across resistors $R_1,R_2,R_3$. Answer: $\frac{93}{8}, \frac{51}{8},\frac{11}{8}$ volts.

(c) Replace the $5$ volt battery by a $4$ volt battery. Solve the system again, and report
the new currents and voltage drops.
% Currents are $I_1=4, I_2=3, I_3=1$ amperes. The voltage drops are $12,6,2$.

% A:=<1,-1,-1|3,2,0|0,2,-2>^+;b:=<0,18,5>;X:=A^(-1).b;<3,0,0|0,2,0|0,0,2>.X;

{\bf References}. Edwards-Penney BVP 3.7, electric circuit supplement. All About Circuits Volume I -- DC,
by \href{http://www.allaboutcircuits.com/}{T. Kuphaldt}. Course slides on
\href{http://www.math.utah.edu/~gustafso/s2014/2250/electricalCircuits.pdf}{Electric Circuits}.
Solved examples of electrical networks can be found in the lecture notes of
\href{http://fourier.eng.hmc.edu/e84/lectures/ch2/node2.html}{Ruye Wang}.


\vfill\newpage
\rule{\textwidth}{0.5ex}
{\bf Quiz6 Problem 2}. {\bf Separation train}:  Xylene, Styrene, Toluene, and Benzene are separated in 3 distillation columns. Symbols $Ft, D, B, D1, B1, D2, B2$ are molar flow rates in mol/min.

\vspace{1pc}

\includegraphics[scale=0.58]{figures/separationTrainXyleneStyreneTolueneBenzene-edit3.png}

{\bf Balance Equations}. The four Xylene separations imply balance equation
$0.05D1 + 0.16B1 + 0.15D2 + 0.24B2 = 0.15(70)$ kg-mol, based on 1 min of operation. There are 3 other similar equations, for styrene, toluene and benzene. Multiply by 100 to produce the balance equations
\begin{alltt}
     Xylene:   5 D1 + 16 B1 + 15 D2 + 24 B2 = 15(70)
     Styrene:  4 D1 + 26 B1 + 10 D2 + 65 B2 = 25(70)
     Toluene: 51 D1 + 42 B1 + 54 D2 + 10 B2 = 40(70)
     Benzene: 40 D1 + 16 B1 + 21 D2 +  1 B2 = 20(70)
\end{alltt}

%A:=Matrix([
%[5,  16, 15, 24 ],
%[4,  26 ,10, 65],
%[51, 42, 54, 10],
%[40, 16, 21 ,1]]);
%v:=70*<15,25,40,20>;
%LinearAlgebra[LinearSolve] (A,v);evalf(%);
% 18.35013749, 3.913840513, 27.78185151, 19.95417049

% Original figure from the original source
%\begin{verbatim}
%Initial set of material balances – use a basis of 1 minute of operation:
%
%Xylene:    0.07*D_1 + 0.18*B_1 + 0.15*D_2 + 0.24*B_2 = 0.15*70 kg-mol
%
%Styrene:   0.04*D_1 + 0.24*B_1 + 0.10*D_2 + 0.65*B_2 = 0.25*70 kg-mol
%
%Toluene:  0.54*D_1 + 0.42*B_1 + 0.54*D_2 + 0.10*B_2 = 0.40*70 kg-mol
%
%Benzene: 0.35*D_1 + 0.16*B_1 + 0.21*D_2 + 0.01*B_2 = 0.20*70 kg-mol
%
%"Problem Solving in Chemical Engineering with Numerical Methods"
%by Michael Cutlip and Mordecai Shacham,
%Prentice-Hall ISBN 0-13-862566-2.
%\end{verbatim}


{\bf Molar Flow Rates}. Because $D$ flows to column 2, then $D=D1+B1$. Molar flow rates are computed
individually in distillation column 2 as a linear combination of vector separations:
$$\colvectorC{
\mbox{Xylene molar flow rate} \\
\mbox{Styrene molar flow rate}\\
\mbox{Toluene molar flow rate}\\
\mbox{Benzene molar flow rate}}
=
\frac{D1}{100}\colvector{5\\ 4\\ 51 \\ 40}
+
\frac{B1}{100}\colvector{16 \\ 26 \\ 42 \\ 16}
.$$


(a) Solve the balance equations for {\tt D1, B1, D2, B2}.\newline
 Answers: About $18.35$, $3.91$, $27.78$, $19.95$.

(b) Compute the four individual molar flow rates for distillation column 2.\newline
 Answers: About
$1.5,1.75,11.0,7.97$.

% 18.35013749/100*A[1..4,1]+3.913840513/100*A[1..4,2];
 % Answers: 1.54372135658000,1.75160403298000,11.0023831353600,7.96626947808000
%	2.4 Problem Statement, original source
%   Xylene, styrene, toluene, and benzene are to be separated with the
%   array of distillation columns in Figure 1.  F, D, B, D1, B1, D2, and
%   B2 are the molar flow rates in mol/min.
%
%   Material balances on individual components on the overall separation
%   train yield the equation set(6):
%	   Xylene: 0.07D1+0.18B1+0.15D2+0.24B2=0.15*70
%      Styrene: 0.04D1+0.24B1+0.10D2+0.65B2=0.25*70
%      Toluene: 0.54D1+0.42B1+0.54D2+0.10B2=0.40*70
%      Benzene: 0.35D1+0.16B1+0.21D2+0.01B2=0.20*70
%
%A=[0.07 0.18 0.15 0.24
%   0.04 0.24 0.10 0.65
%   0.54 0.42 0.54 0.10
%   0.35 0.16 0.21 0.01];
%f = [0.15*70 0.25*70 0.40*70 0.2*70];
%disp('Solution for D1 B1 D2 B2 is:')
%X = A\f'
%% solution is 26.25 17.50 8.75 17.50

{\bf References}. Edwards-Penney Sections 3.1, 3.2, 3.3. Course manuscript
\href{http://www.math.utah.edu/~gustafso/s2014/2250/linearequDRAFT.pdf}{Linear Algebraic Equations, No Matrices}.
Michael Cutlip and Mordecai Shacham, {\em Problem Solving in Chemical Engineering with Numerical Methods},
Prentice-Hall (1998) ISBN-10: 0138625662.
vfill\newpage
\rule{\textwidth}{0.5ex}
{\bf Quiz6 Problem 3}. {\bf Traffic Flow}\newline
Similar to electrical network analysis, traffic flow problems generate a system of equations $A\vec{x}=\vec{b}$, but whereas the system of equations for the network has a unique solution, the traffic flow system of equations generally has infinitely many solutions.

Traffic is measured in vehicles per hour (vph). A basic law is {\bf conservation of flow} at an intersection, which compares to Kirchhoff's laws for electrical networks.

Here's an example due to Gareth Williams for downtown Jacksonville, Florida, using rush hour data. The streets are Monroe, Laura, Duval, Hogan. The engineering mathematics text of Zill and Wright has details, found on the publisher's two-page summary \href{http://math.jbpub.com/advancedengineering/docs/Project8.2_TrafficFlow.pdf}{Here}.


\begin{center}
\includegraphics[scale=1.2]{figures/trafficFlowGW-edit.png}
\\
Downtown Traffic Flow in Jacksonville, Florida
\end{center}

(a) Give the details for why the conservation law applied to each intersection implies the following equations. Assume all traffic flows $x_1,x_2,x_3,x_4$ are nonnegative.
$$\begin{array}{rcrcrcrcl}
x_1 &+& x_2 & &     & &     &=& 625, \\
x_1 & &     & &     &+& x_4 &=& 475,\\
    & &     & & x_3 &+& x_4 &=& 900,\\
    & & x_2 &+& x_3 & &     &=& 1050.
\end{array}$$

(b) Write the system in the form $A\vec{x}=\vec{b}$ and show the details for solving it. There are infinitely many solutions. The answer is $x_1=475-t_1,x_2=150+t_1,x_3=900-t_1,x_4=t_1$, where $t_1$ is the invented symbol.

(c) Explain why $0\le t_1\le 475$.

(d) What is the minimum value of $x_3$ along $DC$ that would not lead to traffic congestion? Please explain the logic used. Answer: $425$ vph. Therefore, road work on Monroe Street should allow traffic flow more than $425$ vph.

{\bf References}.  Edwards-Penney Sections 3.4, 3.5. Course manuscripts
\href{http://www.math.utah.edu/~gustafso/s2014/2250/linearequDRAFT.pdf}{Linear Algebraic Equations, No Matrices}, \href{http://www.math.utah.edu/~gustafso/s2014/2250/matrix-eqn.pdf}{Matrix Equations}. Course slides
\href{http://www.math.utah.edu/~gustafso/s2014/2250/inverseMethodRREF.pdf}{Inverse Matrix}, \href{http://www.math.utah.edu/~gustafso/s2014/2250/matrixOperations2008.pdf}{Matrix Multiply}.

\end{document}
