% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
% 
% This class (simiode.cls) is a modification of that used by 
% the journal PRIMUS - Problems, Resources, and Issues in 
% Mathematics Undergraduate Studies. 
% 
% See http://www.tandfonline.com/loi/upri .
% 
% The class was developed by  Marc Frantz with suggestions of the 
% PRIMUS Editorial Board, especially John Thoo.
%
% This template is to be used with the  class file "simiode.cls". 
%  
% The latest version of this class and template files 
% can be found at
% 
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
%
\documentclass{simiode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Basically the Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review (but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.   
% Rename the pdf after you compile each final version.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is 
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will 
% look in final form, so that you can better plan your 
% presentation.  To see your manuscript formatted very 
% similarly to the on-line published format of  SIMIODE, 
% comment the following line out by inserting a percent sign % (%) at its beginning.

\renewcommand{\baselinestretch}{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding macros %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Any macros defined for your paper should be contained in 
% the top matter. Likewise, any environment definitions such 
% as \newtheorem or \newenvironment should also go in the 
% top matter. 
% 
% Do not \input your macros as separate files within your 
% final version because more files make it harder for the 
% editors and users to keep track of and/or modify and 
% append your paper.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Top matter is above and 
% the beginning of the document below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\newpage
% You only need to change the NAME OF SCENARIO in the next line and delete the footnote. See above for instructions on toggling from Teacher Version to Student Version.
\title{\ifnum\TeacherEdition=1 TEACHER VERSION  \else STUDENT VERSION \fi\\CHEMICAL OPTIMIZATION}




\markboth{Chemical Optimization}{Chemical Optimization}






\author{Brian Winkel, Director SIMIODE\\
Chardon OH 44024 USA\\
BrianWinkel@simiode.org}


\makeStitlePDFLaTex


\begin{abstract}
Modeling a chemical reaction and estimating parameters in the model permits optimization of profits from extracting reactants.
\end{abstract}


\section*{SCENARIO DESCRIPTION}


A laboratory experiment is going on in the Projects Lab of your company.  A colleague, a production chemist, comes to you for advice.

Compound A is heated to $120^{\circ}$C  in order to produce compounds B and C.  The temperature of the pot containing all of these compounds is kept at $120^{\circ}$C  in order to keep the reaction going.
$k_1$ is the reaction rate constant in units 1/hr for the reaction in which A is converted to B while the reaction rate  of converting compound B to C is $k_2$. The reaction is shown in (\ref{eq:ABCReact}).
\vspace*{-.3 true cm}

\begin{equation}\label{eq:ABCReact}
\displaystyle{ A \stackrel{k_1}{\longrightarrow} B \stackrel{k_2}{\longrightarrow} C}
\end{equation}

The  data from the reaction has been gathered and presented in Table~\ref{table:ABC}.


\begin{table}
\begin{center}
\begin{tabular}{|r|r|r|r|}\hline \hline 
\multicolumn{1}{|c|}{Time (min)} 	&\multicolumn{1}{|c|}{A (mole)}&	\multicolumn{1}{|c|}{B (mole)}&	\multicolumn{1}{|c|}{C(mole)}\\ \hline \hline 
0	\hspace*{.4 true cm}&	1.00	&	0.00	&	0.000\\ \hline 
2	\hspace*{.4 true cm}&	0.88	&	0.12	&	0.003\\ \hline 
6	\hspace*{.4 true cm}&	0.69	&	0.29	&	0.030\\ \hline 
10	\hspace*{.4 true cm}&	0.53	&	0.42	&	0.050\\ \hline 
20	\hspace*{.4 true cm}&	0.28	&	0.56	&	0.16\\ \hline 
30	\hspace*{.4 true cm}&	0.15	&	0.57	&	0.28\\ \hline 
50	\hspace*{.4 true cm}&	0.043	&	0.46	&	0.50\\ \hline 
70	\hspace*{.4 true cm}&	0.012	&	0.33	&	0.66\\ \hline 
90	\hspace*{.4 true cm}&		&	0.22	&	0.78\\ \hline 
120	\hspace*{.4 true cm}&		&	0.12	&	0.88\\ \hline 
150	\hspace*{.4 true cm}&		&	0.06 	&	0.94\\ \hline 
200	\hspace*{.4 true cm}&		&	0.02	&	0.98\\ \hline 
\end{tabular}
\parbox{9 true cm}{\caption{\label{table:ABC} Data reported from chemical reaction in which chemical A is converted to B and then converted to C.}}
\end{center}
\end{table}

The goal is to produce compound B for marketing. Thus we seek a mathematical model as an aid in telling us the best time to stop the process and extract compound B for the market.  One measure of best is most profit or net return.   We know that A costs \$0.50 per mole and B sells for \$3.50 per mole.  Our production engineer friend has found that for compound C we can expect a return of \$0.25 per mole from the recovered C.

Find the optimal shutoff time for this process in order to optimize the net return on this process.

\subsection*{Opportunities}

\begin{enumerate}
  \item Without using any ``sophisticated'' modeling techniques offer a plausible approach and suggest a method to solve such a problem.  Look at the data!
  \item  Form a mathematical model.  Be sure to state your assumptions - mathematical and chemical.  Use this mathematical model to tell your corporate friend just when to shut off the process and just how much profit they can expect on this process.
\end{enumerate}

Ideas for modeling consist of curve fitting, differential (rate) equations, or difference equations.

\subsection*{Post Solution issues, modifications,  and more problems}

\begin{enumerate}
  \item Suppose your colleague comes back to you and says that you NOW have to consider the optimization in view of the energy costs to run the process and it is known that the energy costs to run this process are \$0.005/hr.

Formulate a model which will  find the optimal shutoff time for this process in order to optimize the profit on this process.

  \item Compare your results when you consider energy to when you do not.

  \item Finally attempt to determine the sensitivity of yield and final net return in terms of changes in the energy cost.  Namely offer a plot of profit and change in profit/unit change in price of energy (marginal profit) as a function of price of energy, say in the range $[0, 0.04]$, i.e. from no costs to approximately 8 times the current costs of \$0.005/hr. 
\end{enumerate}  

\teacher{
\section*{NOTES FOR TEACHERS}



We have found that once the Law of Mass Action has been introduced (or re-introduced to students who might have seen it in chemistry coursework) setting up kinetic reaction differential equations is quite natural.


\begin{quote}
Law of mass action, law stating that the rate of any chemical reaction is proportional to the product of the masses of the reacting substances, with each mass raised to a power equal to the coefficient that occurs in the chemical equation. This law was formulated over the period 1864-1879 by the Norwegian scientists Cato M. Guldberg and Peter Waage but is now of only historical interest. This law was useful for obtaining the correct equilibrium equation for a reaction, but the rate expressions it provides are now known to apply only to elementary reactions.\cite{LawMassAction2015}
\end{quote}

So in our case the reaction is
\begin{equation*}\label{eq:ABC}
\displaystyle{A \stackrel{k_1}{\longrightarrow} B \stackrel{k_2}{\longrightarrow} C}
\end{equation*}
\vspace*{-.2 true cm}
and the differential equations are

\vspace*{-.5 true cm}
\begin{eqnarray}\label{eq:DE}\nonumber
a'(t) &=& - k_1 a(t)\,  ,\\ 
b'(t) &=&  k_1 a(t) - k_2 b(t)\, ,\\ \nonumber
c'(t) &=& k_2 b(t)\, .
\end{eqnarray}
where $a(t)$, $b(t)$, and $c(t)$ are the respective amounts of chemicals A, B, and C at time $t$ in hours and $k_1$ and $k_2$ are the reaction rates in units 1/hour.





We have put our analyses in a Mathematics notebook 5-7-T-Mma-ChemOpt-TeacherVersion.nb and a pdf version for those who do not read Mathematica files.  Since this was a toy problem with constructed, very clean(!) data, it is not surprising that we have ``perfect'' fits as shown in Figure~\ref{fig:5-7-Final}. Of course, each teacher can add some `noise'' to the data to make it appear more realistic.

\begin{figure}[h]
\centering
\includegraphics[width=8cm]{5-7-Final.eps}


\parbox{9 true cm}{\caption{\label{fig:5-7-Final}  Plot of data and results of best fitting model. Solid (green) is A, dashed (blue) is B, and dot-dashed (purple) is C.}}

\end{figure}


One of the issues practicing chemists have (e.g., chemical engineers) is that of extracting or removing a product they have created from an environment. In this case it might be the end product $C$ from a solution which houses the reaction. This cost can depend upon a number of issues, including scale, concentration, solution composition, and species.  We do not address the issue of separation or extraction here, but it could provide an interesting conversation starter for students interested in  production of chemicals.

\subsection*{ISSUES RELATED TO THE PROBLEM}



Somehow students need to realize that they can formulate a mathematical model with parameters and use data to determine these parameters in order to predict and use the results of their predictions, in this case to optimize profit.

 
\subsubsection*{Prerequisites}


\begin{enumerate}
  \item Some exposure to some notion that the rate of reaction of a decaying compound is proportional to the amount of the compound present, perhaps (but not essential) Law of Mass Action or first order kinetics in chemistry course.
  \item Some exposure to the notion of a rate or differential equation and a system of differential equations. 
  \item Use (possibly if teacher does not want to restrict solution strategies to by hand efforts) of computer algebra system differential equation solver for the system of differential equations and thus an understanding of what a solution to a differential equation or a system of differential equations means. 
  \item Some understanding of the concept of  least squares fitting of functions to data when the functions are nonlinear in the parameters to be determined.
  \item Optimization of a function of one variable.
 \end{enumerate}

\subsubsection*{Time allotment - time management}
  Students can construct the system of differential equations in 10 minutes if they have been coached to think about Law of Mass Action or rate equations.

The analysis of solving (e.g., by hand solutions or using DSolve in Mathematica)  and the least squares analysis needs introduction, but if students  have had some experience with curve fitting to data this material could be introduced in one hour and basically assigned for homework over a few nights. Once this approach to parameter estimation using minimization of sum of  square errors between observed data and model is introduced and students perform the analyses then revisiting this approach in later models will be quicker and more readily adopted by students.

\subsubsection*{Expectations} 
We would expect students to formulate a model of the rate of change in the amounts of the chemicals involved and then estimate the parameters in the model.

\subsubsection*{Future Payoffs} 
Students will be able to formulate models in which unknown parameters exist and these parameters may be found using data.

\subsubsection*{Extensions}
 
Work on large system of chemicals or make costs nonlinear, i.e. cheaper in larger lots.


\section*{ACKNOWLEDGEMENT}


The production of this material was supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849 from 1993-1996 entitled Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering and the Arvin Foundation of Columbus IN.  
}

\begin{thebibliography}{98}




\bibitem{LawMassAction2015} Law of mass action. 2015. {\it Encyclopedia Britannica Online\/}. \href{http://www.britannica.com/science/law-of-mass-action}{http://www.britannica.com/science/law-of-mass-action}. Accessed 16 September 2015.


\end{thebibliography}



\end{document}




