\docname{sess5.4}
\doctitle{Several System Responses}

\mylhead
\myrhead

\title{\doctitle}
\maketitle

\section{Introduction}

We are going to continue with examples of constant coefficient
first-order linear DE's. We remind you that our formula for the
general solution to $\overdot y+ky=q(t)$ is:
\begin{equation}\label{eq5.4.0}
y=e^{-kt}\left(\int e^{kt} q(t)dt+c\right).
\end{equation}

We want to get some feeling for how the system response is related to
the input. The temperature model will be a good guide.  In two
notations -- suggestive and neutral, respectively -- the ODE is:
\begin{equation}\label{eq5.4.1}
\overdot T+kT=kT_e(t) \qquad \qquad \overdot y+ky=kq_e(t)=q(t).
\end{equation}
Note that the neutral notation writes the input in two different
forms: the $q(t)$ we have been using, and also the form $kq_e(t)$ with
the $k$ factored out. This corresponds to the way the input normally
appears in physical problems and offers some advantages: for instance,
$q_e$ and $y$ have the same units, whereas $q$ and $y$ do not. In
trying to relate reponse with input, the relation will be clearer if
we relate $y$ with $q_e$, rather than with $q$. We will use for $q_e$
the generic name {\bf physical input}, or if we have a specific model
in mind, the \textit{temperature} input, \textit{concentration} input,
and so on.
\hbcom{Is ``relate with'' correct usage?  I'm tempted to change to
  ``relate to''.}

The expected behavior of the temperature model suggests general questions such as:
\begin{itemize}
\item Is the response the same type of function as the physical input?
\item What controls its size?
\item Does the graph of the response lag behind that of the physical input?
\item What controls the size of the lag?
\end{itemize}
Our plan is to get some feeling for the situation by answering
these questions for several simple physical inputs. Throughout, keep
the temperature model in mind to guide your intuition.

\section{Simple Inputs}

Example 1: Find the response of the system described by
(\ref{eq5.4.1}) to the physical inputs $q_e(t) = 1$ and $q_e(t) = t$.

Solution: The ODE is $\overdot y+ky=kq_e$.

If $q_e=1$, a solution by inspection is $y=1$. We can use
superposition to combine this with the solution $Ce^{-kt}$ to the
homogenous equation $\overdot x+kx=0$. The general solution to our ODE
is $y=1+Ce^{-kt}$.


If $q_e=t$, the ODE is $\overdot y+ky=kt$.  We use the integrating factor
$e^{kt}$ and integrate by parts:
\begin{align*}
y&=e^{-kt}\left(\int kte^{kt}dt+c\right)\\
&=ke^{-kt}\left(\frac{te^{kt}}k-\frac{e^{kt}}{k^2}+c\right)\\
&=t-\frac 1k+ce^{-kt}.
\end{align*}
The simplest solution is $y=t-\frac 1k$.  Since $ce^{-kt}$ goes to
$0$, we'll call $y=t-\frac 1k$ a steady-state solution.

Thus the response of (\ref{eq5.4.1}) is identical to the physical
input $t$, but with a time lag $\frac 1k$. This is reasonable when one
thinks of the temperature model: the internal temperature increases
linearly at the same rate as the temperature of the exterior, but with
a time lag dependent on the conductivity: the higher the conductivity,
the shorter the time lag.
\hbcom{Have we used the word conductivity?  Might want to refer directly to $k$.}

