\magnification=\magstep1
\centerline{Mathematics 304 -- Ordinary Differential Equations}
\centerline{Discussion/Lab 2 -- Modelling with ODE's}
\centerline{Competition for a Heating/Air Conditioning
Plan for the new Smith Hall}
\centerline{September 21 and 26, 2000}
\bigskip
\noindent
{\it Background and Goals}
\bigskip
Last time, we saw that if we think of the air volume in a building
as one ``compartment'' at uniform temperature and we want
to model how the temperature changes over time, then we need
to analyze the different factors affecting the temperature such as:
\bigskip
\item{$\bullet$} heat exchange with the surrounding air 
\item{$\bullet$} heat sources (such as computers, lights, other 
machinery, etc.) within the building 
\item{$\bullet$} air conditioning/heating applied to control
the temperature.
\bigskip
\noindent
We will write $T(t)$ for the air temperature in the building
as a function of time.
By {\it Newton's Law of Heating and Cooling}, the rate of change
of $T$ with respect to time {\it due to heat exchange with the 
surrounding air} is proportional to the difference between the 
the temperature of the building and the
ambient air temperature $A(t)$ (which will depend on $t$).  
If heat sources within the building are changing the temperature by 
$H(t) \ge 0$ at time $t$ and heating or air conditioning are changing 
the temperature by $U(t,T)$ at time $t$, our model for the 
real world system is a 1st order ODE:
$${dT\over dt} = k(T - A(t)) + H(t) + U(t,T),\leqno(1)$$
where $k$ is constant, and $A(t), H(t)$ are functions of $t$ alone
(assumed known).  We will think of the $U(t,T)$ term as the {\it control
term} that we can adjust to try to produce solutions with desirable
properties (in particular, we will want $T$ to be as nearly {\it constant}
as possible.)
\bigskip
With your knowledge of ODE's, your discussion group has been hired by Perini
Construction to help design an air conditioning/heating plan for the 
new Smith Hall under construction at Holy Cross College.  The goal is to
develop a plan to keep the building 
as close as possible to a constant temperature, given information about the 
ambient temperature $A(t)$ and the building's heat exchange characteristics.  
Unbeknownst to you, Perini has also hired all the other discussion groups in 
the class and given them the same problem (sneaky!!)  They will use the best 
solution for the building in question, and the ``winner'' will receive a nice 
bonus.  So, it's in your best interest to get as good a solution as possible!

\bigskip
\noindent
{\it Discussion/Lab Questions}
\bigskip
\item{A)}  If we assume that $U(t,T)$ depends ``at most linearly'' on $T$, 
that is: $U(t,T) = U_0(t) + U_1(t)T$, with $U_1(t)$ possibly identically zero,
what kind of differential equation is (1)?  Show how to derive a general 
solution in that case.
\bigskip
\item{B)}  By considering what happens with solutions of (1)
in the case $H(t) \equiv 0$ and $U(t,T) \equiv 0$ and $A(t)$ constant, 
what sign should the constant $k$ have?  What does the 
magnitude of $k$ tell you?  What could you do in an actual building
to change the value of $k$?
\bigskip
\item{C)}  The building your group will work with has, of course,
not yet been completed.  But based on the building materials
to be used. placement of windows and doors, etc., estimates have been 
developed by Perini to show that over a period of hours on 
a summer day with constant ambient temperature $A = 75^\circ$F, with
everything (i.e. all machinery in the building) {\it turned off},  
if the building air temperature was $68^\circ$F at some time,
then the temperature 2 hours later would be was $72^\circ$F.  What 
useful information does this give you?  
\bigskip
\item{D)}  In order to design an air conditioning/heating plan over
an extended period (e.g. a full year), we need to make some assumptions 
about what the ambient temperature will look like as a function of 
time.  To derive our model, we will assume that the temperature
varies periodically with period one year.  Since Smith Hall is located 
in Worcester, MA, a {\it ``typical'' year} will have minimum average 
temperature $25^\circ$F on February 1.  The average temperature each 
day will vary continuously up to a a maximum average temperature of 
$80^\circ$F on August 1, then decrease back down to $25^\circ$F by 
the next February 1.   Over each day, the temperature will vary from a 
minimum of 8 degrees below the average for that day to a maximum of 8 
degrees above.   Develop a possible formula giving the temperature 
function $A(t)$ as a function of $t$ satisfying
this description.  You can choose any convenient 
unit of time.  (Note: more realistic ways to model this might be to use 
actual temperature data from several ``representative years'' or to include
some randomness in the ambient temperature function.  Either way
would be more involved, so we'll stick to the exactly periodic $A(t)$!)
\bigskip
\item{E)}  We'll assume that the effects of heat sources within Smith 
Hall are constant and relatively small in size.  Take $H(t) \equiv 0.1$
(degrees F per hour).  Using your $A(t)$ from question D
and the appropriate $k$ value, plot the 
solution of (1) with no heating/air conditioning
 control applied (that is with $U(t,T) \equiv 0$)
