\documentclass[leqno,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{alltt}
\usepackage{email}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{quiz}
\newif\ifsolutions
% \solutionstrue
 \solutionsfalse
\begin{document}
\section*{Quiz 12}

{\Large\bf Problem 1}. {\bf Piecewise Continuous Inputs}

Consider a passenger SUV on a short trip from Salt Lake City to Evanston, on the Wyoming border. The route is I-80 E, 75 miles through Utah. Google maps estimates 1 hour and 11 minutes driving time. The table below shows the distances, time, road segment and average speed with total trip time 1 hour and 38 minutes. Cities enroute reduce the freeway speed by 10 mph, the trip time effect not shown in the table.

%% http://www.motorists.org/speed-limits/state-chart


%Segments for Utah and Wyoming
%
%
%
%Utah
%
%Google map data
%
%Freeway I-80 E to Evanston is 65 mph except for some 45-55 mph segments
%
%Parley's Way Walmart to Kimball Junction, 18.1 miles, 20 min, 65 mph limit
%
%Kimball Junction to Wanship, 11.3 miles, 12 min, 55 mph limit
%
%Wanskip to Coalville, 9.1 miles, 13 min, 70 mph limit
%
%Coalville to Echo Dam interchange, 5.7 miles, 7 min, 70 mph limit
%
%Echo Dam to speed limit change sign, 16.5 miles, 18 min, 70 mph limit
%
%Speed sign to Evanston, Wyoming, 39 miles, 36 min,75 mph
%


$$
\begin{array}{|c|c|c|l|c|}
\hline
\mbox{Miles} & \mbox{Minutes} & \mbox{Speed mph} & \mbox{Road Segment} &\mbox{Posted limit mph} \\
\hline
18.1 & 20 & 54.3 & \mbox{Parley's Walmart to Kimball} & 65 \\ \hline
11.3 & 12 & 56.5 & \mbox{Kimball to Wanship} & 65-55\\ \hline
9.1 & 11 & 49.6 & \mbox{Wanship to Coalville} & 70 \\ \hline
5.7 & 6 & 57 & \mbox{Coalville to Echo Dam} & 70 \\ \hline
16.5 & 16 & 61.9 & \mbox{Echo Dam to 75 mph sign} & 70 \\ \hline
39 & 33 & 70.9 & \mbox{75 mph sign to Evanston} & 75 \\ \hline
\end{array}
$$
%18.1 / (20/60);
%11.3 / (12/60);
%9.1 / (11/60);
%5.7 / (6/60);
%16.5 / (16/60);
%39. /(32/60);
%%
%                              54.3
%                              56.5
%                          49.63636364
%                              57.0
%                          61.87500000
%                          70.90909091

The {\bf velocity function} for the SUV is approximated by
\def\VPC{V_{\mbox{pc}}}
$$
\VPC{}(t) = \left\{
\begin{array}{ccl}
\mbox{Speed mph} & \mbox{Time interval minutes} & \mbox{Road segment} \\
\hline \\
54.3 & 0<t<20 & \mbox{Parley's Walmart to Kimball}  \\
56.5 & 20 < t < 32 & \mbox{Kimball to Wanship}\\
49.6 & 32 < t < 43 &\mbox{Wanship to Coalville}  \\
57.0 & 43 < t < 49 &\mbox{Coalville to Echo Dam}  \\
61.9 & 49 < t < 65 & \mbox{Echo Dam to 75 mph sign}  \\
70.1 & 65 < t < 98 &\mbox{75 mph sign to Evanston}  \\
\end{array}
\right.
$$


The velocity function $\VPC{}(t)$ is piecewise continuous, because it has the general form
$$f(t) = \left\{ \begin{array}{cc}
f_1(t) & t_1 < t < t_2 \\
f_2(t) & t_2 < t < t_3 \\
 \vdots & \vdots \\
f_n(t) & t_n < t < t_{n+1} \\
\end{array}\right.
$$
where functions $f_1,f_2, \ldots, f_n$ are {\bf continuous on the whole real line $-\infty < t < \infty$}. We don't define $f(t)$ at division points, because of many possible ways to make the definition. As long as these values are not used, then it will make no difference. Both right and left hand limits exist at a division point. For Laplace theory, we like the definition $f(0)=\lim_{h\to 0+} f(h)$, which allows the parts rule $\L(f'(t))=s\L(f(t))-f(0)$.

\rule{\textwidth}{0.5ex}
{\Large\bf The Problem}. The SUV travels from $t=0$ to $t=\frac{98}{60}=1.6$ hours. The odometer {\sf trip meter reading} $x(t)$ is in miles (assume $x(0)=0$). The function $\VPC{}(t)$ is an approximation to the {\sf speedometer reading}. Laplace's method can solve the approximation model
$$\frac{dx}{dt} = \VPC{}(60t),\quad x(0)=0,\quad \mbox{$x$ in miles, $t$ in hours},$$
obtaining $x(t)=\int_0^t \VPC(60w)dw$, the same result as the method of quadrature.
Show the details. Then display the piecewise linear continuous trip meter reading $x(t)$.

\ifsolutions
{\bf Solution}.

{\bf Method of Quadrature}. The meaning of the differential equation is that $x'(t)$ is piecewise continuous.
We want $x(t)$ to be continuous, because it is the odometer trip meter reading.
But $x'(t)$ cannot be continuous, if we require $\frac{dx}{dt} = \VPC{}(60t)$,
because the right side is piecewise defined and discontinuous at division points.

{\bf Theorem} (Fundamental Theorem of Calculus)\\
{\sf If $f'(x)$ is piecewise continuous and $f(x)$ is continuous on $a\le x \le b$, then $\int_a^b f'(x)dx = f(b)-f(a)$.

The theorem implies that the method of quadrature works for the equation
$x'(t)=\VPC{}(60t)$. The quadrature method gives the correct
answer
$$x(t) = \int_0^t \VPC{}(60w)dw.$$

Another plan is to
split $x'(t)=\VPC{}(60t)$ into 6 simple equations, $x'=54.3$,
$x(0)=0$ on $0\le t <20$ being the first equation. The next equation
is $x'=56.5$, $x(20)=x_0$, on $20<t<32$. To make $x(t)$ continuous,
we must choose $x_0=1086$, which is the value at the division point
$t=20$ assumed by the first problem ($x'=54.3$, $x(0)=0$ on $0\le t
<20$). This tedious process has to be continued for all 6 segments.
The result is that $x(t)$ is {\bf piecewise linear} between division points.

{\bf Laplace's Method}. The piecewise continuous input $\VPC{}(60t)$ is of exponential order,
because it is zero after $t=98/60$. Laplace theory says it has a Laplace transform
$\L(\VPC{}(60t))$. Assuming a continuous solution $x(t)$, with $x'(t)$ piecewise continuous, then the equation to be satisfied is
$$s\L(x(t))-x(0) = \L(x'(t)) = \L(\VPC{}(60t)).$$
The {\bf Laplace integral theorem} implies
$$\L(x(t)) = \frac{1}{s}\L(\VPC{}(60t)) =  \L\left(\int_0^t \VPC{}(60w)dw\right).$$
Lerch's theorem then implies that the symbol $\L$ cancel from each side, giving the odometer
trip meter reading in terms of the integral of the piecewise continuous input $\VPC{}(60t)$:
$$ x(t) = \int_0^t \VPC{}(60w)dw.$$
We'll use technology to program and evaluate the integral, even though it can be done by hand.
The plan is to plot the trip meter reading, then comment on the slow and fast segments
of the route, by using a clever plot involving the average speed. The last display is the piecewise linear trip meter reading $x(t)$.

\subsection*{Maple}
\begin{verbatim}
 Xpc:=t->piecewise(t<0,0,
 t < 20 ,54.3, t < 32, 56.5, t < 43, 49.6,  t < 49, 57.0,
 t < 65 ,61.9, t < 98, 70.9, 0.0);
 X:=t->int(Xpc(60*w),w=0..t);
 plot(X(t),t=0..98/60); # Almost a straight line.
\end{verbatim}


\includegraphics[scale=0.5]{figures/distance-x-of-t-evanston.png}

\begin{center}
\bf Odometer Trip Meter Reading versus Time in Hours \\
The flat spot means the SUV is stationary.\end{center}

\subsection*{Average Speed}

Define the average value of a function $f(w)$ on $a\le w \le b$ by $\frac{1}{b-a}\int_a^b f(w)dw$.
Then the average speed in the example is
$$\frac{\int_0^{98/60} \VPC{}(60w)dw }{98/60} = 61.04$$

\subsection*{A Clever Plot}

An average driver would try to maintain $61$ mph. The clever plot will create a graphic of $x(t)-61t$ on interval $0\le t \le T_1$, where $T_1$ is the $75$ mile trip time at $61$ mph.

\begin{verbatim}
# Maple code
Xpc:=t->piecewise(t<0,0, t < 20 ,54.3, t < 32, 56.5,
 t < 43, 49.6,  t < 49, 57.0, t < 65 ,61.9, t < 98, 70.9, 0.0);
 X:=t->int(Xpc(60*w),w=0..t);
 AVEspeed:=X(98/60)/(98/60); # AVEspeed = 61.04 mph
 T1:=solve(AVEspeed*t=98,t);  # T1 = 1.6 hours
 plot(X(t)-AVEspeed*t,t=0..T1);
\end{verbatim}

\includegraphics[scale=0.7]{figures/clever-plot-evanston.png}

We see from the graphic that segments of the road cause a slowdown of up to 6 mph, but for a brief interval it is possible to exceed the average speed, due to 70 and 75 mph speed limits.

\begin{verbatim}
# Maple code for piecewise linear display
X:=t->int(Xpc(60*w),w=0..t);convert(X(t),piecewise,t):evalf(%,4);
\end{verbatim}

\medskip

Trip meter at time $t$ =
                    $\cases{ 0.0&$t\leq  0.0$\cr  54.30\,t&$t\leq  0.3333$\cr  56.50\,t- 0.7333&$t\leq  0.5333$\cr  49.60\,t+ 2.947&$t\leq  0.7167$\cr  57.0\,t- 2.357&$t\leq  0.8167$\cr  61.90\,t- 6.358&$t\leq  1.083$\cr  70.90\,t- 16.11&$t\leq  1.633$\cr  99.70&$ 1.633<t$\cr}$

\fi
\vfill\newpage
\rule{\textwidth}{0.5ex}
{\Large\bf Problem 2}. {\bf Switches and Impulses}

\begin{quote}\Large\sf
Laplace's method  solves differential equations. It is the premier
method for solving equations containing switches or impulses.
\end{quote}

\def\BB{}
\def\AA{{\bf Unit Step}~~}
\begin{topics}[\BB]{\AA}
\Writeup{\bf Unit Step}
{ Define $u(t-a) =
\left\{\begin{array}{ll} 1 & t \ge a, \\ 0 & t <
a.\end{array}\right.$. It is a {\large\bf switch}, turned on at $t=a$.}




\Writeup{\bf Ramp}{Define $\ramp(t-a)=(t-a)u(t-a)=\left\{\begin{array}{ll} t-a & t \ge a, \\ 0 & t <
a.\end{array}\right.$, whose graph shape is a continuous {\large\bf  ramp} at $45$-degree incline starting at $t=a$.}


\Writeup{\bf Unit Pulse}{Define
$\pulse(t,a,b)
=\left\{
\begin{array}{ll}
1 & a \le t < b, \\
0 & \mbox{otherwise}
\end{array}\right. = u(t-a)-u(t-b)$.
The switch is {\large\bf ON} at time $t=a$
and then {\large\bf OFF} at time $t=b$.}


\end{topics}


\subsection*{Impulse of a Force}

Define the {\large\bf impulse} of an applied force $F(t)$ on time interval $a\le t\le b$ by the equation
$$\mbox{Impulse of $F$} = \int_{a}^{b} F(t)dt=\left(\frac{\int_{a}^{b} F(t)dt}{b-a}\right)\,(b-a) = \mbox{Average Force $\times$ Duration Time}.$$

\subsection*{Dirac Unit Impulse} A Dirac impulse acts like a hammer hit, a brief injection of energy into a system. It is a special idealization of a real hammer hit, in which only the {\bf impulse} of the force is deemed important, and not its magnitude nor duration.

Define the {\bf Dirac Unit Impulse} by the equation $\delta(t-a)=\dd\frac{du}{dt}(t-a)$, where $u(t-a)$ is the unit step. Symbol $\delta$ makes sense {\sf only under an integral sign}, and the integral in question must be a generalized Riemann-Steiltjes  integral (definition pending), with new evaluation rules. Symbol $\delta$ is an abbreviation like {\bf etc} or {\bf e.g.}, because it abbreviates a paragraph of descriptive text.

\begin{itemize}\sf

\item
Symbol $M\delta(t-a)$ represents an ideal impulse of magnitude $M$ at time $t=a$. Value $M$ is the change in momentum, but $M\delta(t-a)$ contains no detail about the applied force or the duraction. A common force approximation for a hammer hit of very small duration $2h$ and impulse $M$ is Dirac's approximation $$F_h(t)=\frac{M}{2h}\pulse(t,a-h,a+h).$$

\item
The fundamental equation is
$\int_{-\infty}^\infty F(x)\delta(x-a)dx = F(a)$. Symbol $\delta(t-a)$ is not manipulated as an ordinary function, but regarded as $du(t-a)/dt$ in a Riemann-Stieltjes integral.
\end{itemize}

{\bf THEOREM} ({\sf Second Shifting Theorem}). Let $f(t)$ and $g(t)$ be piecewise
continuous and of exponential order. Then for $a\ge 0$,
$$\begin{array}{l@{\hspace{3pc}}l}
\mbox{\bf Forward table} & \mbox{\bf Backward table} \\[2ex]
\dd\L\left( f(t-a)u(t-a)\right) = \dd e^{-as}\L(f(t)) & 
\dd  e^{-as}\L(f(t)) = \dd\L\left( f(t-a)u(t-a)\right) \\[2ex]
\dd\L(g(t)u(t-a)) =\dd e^{-as}\L\left( \left. g(t)\right|_{t=t+a}\right) &
\dd e^{-as}\L(f(t))=\dd \L\left( \left.f(t)u(t)\right|_{t=t-a}\right). \\
\end{array}
$$

\vfill\newpage
\rule{\textwidth}{0.5ex}
{\Large\bf The Problem}. Solve the following by Laplace methods.


\begin{itemize}
\item[{\bf (a)}]


Forward table. Compute the Laplace integral for terms involving the unit step, ramp and pulse, in these special cases:

$$ (1)~ \L((t-1)u(t-1)) \quad (2)~ \L(e^t\ramp(t-2)),
\quad (3)~ \L(5\pulse(t,2,4)).
$$

\item[{\bf (b)}]  Backward table. Find $f(t)$ in the following special cases.

$$ (1)~ \L(f)=\frac{e^{-2s}}{s} \quad (2)~ \L(f)=\frac{e^{-s}}{(s+1)^2}
\quad (3)~ \L(f)=e^{-s}\frac{3}{s} - e^{-2s}\frac{3}{s}.
$$


\item[{\bf (c)}] Dirac Impulse and the Second Shifting theorem. Solve the following forward table problems.

$$ (1)~ \L(2\delta(t-5)),
\quad (2)~ \L(2\delta(t-1)+5\delta(t-3)), \quad (3)~ \L(e^t \delta(t-2)).
$$

The sum of Dirac impulses in (2) is called an {\bf impulse train}. The numbers 2 and 5 represent the applied {\bf impulse} at times 1 and 3, respectively.
\end{itemize}

\rule{\textwidth}{0.5ex}
\ifsolutions
\subsection*{Solutions}




{\bf Solution (a)}. The forward second shifting theorem applies.

 (1)~ $\L((t-1)u(t-1))=\L\left(f(t-a)u(t-a)\right)$ where $f(t)=t$ and $a=1$. Then the second shifting theorem implies
  $\L((t-1)u(t-1))=e^{-as}\L(f(t))=e^{-s}\L(t)=\frac{1}{s^2}e^{-s}$. An observation is that this problem is identical to the problem $\L(\ramp(t-1))$.

  (2)~ $\L(\ramp(t-2))=\L((t-2)u(t-2))=e^{-as}\L(f(t))=e^{-2s}\L(t)=e^{-2s}\frac{1}{s^2}$, as in part (a). The first shifting theorem (canceled $e^{at}$ is corrected by shift $s=s-a$) then applies: $\L(e^t\ramp(t-2))=\left.\L(\ramp(t-2))\right|_{s=s-1} = \left.\frac{e^{-2s}}{s^2}\right|_{s=s-1} = \frac{e^{2-2s}}{(s-1)^2}$.

 (3)~ $\L(5\pulse(t,2,4)) = 5(\L(u(t-2))-\L(u(t-4)) ) = \frac{5e^{-2s}}{s} - \frac{5e^{-4s}}{s}$.

\bigskip

{\bf Solution (b)}. Presence of an exponential $e^{-as}$ signals unit step $u(t-a)$ in the answer, the main tool being the backward second shifting theorem.

(1)~  $\L(f)=\frac{e^{-2s}}{s} = e^{-2s}\L(1)=e^{-as}\L(g)$ where $a=2$ and $g(t)=1$. Then the second shifting theorem implies $\L(f)=\L(\left. g(t)u(t)\right|_{t=t-a}) = \L(\left. 1\cdot u(t)\right|_{t=t-a}) = \L(u(t-2))$.
Lerch implies $f=u(t-2)$.

(2)~  $\L(f)=\frac{e^{-s}}{(s+1)^2}=e^{-as}\L(g(t))$ where $a=1$ and $\L(g(t))=\frac{1}{(s+1)^2} = \L(te^{-t})$ (first shifting theorem). Then $\L(f)=e^{-as}\L(g(t))=\L(\left. g(t)u(t)\right|_{t=t-a}) = \L(\left. te^{-t}u(t)\right|_{t=t-1}) =\L((t-1)e^{1-t}u(t-1))$.
Lerch implies $f=e^{1-t}(t-1)u(t-1)=e^{1-t}\ramp(t-1)$.

(3)~  $\L(f)=e^{-s}\frac{3}{s} - e^{-2s}\frac{3}{s}=\L(3u(t-1))-\L(3u(t-2))$, because $\L(u(t-a))=\frac{e^{-as}}{s}$.  Lerch implies $f=3u(t-1)-3u(t-2)=3\pulse(t,1,2)$.

\bigskip

{\bf Solution (c)}. The main result for Dirac unit impulse $\delta$ is the equation
$$\int_)^\infty g(t)\delta(t-a)dt = g(a),$$
valid for $g(t)$ continuous on $0\le t < \infty$. When $g(t)=e^{-st}$, then the equation implies the Laplace formula $\L(\delta(t-a))=e^{-as}$.


(1)~ $\L(2\delta(t-5)) = 2\L(\delta(t-a))$ where $a=5$. Then $\L(\delta(t-a))=e^{-as}$ implies $\L(2\delta(t-5))=2e^{-5s}$.

(2)~ $\L(2\delta(t-1)+5\delta(t-3))=2\L(\delta(t-1))+5\L(delta(t-3))=2e^{-s}+5e^{-3s}$.

(2)~ $\L(e^t \delta(t-2))= \left.\L(\delta(t-2))\right|_{s=s-1}$ by the first shifting theorem. Then $\L(\delta(t-2))=e^{-2s}$ implies $\L(e^t \delta(t-2))= \left.e^{-2s}\right|_{s=s-1} = e^{2-2s}$.


\rule{\textwidth}{0.5ex}
\else
\vfill\newpage
\fi
\section*{Reference: The Riemann-Stieltjes Integral}

{\bf Definition}

The Riemann-Stieltjes integral of a real-valued function f of a real variable with respect to a real monotone non-decreasing function g is denoted by

   $$ \int_a^b f(x) \, dg(x)$$

and defined to be the limit, as the mesh of the partition

   $$ P=\{ a = x_0 < x_1 < \cdots < x_n = b\}$$

of the interval $[a, b]$ approaches zero, of the approximating Riemann–Stieltjes sum

    $$S(P,f,g) = \sum_{i=0}^{n-1} f(c_i)(g(x_{i+1})-g(x_i))$$

where $c_i$ is in the $i$-th subinterval $[x_i, x_{i+1}]$. The two functions $f$ and $g$ are respectively called the {\bf integrand} and the {\bf integrator}.

The {\bf limit} is a number $A$, the value of the Riemann-Stieltjes integral. The meaning of the limit: Given $\varepsilon > 0$, then there exists $\delta > 0$ such that for every partition $ P=\{ a = x_0 < x_1 < \cdots < x_n = b\}$ with $\mbox{\bf mesh}(P)=\max_{~0\le i< n~}(x_{i+1}-x_i) < \delta$, and for every choice of points $c_i$ in $[x_i, x_{i+1}]$,

    $$|S(P,f,g)-A| < \varepsilon. \, $$


%\vfill\newpage
%\rule{\textwidth}{0.5ex}
%{\Large\bf Problem 3}. {\bf Experiment to Find the Transfer Function $h(t)$}
%
%
%Consider a second order problem
%$$ax''(t)+bx'(t)+cx(t) = f(t)$$
%which by Laplace theory has a particular solution solution defined as the convolution of the transfer function $h(t)$ with the input $f(t)$,
%$$x_p(t) = \int_0^t f(w)h(t-w)dw.$$
%Examined in this problem is another way to find $h(t)$, which is the system response to a Dirac unit impulse with zero data. Then $h(t)$ is the solution of
%$$ah''(t)+bh'(t)+ch(t) = \delta(t),\quad h(0)=h'(0)=0.$$
%
%
%\rule{\textwidth}{0.5ex}
%{\Large\bf The Problem}. Assume $a,b,c$ are constants and define $g(t)=\int_0^t h(w)dw$.
%
%{\bf (a)}~ Show that $g(0)=g'(0)=0$, which means $g$ has zero data.
%
%{\bf (b)}~ Let $u(t)$ be the unit step. Argue that $g$ is the solution of
%$$ag''(t)+bg'(t)+cg(t) = u(t),\quad g(0)=g'(0)=0.$$
%
% \begin{quote}\sf
% The fundamental theorem of calculus says that $h(t)=g'(t)$. Therefore, to compute the transfer function $h(t)$, find the response $g(t)$ to the unit step with zero data, followed by computing the derivative $g'(t)$, which equals $h(t)$.
%
% The experimental impact is important. Turning on a switch creates a unit step,
%generally easier than designing a hammer hit.
% \end{quote}
%
%{\bf (c)}~ Illustrate the method for finding the transfer function $h(t)$ in the special case
%$$x''(t) + 2x'(t)+5x(t) = f(t).$$
%
%
%\rule{\textwidth}{0.5ex}
%\subsection*{Solutions}
%
%{\bf (a)}~ $g(0)=\int_0^0 h(w)dw = 0$, $g'(0)=h'(0)=0$.
%
%
%{\bf (b)}~ Let $u(t)$ be the unit step. Initial data was decided in part (a). The Laplace applied to $ag''(t)+bg'(t)+cg(t) = u(t)$ gives $(as^2+bs+c)\L(g) = \L(u(t))$. Then $\L(g)=\L(h(t))\L(u(t))=\L(h(t))\frac{1}{s}\L\left(\int_0^t h(r)du\right)$ by the {\bf integral theorem}. Lerch's theorem then says $g(t)=\int_0^t h(r)dr$.
%
%{\bf (c)}~ For equation $x''(t) + 2x'(t)+5x(t) = f(t)$ we replace $x(t)$ by $g(t)$ and $f(t)$ by the unit step $u(t)$, then solve $g''(t) + 2g'(t)+5g(t) = u(t)$, obtaining $\L(g)=\frac{1}{s}\frac{1}{s^2+2s+5}=\L(\frac15-\frac{1}{10}e^{-t}(2\cos(2t)+\sin(2t)))$. Then $g(t)=\frac15-\frac{1}{10}e^{-t}(2*\cos(2t)+\sin(2t))$ and $h(t)=g'(t)=\frac12e^{-t}\sin(2t)$.

\end{document}
\endinput