Using the superposition principle for inputs, it follows from Example
(1) that for the ODE $\overdot y+ky=kq_e$, the response to a general
first order physical input is described by:\\
\smallskip\\
{\bf linear input}
\begin{equation}\label{eq5.4.2}
\mbox{physical input: } q_e=a+bt
\quad \text{reponse: }a+b\left(t-\frac 1k\right).
\end{equation}
\hbcom{Replaced ``linear'' with ``first order'' in response to Haynes' remark.}

In the previous example, we paid no attention to initial values. If
they are important one cannot just give the steady-state solution as
the response.  One has to take account of them, either by using a
definite integral or by giving the value of the arbitrary constant
$c$. Examples in the next section will illustrate.

\section{Response to Discontinuous Inputs, $k>0$}

The most basic discontinuous function is the {\bf unit-step function}
at a point $a$, defined by:
\begin{equation}\label{eq5.4.3}
u_a(t)=\begin{cases}0&t<a\\1&t>a.\end{cases}
\end{equation}
(We leave its value at $a$ undefined, though some books give it the value 0 there, others the value 1 there.)

Example 2: It's a nice, cool morning with constant temperature.
Suddenly the sun comes out and the air warms up to a higher constant
temperature.  What's the response of my cooler to this signal?

To simplify, let me take a pretty unrealistic but numerically simple
case: $y(t) = 0$ for $t < a$, $q_e(t)$ is given by $u_a(t)$. So our
IVP is $\overdot y + ky = k u_a(t)$, with $y(a) = 0$.

%Find the response of the IVP $y'+ky=kq_e$, $y(0)=0$, for
%$t\geq 0$, to the unit-step physical input $u_a(t)$, where $a\geq 0$.
\hbcom{Replaced math and comma salad with Haynes' description.}

Solution: For $t<a$ the input is 0, so the response is
0. For $t\geq a$ the solution for the physical input $u_a(t)$ is the
function $1+ce^{-kt}$, according to Example 1.

We still need to fit the value $y(a)=0$ to the response for $t\geq
a$. We get $1+ce^{-kt}=0$, so that $c=-e^{ka}$. We now assemble the
results for $t<a$ and $t\geq a$ into one expression; for the latter,
we also put the exponent into a more suggestive form. We get finally:\\
\smallskip\\
{\bf unit-step input}
\begin{equation}\label{eq5.4.4}
\text{physical input: } u_a(t), a\geq 0 \quad \text{response:
}y(t)=\begin{cases}0&0\leq t<a;\\1-e^{-k(t-a)}&t\geq a.\end{cases}
\end{equation}
Note that the response is just the translation $a$ units to the right of the response to the unit-step input at $0$.

\smallskip

We next use the temperature model to explore another example of
discontinuous input.  In this case, the physical input is an external
bath which is initially ice-water at 0 degrees, then replaced by water
held at a fixed temperature for a time interval, then replaced once
more by ice-water.

Example 4: Find the response of $\overdot y+ky=kq_e$ to the physical
input:\\
\smallskip\\
{\bf unit-box function} on $[a,b]$
\begin{equation}\label{eq5.4.5}
u_{ab}=\begin{cases}1&a\leq t\leq
  b\\0&\text{otherwise}\end{cases}\qquad 0\leq a<b;
\end{equation}

Solution: There are at least three ways to do this:
\begin{enumerate}[a)]
\item Express $u_{ab} $ as a sum of unit step functions and use (4) together with superposition of inputs;
\item Use the function $u_{ab}$ directly in a definite integral expression for the response;
\item Find the response in two steps: first use (4) to get the response $y(t)$ for the physical input $u_a(t)$; this will be valid up till the point $t=b$. 

Then, to continue the response for values $t>b$, evaluate $y(b)$ and find the response for $t>b$ to the input $0$, with initial condition $y(b)$.
\end{enumerate}

We will follow (c), leaving the first two as exercises.

By (\ref{eq5.4.4}), the response to the physical input $u_a(t)$ is:
$$y(t)=\begin{cases}0&0\leq t<a\\1-e^{-k(t-a)}&t\geq a.\end{cases}$$
This is valid up to $t=b$, since $u_{ab}(t)=u_a(t)$ for $t\leq
b$. Evaluating at $b$,
\begin{equation}\label{eq5.4.6}
y(b)=1-e^{-k(b-a)}.
\end{equation}
Using
(\ref{eq5.4.0}) to find the solution for $t\geq b$ we note first that
the steady-state solution will be 0, since $u_{ab}=0$ for $t>b$. Thus
by (\ref{eq5.4.0}) the solution for $t>b$ will have the
form:
\begin{equation}\label{eq5.4.7}
y(t)=0+ce^{-kt}
\end{equation}
where $c$ is determined from
the initial value (\ref{eq5.4.6}). Equating the initial values $y(b)$ from (\ref{eq5.4.6}) and
(\ref{eq5.4.7}), we get:
\[ce^{-kb}=1-e^{-kb+ka}\]
from which:
\[c=e^{kb}-e^{ka}.\]
By (\ref{eq5.4.7}):
\begin{equation}\label{eq5.4.8}
y(t)=(e^{kb}-e^{ka})e^{-kt},t\geq b.
\end{equation}
After combining exponents in (\ref{eq5.4.8}) to give an alternative
form for the response we assemble the parts, getting the response:
\smallskip\\
{\bf unit-box input } $u_{ab}$
\begin{equation}\label{eq5.4.9}
y(t)=\begin{cases}0&0\leq t\leq
  a;\\1-e^{-k(t-a)}&a<t<b\\e^{-k(t-b)}-e^{-k(t-a)}&t\geq b.\end{cases}
\end{equation}


