\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts,graphicx}

\def\d{{\mathrm d}}

\begin{document}

\title{Operations Research}
\author{Homework 2}
\date{Due in class Wednesday, February 17, 2016}
\maketitle

\begin{enumerate}

\item Reconsider Problem~1 from Homework Set~1:

Minimize
\[
  z = 8 \, x + 12 \, y
\]
subject to 
\begin{gather*}
  5 \, x + 2 \, y \geq 20 \,, \\
  4 \, x + 3 \, y \geq 24 \,, \\
  y \geq 2 \,, \\
  x, y \geq 0 \,.
\end{gather*}

\begin{enumerate}
\item Write a ``concrete'' Pyomo model and resolve this problem.  
\item How does the solution change if you ask for maximizing $z$
instead?
\end{enumerate}

You should submit a printout of your Ipython notebook which shows the
model setup and the computed solutions to (a) and (b).

\item (From HL, problem 3.4-15.)  A cargo plane has three compartments
for storing cargo: front, center, and back.  These compartments have
capacity limits on both \emph{weight} and \emph{space}, as summarized
below:

\begin{center}
\begin{tabular}{lcc}
\hline
  \textbf{Compartment}$\vphantom{1^{1^1}}$ & \textbf{Weight Capacity} [t] & \textbf{Space
                                                        Capacity}
                                                        [ft$^3$] \\
\hline
Front$^{\vphantom{\tfrac11}}$ & 12 & 7\,000 \\
Center & 18 & 9\,000 \\
Back & 10 & 5\,000 \\
\hline
\end{tabular}
\end{center}
Furthermore, the weight of the cargo in the respective compartments
must be the same proportion of that compartment's weight capacity to
maintain the balance of the airplane.

The following four cargoes have been offered for shipment on an
upcoming flight as space is available:
\begin{center}
\begin{tabular}[lcc]{lccc}
  \hline
  \textbf{Cargo}$\vphantom{1^{1^1}}$ & \textbf{Weight} [t] & \textbf{Volume} [ft$^3$/t] &
                                                                      \textbf{Profit}
                                                                      [\$/t]
  \\
\hline
1$^{\vphantom{\tfrac11}}$ & 20 & 500 & 320 \\
2 & 16 & 700 & 400 \\
3 & 25 & 600 & 360 \\
4 & 13 & 400 & 290 \\
\hline
\end{tabular}
\end{center}
Any portion of these cargoes can be accepted.  The objective is to
determine how much (if any) of each cargo should be accepted and how
to distribute each among the compartments to maximize the total profit
for the flight.
\begin{enumerate}
\item Formulate a linear programming model for this problem.
(Submission in mathematical notation!)
\item Solve this model using Pyomo to find one of its multiple optimal
solutions. (Submission as printout of Ipython notebook.)
\end{enumerate}

\item  Find all solutions for the underdetermined linear system
$A\boldsymbol{x}=\boldsymbol{b}$, 
where
\begin{equation*}
  A =
  \begin{pmatrix}
    2 & 2 & 1 & 0 \\
    1 & 1 & 1 & 1 \\
    1 & 1 & 0 & -1 \\
    3 & 3 & 2 & 1
  \end{pmatrix}
  \qquad \text{and} \qquad
  \boldsymbol{b} =
  \begin{pmatrix}
    -1 \\ 1 \\ -2 \\ 0
  \end{pmatrix} \,.
\end{equation*}

\end{enumerate}

\end{document}
