\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*{Sample Quiz 5}
{\bf Sample Quiz4 Problem 1}. {\bf Balancing Chemical Equations}: Tin oxide heated with hydrogen gas forms tin metal and water vapor.


The object of this problem is the derivation of the balanced chemical equation
\begin{center} SnO2(s) + 2 H2(g) $\to$ Sn(s) + 2 H2O(g). \end{center}
The chemical symbols are defined as follows:

\begin{tabular}{llll}
SnO2(s) &   Tin dioxide & (s)=solid state & Ref: \href{http://en.wikipedia.org/wiki/Tin_dioxide}{Wikipedia tin dioxide}
\\
H2(g) & Hydrogen & (g)=gaseous state & Ref: \href{http://en.wikipedia.org/wiki/Hydrogen}{Wikipedia hydrogen}
\\
Sn(s) & Tin & (s)=solid state & Ref: \href{http://en.wikipedia.org/wiki/Tin}{Wikipedia tin}
\\
H2O(g) & Water & (g)=gaseous state & Ref: \href{http://en.wikipedia.org/wiki/Water}{Wikipedia water}
\end{tabular}

{\bf Chemical balance} means that matching elements on each side of a chemical equation have the same total amount of atoms. Notation 2 H2O documents 2x2=4 hydrogen atoms and 2x1=2 oxygen atoms. The given chemical equation is balanced, because the atom amounts for elements Sn, H, O total on each side of the equation to 1, 4, 2, respectively.

{\bf Chemical Balance by Linear Algebra}.
We begin with the unbalanced chemical equation
\begin{center} SnO2(s) +  H2(g) $\to$ Sn(s) +  H2O(g), \end{center}
which means tin dioxide and hydrogen gas chemically combine into tin and water vapor.
We'll write the balanced equation as
\begin{center} $x_1$ SnO2(s) +  $x_2$ H2(g) $\to$ $x_3$ Sn(s) +  $x_4$ H2O(g), \end{center}
where integers $x_1$ to $x_4$ are to be determined. Chemical balance means that the following algebraic equations hold:
$$
\begin{array}{rcll}
x_1 &=& x_3 & \mbox{Tin Sn} \\
2x_2 &=& 2x_4 & \mbox{Hydrogen H} \\
2x_1 &=& x_4 & \mbox{Oxygen O}
\end{array}
$$

(a) Write the equations in standard matrix form $A\vec{x}=\vec{0}$, where $A$ is a $3\times 4$ matrix and $\vec{x}$ has components $x_1$ to $x_4$.

(b) Find the reduced row echelon form of $A$. Answer: $\rref(A)=\left(
\begin{array}{cccc} 1&0&0&-\frac12 \\ 0&1&0&-1 \\ 0&0&1&-\frac12
\end{array}\right)$
%A:=Matrix([[1,0,-1,0],[0,2,0,-2],[2,0,0,-1]]);
%linalg[linsolve](A,<0,0,0>);
%linalg[rref](A);

(c) Identify the lead variables and the free variables. Then solve the system $A\vec{x}=\vec{0}$. The answer is $x_1=\frac12 t_1$, $x_2=t_1$, $x_3=\frac12 t_1$, $x_4=t_1$, in terms of invented symbol $t_1$. The smallest positive integer values for $x_1$ to $x_4$ are obtained from $t_1=2$: $x_1=1$, $x_2=2$, $x_3=1$, $x_4=2$. Substitution gives the balanced chemical equation
\begin{center} (1)SnO2(s) +  (2)H2(g) $\to$ (1)Sn(s) +  (2)H2O(g) \end{center}

{\bf References}. Edwards-Penney sections 2.3, 3.1, 3.2.
Course documents on
\href{http://www.math.utah.edu/~gustafso/s2014/2250/linearequDRAFT.pdf}{Linear algebraic equations}.
How to balance chemical equations, a video by \href{http://video.about.com/chemistry/How-to-Balance-Chemistry-Equations.htm}{Anne Marie Helmenstine}

\vfill
\newpage

{\bf Sample Quiz5 Problem 2}. {\bf Solving Initial Value Problems}.

The objective of this problem is to learn how to solve for the constants in a general solution, using given initial conditions. The differential equation and its known general solution are
$$
\begin{array}{l}
y''' + 4y'' = 0, \\
y(x) = c_1 + c_2 x + c_3 e^{-4x}.
\end{array}
$$
The initial conditions are
$$y(0)=1, y'(0)=2, y''(0)=-1.
$$

(a) Answer-check the general solution formula. 

(b) Substitute the general solution into the three initial conditions to obtain the system of equations
$$
\left(\begin{array}{rrr}
1 & 0 & 1 \\
0 & 1 & -4 \\
0 & 0 & 16
\end{array}\right)
\colvector{c_1 \\ c_2 \\ c_3} = \colvector{1 \\ 2 \\ -1}
$$

(c) Solve the system of equations. Picard's existence-uniqueness theorem says that the initial value problem has a unique solution, meaning that the linear algebra problem is in the unique solution case: no free variable.

{\bf References}. Edwards-Penney sections 3.3, 3.4, 5.3.
Course documents on
\href{http://www.math.utah.edu/~gustafso/s2014/2250/linearequDRAFT.pdf}{Linear algebraic equations}

\vfill\newpage

{\bf Sample Quiz5 Problem 3}. {\bf Separation train}:  Xylene, Styrene, Toluene, and Benzene.

\vspace{1pc}

\includegraphics[scale=0.6]{separationTrainXyleneStyreneTolueneBenzene.png}

\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}. 
%	2.4 Problem Statement
%   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 Sample Quiz4 Problem 3}. Resistive electrical network with direct current sources.
%
%\begin{itemize}
%\item[{\bf 1}.]
%\item[{\bf 2}.]
%\item[{\bf 3}.]
%\end{itemize}
%
%{\bf References}. Edwards-Penney Sections 3.1, 3.2, 3.3.
%\href{http://www.math.utah.edu/~gustafso/s2014/2250/linearequDRAFT.pdf}{Linear algebraic equations}

\end{document}