using Maple's DEplot command and/or by plotting an analytic solution of (1).  
(See the instructions for Lab 1 to refresh your memory on this!)  Do we really
need heating/air conditioning??
Explain.
\bigskip
\item{F)}  Two standard types of control functions $U(t,T)$ that
try to make $T$ agree with a specified {\it desired temperature} $T_D$ are:
\bigskip
\item{$\bullet$} ``Bang-bang'' controls, where $U(t,T)$ is 
{\it piecewise constant}.  Think of cranking up the air conditioner
to a constant level when the inside temperature is higher than the 
desired temperature (for instance in the summer months), so that contribution
of this term to the rate of change of $T$ is a negative constant for 
some ranges of $t$-values, and cranking up the furnace
to a constant level when the inside temperature
is lower than the desired temperature (through the winter months), 
so that contribution of this term to the rate of change of $T$ is 
a positive constant for some other ranges of $t$-values.  For 
this method, you get to choose the constant rates of heating and
cooling that apply while $T \ne T_D$.  (But see question H below!)
\item{$\bullet$}  ``Proportional" controls, where $U(t,T)$ is 
proportional to the difference between the actual temperature $T$
and the desired temperature $T_D$.  In this case, you get to choose
the constant of proportionality.  (But see question H below!)
\bigskip
\item{} Both these types of control can be implemented easily with standard
hardware, so you have the choice of using either one.  
(For instance, basic thermostats like the ones in most houses are a 
variation of the first of these two ideas: they turn on when the temperature 
gets outside a specified range around a desired temperature, and apply a 
constant rate of heating or cooling while they are on.)
Experiment with both types of controls and plot the corresponding
solutions in Maple to try to get the 
temperature for Smith Hall as close as you can to a comfortable constant 
$T_D \equiv 70^\circ$F over the course of a year.  Explain how you are measuring 
the deviation from the constant desired temperature.  Which method seems to 
be superior?  Explain your assertion.  

\bigskip
\noindent
{\it Maple Notes}
\bigskip
To implement the 
``bang-bang'' idea in Maple, you will probably want to use a procedure to 
compute values for the control function $U(t,T)$.  There is some info about 
programming in Maple on the course homepage -- look at the Maple programming 
primer.  Also, if you do things that way, there is apparently not a 
simple way to get Maple to plot approximate solutions using the DEplot
command.  You will want to use the Maple code for the Runge-Kutta method
that is available from the course homepage.  This will also be demonstrated
in the lab class on September 26.
\bigskip
\item{G)}  Describe your ``best-shot'' heating/cooling plan for Smith 
Hall (your most successful function $U(t,T)$
-- the one that comes closest to the constant temperature goal
according to your specified measure).  
\bigskip
\item{H)}  Suppose that applying heating
or cooling control of $\pm 1$ degree per hour for a time period of 
one hour costs \$30 (probably an underestimate for a building
the size of Smith Hall).  Explain how to estimate the total
heating costs for one year.  If you have
several possible heating plans that seem equally good or bad, 
is there a choice between them suggested by this consideration?
What would be the cost of your best plan?
\bigskip
\item{I)}  What real-world considerations does your model {\it ignore}
that might be important for an HVAC engineer to take into account?
\bigskip
\noindent
{\it Assignment}
\bigskip
Group write-ups giving answers to the above questions, and presenting
a proposed heating plan for Smith Hall giving the type of controls --
bang-bang or proportional -- you want to use, a plot of the corresponding 
temperature function over the year according to your plan, and an estimate 
of the cost to apply your plan.  {\bf Due:}
In class, October 3.  May the best team win!
\bye

