% 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{url}
\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\\CIRCUIT TUNER}



\markboth{Circuit Tuner}{Circuit Tuner}






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

% \makeStitle
% replaces: \makeStitle
% Choose only one of the following:
% \makeStitlePDFLaTex  % <--- use this for PDFLaTex (jpg and pdf image files etc.)
\makeStitlePDFLaTex    




\begin{abstract}
We present essential definitions and laws for the study of  simple RLC electrical circuits and build a differential equation model using these notions. We describe how such a circuit can be used to tune a radio to a certain input frequency.
\end{abstract}

\section*{SCENARIO DESCRIPTION}



Differential equations prove exceptional at modeling electrical circuits. In fact  the very simple circuit, which is fundamental to larger circuit building,   and  three of the most fundamental electrical objects, a resistor, a capacitor, and inductor, can be modeled by  a constant coefficient, linear, second order differential equation. Consider the circuit in Figure~\ref{fig:4-60-RLCCircuitFirst}. The EMF $E(t)$ represents an Electromotive Force generated by an excess of electrons on one side of a barrier (the Switch) and a paucity of electrons on the other side of the barrier. When the switch is thrown the electrons in the excess area (say to the left of the circle marked EMF)  seek to take the path of least resistance to get to the location of the paucity of electrons (to the right of the circle marked EMF). Thus we say there is a {\it potential\/} awaiting the switch to be thrown and that potential (just like water held high and then released to run down a descending track) causes electrons to flow clockwise through the capacitance ($C$), through the resistance ($R$), and finally through the inductance ($L$) until these electrons are ``home" to the region of paucity of electrons.

\begin{figure}[h]
\begin{center}
\includegraphics[width=11.6cm]{4-60-RLCCircuitFirst.eps}

%\vspace*{-10.3 true cm}

\parbox{12.2 true cm}{\caption{\label{fig:4-60-RLCCircuitFirst} Diagram of an RLC circuit with imposed EMF $E(t)$ (generator or a battery) producing current, $I(t)$, in the circuit.}}
\end{center}
\end{figure}



Across each one of these devices ($R$, $L$, and $C$) there is a change in the potential or a voltage drop and the net change in potential around the circuit clockwise starting from the left of the EMF to the right of the EMF has  to equal the potential across the EMF itself. It is as if water has a drop of $h$ feet along the route from the left of EMF, through $C$, through $R$, and then through $L$, back to the right side of EMF. The total drop in height over this route is the sum of the three drops over $C$,  $R$, and  $L$. Thus $h$ has to  equal  the sum of the drops over each of the elements, i.e.  over $C$, over $R$, and over $L$. Calling these drops  $h_C$, $h_R$, and $h_L$ respectively,  we then note that $h = h_C + h_R + h_L$.

The electric potential is measured in a unit called a {\it volt\/} and one can think of a volt as the amount of energy required to move a unit charge to a specific spot in a static electric field. Our learning curve here does not include carrying all the baggage of fully developing the notions surrounding electrical circuits, even of the elementary basics of the physical devices that make up a circuit. However, we will refer to some laws, first organized by Kirchhoff \cite{WikiKirchhoff2016} and pertaining to the potential in a circuit.


Charge, $Q(t)$, is a measure of the number of electrons present and if we have $6.241 \times 10^{18}$ electrons  then we say we have one {\it coulomb\/} of charge. If  charge passes by a point   then we say we have a {\it current\/}.  An {\it ampere\/} is a measure of the amount of electric charge (electrons) which passes by a point per unit time, or the current at a point in a circuit at time $t$. If some $6.241 \times 10^{18}$ electrons pass a given point each second we will say there is a current flow of one  {\it  ampere\/}. Usually $I(t)$ refers to the amount of current (in amperes or amps) passing by the point or in that branch of the circuit at time $t$.

First we need to do some identification of the potential or voltage drop across each of the three devises we are using: capacitance ($C$), resistance ($R$), and inductance ($L$).  Each of these devices has a unique physical construction, each is rated with different units, each deals with the electrons coming into it differently and the effect the device has on these electrons. Each has a potential or voltage drop across it and Kirchhoff's Voltage Law \cite{WikiKirchhoff2016}  says that the sum of the voltages in a circuit is equal to that of the induced ${\rm Emf}(t)$ voltage at any time $t$ in seconds. To get this sum we need the voltage drop across each device.

\begin{itemize}
\item [(C)] The voltage (in volts) drop, $E_C$, across a capacitor rated at $C$ {\it farads\/} is 

\begin{equation}\label{eq:farad}
E_C = \frac{1}{C}\cdot Q(t)\, .
\end{equation}
  
\item [(R)] The voltage (in volts) drop, $E_R$,across a resistor rated at $R$ {\it ohms} is 

\begin{equation}\label{eq:ohm}
E_R = R\cdot  \frac{dQ(t)}{dt} = R\cdot I(t)\, .
\end{equation}


\item [(L)] The voltage (in henry) drop,  $E_L$, across an inductor rated at $L$ {\it henrys} is 

\begin{equation}\label{eq:henry}
E_L = L\cdot  \frac{dI(t)}{dt}\, .
\end{equation}
\end{itemize}

Thus from expressions (\ref{eq:farad}), (\ref{eq:ohm}), and  (\ref{eq:henry}) and the fact that these voltages have to sum up to equal the induced voltage, ${\rm Emf}(t)$, across the circuit, we have a differential equation (\ref{eq:FirstSum}) describing charge, $Q(t)$, in a circuit depicted in Figure~\ref{fig:4-60-RLCCircuitFirst}, for we note $I(t) =  \frac{dQ(t)}{dt}$ and hence $\frac{dI(t)}{dt} =\frac{dQ^2(t)}{dt^2}$.

\begin{equation}\label{eq:FirstSum}
E_C + E_R + E_L = \frac{1}{C}\cdot Q(t) + R\cdot \frac{dQ(t)}{dt} + L\cdot \frac{dI(t)}{dt} = {\rm Emf}(t)\, .
\end{equation}


Now watch the magic as we differentiate both sides of (\ref{eq:FirstSum}) to obtain something akin to a familiar looking differential equation~(\ref{eq:FirstSum}).

\begin{equation}\label{eq:SecondSum}
\frac{1}{C}\cdot \frac{dQ(t)}{dt} + R\cdot \frac{dQ^2(t)}{dt^2} + L\cdot \frac{dI^2(t)}{dt^2} = {\rm Emf}'(t)\, .
\end{equation}


Finally, writing the variables in terms of $I(t)$ and not $I(t)$ {\it and\/} $Q(t)$ we see (\ref{eq:CircuitODE})

\begin{equation}\label{eq:CircuitODE}
L\cdot \frac{dI^2(t)}{dt^2} + R\cdot \frac{dI(t)}{dt}+ \frac{1}{C}\cdot I(t)    = {\rm Emf}'(t)\, .
\end{equation}

Of course we will have to tell the circuit what initial current is in it, i.e. $I(0) = 0$ usually until we turn the switch on and also $I'(t) = 0$. There you have it, differential equation~(\ref{eq:CircuitODE}) is exactly the same as  differential equation~(\ref{eq:SpringMassDash1}) for the spring mass dashpot system with appropriate terms identified. Can you identify the right terms' correspondences?

\begin{equation}\label{eq:SpringMassDash1}
m\cdot  y''(t) + c\cdot  y'(t)+ k\cdot  y(t) = f(t) \, , \quad y(0) = y_0 \, ,  \quad  y'(0) = v_0\, .
\end{equation}
\noindent If we make the  identifications in Table~\ref{table:Compare} all the tools we develop for the mechanical motion situation of  spring mass dashpots will be useful in our study of RLC circuits and vice-versa.


\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|} \hline\hline
Spring Mass Dashpot & RLC Circuit \\ \hline\hline
mass $m$ & inductance $L$\\ \hline
damping or resistance $c$ &  resistance $R$ \\ \hline
spring constant $k$  &inverse of capacitance $\frac{1}{C}$ \\ \hline
forcing function $f(t)$ & derivative of induced voltage ${\rm Emf}'(t)$ \\ \hline
\end{tabular}
\caption{\label{table:Compare} Comparison of terms between Spring Mass Dashpot and RLC Circuit differential equation.}
\end{center}
\end{table}


Of course, this RLC circuit equation will need a non-homogeneous term, ${\rm Emf}(t)$ to supply electrons and  we will need to address the solution of such equations.    Let us look at one circuit before leaving them sit for a while.

\subsubsection*{Simple RLC Circuit Model, Solution, and Interpretation}

We now examine a circuit in which a current is present and does not have a driving ${\rm Emf}(t)$, expecting things to dampen out, in this case current to run out.


Again, let us consider an RLC circuit  as depicted in Figure~\ref{fig:4-60-RLCCircuit} in which we have an initial current, $I(0) = 3.2$ amps with a resistance of $R = 7$ ohms, an inductance of $ L = 1$ henry, and a capacitance of $C = 0.1$ farads.  Since we have some current in the circuit already $I(0) = 3.2 >0$ at the start we shall not need an inducing ${\rm Emf}(t)$, so ${\rm Emf}(t) = 0$. Let us see what happens to the current in the circuit by solving the appropriate  RLC circuit differential equation~(\ref{eq:specCircuit})

\begin{equation}\label{eq:specCircuit}
\frac{1}{0.1}\cdot I(t) + 7\cdot \frac{dI(t)}{dt} + 1\cdot \frac{dI^2(t)}{dt^2} = {\rm Emf}'(t) = 0\, ,\quad  I(0) = 3.2 \, \quad {\rm and} \quad  I'(0) = 0 \, .
\end{equation}
\noindent or as we are   accustomed to reading it

\begin{equation}\label{eq:specReadCircuit}
 1\cdot \frac{dI^2(t)}{dt^2} + 7\cdot \frac{dI(t)}{dt} +10 \cdot I(t) =  0\, ,\quad  I(0) = 37 \, \quad {\rm and} \quad  I'(0) = 0 \, .
\end{equation}


\subsection*{Activity 0}
\begin{itemize}
\item  [a)] Solve the RLC circuit differential equation~(\ref{eq:specReadCircuit}) for $I(t)$. Warning for {\it Mathematica\/} users: {\it Mathematica\/} reserves the variable {\tt I} as the symbol for $i$, the imaginary square root of $-1$, so here we will  use $x(t) = I(t)$ for the current in the circuit.
\item [b)]  Consider the values of $R$ to be 0.007, 0.07, 0.7, 7, 70, and then 700, and solve (\ref{eq:specReadCircuit}) in each case, keeping all other values the same, and plot the solution for the current in the circuit over the time interval $[0,25]$ s with a vertical plot interval $[-3,3]$ in each case. Identify each plot with its associated $R$ value and describe what is happening to the current, $I(t)$, in each corresponding circuit over time, $t$. 
\end{itemize}


\subsection*{Moving On}

Let us consider the differential equation~(\ref{eq:circuit}) for an RLC circuit (see Figure~\ref{fig:4-60-RLCCircuit}) with driving voltage ${\rm Emf}(t) = \sin(w t)$ (current $I(t) = y(t))$:

\begin{equation}\label{eq:circuit}
L\cdot  y''(t)+R\cdot  y'(t)+\frac{1}{C}\cdot y(t)= {\rm Emf}'(t) = \omega  \cos (\omega t)
\end{equation}


\begin{figure}[h]
\begin{center}
\includegraphics[width=9.6cm]{4-60-RLCCircuit.eps}


\parbox{12.2 true cm}{\caption{\label{fig:4-60-RLCCircuit} Diagram of an RLC circuit with imposed EMF $E(t)$ (generator or a battery) producing current, $I(t)$, in the circuit.}}
\end{center}
\end{figure}


As an example of the power of computer algebra systems, here is the {\it Mathematica\/} code for solving and grabbing the solution of (\ref{eq:circuit}):

\vspace*{.15 true cm}
{\tt ys[t\_,R\_,L\_,C\_,$\omega$\_] = 
 y[t]/.DSolve[\{L y''[t]+R y'[t]+1/C y[t]

\hspace*{2.2 true cm} == D[Emf[t, $\omega$], t], y[0] == 0, y'[0] == 0\}, y[t], t][[1]]},

\vspace*{.15 true cm}

\noindent with output about a half  page long! We do not repeat it here though. However, in this solution there is the  transient solution  involving $R$, $L$, and $C$ with no $\omega$'s and then there is the steady state solution (\ref{eq:ssSol}):

\begin{equation}\label{eq:ssSol}
y_{\rm steady \,\,\, state}(t) = \frac{C \omega  \left(\left(1-C L \omega
   ^2\right) \cos (\omega t)+C R \omega  \sin
   (\omega  t)\right)}{C^2 \omega ^2 \left(L^2
   \omega ^2+R^2\right)-2 C L \omega ^2+1}  
\end{equation}
 

We would like to study what is called {\it gain}. Gain is the ratio of the amplitude of the steady state  output voltage, $V_{\rm out}$, to the  amplitude of th input voltage , $V_{\rm in}$, i.e. ${\rm gain} = \frac{V_{\rm out}}{V_{\rm in}}$. We measure $V_{\rm out}$ as the amplitude of the steady state voltage  across the resistance $R$ in the circuit, i.e. $V_{\rm out} = R\cdot {\rm Amplitude}(y_{\rm steady \,\,\, state}(t))$. In our case $V_{\rm in}$ is just 1, for ${\rm Emf}(t) = \sin(\omega t)$.

\subsection*{Trigonometry Pause and Phase Angle}

In our solutions for a second order (\ref{eq:Useful}),

\begin{equation}\label{eq:Useful}
a\cdot  y''(t) + b\cdot  y'(t) + c\cdot  y(t) = 0\,, \quad  y(0) = y_0\,\,\, {\rm and} \,\,\,\, y'(0) = 0 \, ,
\end{equation}

\noindent the case where the  discriminant, $b^2 - 4\cdot a \cdot c$ is negative gives rise to complex roots to the characteristic equation and the general solution looks like (\ref{eq:gensol})

\begin{eqnarray}\label{eq:gensol}\nonumber
y(t) &=& A e^{\left(\frac{-b}{2a}t\right)}\sin\left(\frac{\sqrt{4ac - b^2}}{2a}t\right) + B   e^{\left(\frac{-b}{2a}t\right)}\cos\left(\frac{\sqrt{4a c - b^2}}{2a}t\right)\\ \nonumber
  &=&  e^{\left(\frac{-b}{2a}t\right)} \left(A \sin\left(\frac{\sqrt{4 a c - b^2}}{2a}t\right) + B \cos\left(\frac{\sqrt{4 a c - b^2}}{2a}t\right)\right)\\
\end{eqnarray}

If we let $\left(\frac{\sqrt{4 a c - b^2}}{2a}\right) = \omega$ then (\ref{eq:gensol}) simplifies to  (\ref{eq:gensolw}) 

\begin{equation}\label{eq:gensolw}
y(t) =  e^{\left(\frac{-b}{2a}t\right)}\left(A \sin(\omega t) + B   \cos(\omega t)\right)\, .
\end{equation}


We wish to combine the  sine and cosine terms in (\ref{eq:gensolw}) into one sine function with a phase angle. We can do this because of the trigonometric identity:

$$ \sin(x + y) = 
\sin(x)\cdot \cos(y) + \cos(x) \cdot \sin(y) \, ,$$

\noindent and the diagram in Figure~\ref{fig:4-60-PhaseTriangle}. Identifying  $x = \omega t$ and $y = \theta$ and multiplying and dividing each expression by $\sqrt{A^2 + B^2}$ we can convert the expression $A \sin(\omega t) + B   \cos(\omega t)$ to 

\begin{eqnarray}\nonumber \label{eq:convert}
 &\,& \sqrt{A^2 + B^2}\left(\frac{A}{\sqrt{A^2 + B^2}} \sin(\omega t) + \frac{B}{\sqrt{A^2 + B^2}}
 \cos(\omega t)\right) \\ \nonumber
&&    \quad = \sqrt{A^2 + B^2}\left(\cos(\theta) \sin(\omega t) + \sin(\theta) \cos(\omega t)\right) \\ 
&& \quad = \sqrt{A^2 + B^2}\left(   \sin ( \omega t + \theta )\right)
\end{eqnarray}

\noindent where $\theta = {\rm Arctan}\left(\frac{B}{A}\right)$ is called the {\it phase shift}.


\begin{figure}[h]
\begin{center}
\vspace*{-1 true cm}
\includegraphics[width=8.6cm]{4-60-PhaseTriangle.eps}

\vspace*{-1 true cm}

\parbox{12.2 true cm}{\caption{\label{fig:4-60-PhaseTriangle} Useful triangle diagram in rearranging an oscillating solution to a second order differential equation which results in a single phase shifted solution from the sum of sine and cosine terms in solution. }}
\end{center}
\end{figure}

From (\ref{eq:convert}) we can write our solution (\ref{eq:gensolw}) as (\ref{eq:gensolp}),


\begin{equation}\label{eq:gensolp}
y(t) =  e^{\left(\frac{-b}{2a}t\right)}\sqrt{A^2 + B^2}\left(   \sin ( \omega t + \theta )\right)\, .
\end{equation}

\noindent The phase angle, $\theta$ permits us to see the solution as a $\sin(\omega t)$ type function but out of phase by $\theta$ radians. More precisely, we can write

\begin{equation}
\sin ( \omega t + \theta ) = \sin(\omega\left(t + \frac{\theta}{\omega}\right))\, ,
\end{equation}

\noindent and refer to $\frac{\theta}{\omega}$ as the {\it phase angle}.

Incidentally, this combining of terms permits us also to see the amplitude of $y(t)$ in (\ref{eq:gensolp}) as $\sqrt{A^2 + B^2}$ which  decays in view of the term $e^{\left(\frac{-b}{2a}t\right)}$.



Consider the differential equation~(\ref{eq:temp})

\begin{equation}\label{eq:temp}
1\cdot y''(t) + 6 \cdot y'(t) + 25 \cdot y(t)= 0\, \quad  y(0) = 1\,\,\, {\rm and} \,\,\,\, y'(0) = 0 \,
\end{equation}
\noindent whose solution is

\begin{equation*}
{\rm ysol}(t) =\frac{1}{4} e^{-3 t} (3 \sin (4 t)+4 \cos (4 t))\, .
\end{equation*}

\noindent while the phase shifted form of the solution (\ref{eq:gensolp}) is

\begin{eqnarray}\label{eq:eqsol}\nonumber
{\rm ysol}(t) &=&\frac{5}{4} e^{-3 t} \sin \left(4 t+\tan
   ^{-1}\left(\frac{4}{3}\right)\right)\\ \nonumber
&=& \frac{5}{4} e^{-3 t} \sin \left(4 \left(t+\frac{\tan
   ^{-1}\left(\frac{4}{3}\right)}{4}\right)\right)\\ 
&=& \frac{5}{4} e^{-3 t} \sin \left(4 \left(t+0.231824\right)\right)\,  .
\end{eqnarray}

\noindent In (\ref{eq:eqsol}) we note that $\omega = 4$ and $\theta = \arctan\left(\frac{4}{3}\right) = 0.231824$ radians.

We see in Figure~\ref{fig:4-60-PhasePlusPlot} that the phase angle is depicted by the shift between the two functions.
\begin{figure}[h]
\begin{center}

\includegraphics[width=8.6cm]{4-60-PhasePlusPlot.eps}



\parbox{12.2 true cm}{\caption{\label{fig:4-60-PhasePlusPlot} A plot of the oscillating portion (not damped), $3 \sin (4 t)+4 \cos (4 t)$, of the solution (thin) to a second order differential equation (\ref{eq:gensolp}) with its simple frequency curve $\sin(\omega t)$ (thick). Notice the phase angle here of 0.2318 radians from bottom to bottom illustrating what we mean by out of phase by a phase angle of 0.2318 radians.}}
\end{center}
\end{figure}

\subsection*{Activity 1}

\begin{itemize}
\item [a)] Solve the differential equation (\ref{eq:diffProb}),




\begin{equation}\label{eq:diffProb}
1\cdot  y''(t) + 10\cdot  y'(t) + 29\cdot  y(t) = 0\,, \quad  y(0) = 1\,\,\, {\rm and} \,\,\,\, y'(0) = 0 \, .
\end{equation}
\item [b)] Convert the solution to phase angle format and compute the phase angle $\theta$ in radians.
\item [c)] Plot both solutions in (a) and (b) on the same axis over the interval $[0,2]$ to confirm your analyses.  What should you see?
\end{itemize}


\subsection*{Back to the Circuit}
In our study of phase angle representation in the previous section we saw that the $\sin(w t)$ and  $\cos(w t)$ terms of (\ref{eq:ssSol}) could be combined into one sine term (albeit with a phase angle) with one amplitude. This amplitude, shown in (\ref{eq:amplitude}), we call ${\rm Amplitude}(y_{\rm steady \,\,\, state}(t))$

\begin{equation}\label{eq:amplitude}
{\rm Amplitude}(y_{\rm steady \,\,\, state}(t))=  R \sqrt{\frac{C^2 \omega ^2}{C^2 \omega ^2
   \left(L^2 \omega ^2+R^2\right)-2 C L \omega
   ^2+1}}\, .
\end{equation}

Thus our gain (recall, gain is the ratio of the amplitude of the steady state  output voltage , $V_{\rm out}$, to the amplitude of the input voltage, $V_{\rm in}$) is given by (\ref{eq:gain}).   Here, $V_{\rm in} = 1$ for  ${\rm Emf}(t) = \sin(\omega t)$ and has amplitude 1.



\begin{equation}\label{eq:gain}
{\rm gain} = R \sqrt{\frac{C^2 \omega ^2}{C^2 \omega ^2
   \left(L^2 \omega ^2+R^2\right)-2 C L \omega
   ^2+1}}\, .
\end{equation}

Notice that our gain is a function of $R$, $L$, $C$, and $\omega$. This gain  is a measure of the response of the circuit to input voltage ${\rm Emf}(t)$ in this case ${\rm Emf}(t) = \sin(\omega t)$.

Let us  fix $R$ at 1 ohm and $L$ at 1 henry and see what gain is in this case as a function of $C$ over a range of $\omega$ values. Let us ``tune" this circuit by changing $C$, the size of the capacitance in the circuit and see how gain changes as input voltage frequency, $\omega$, changes.






\begin{figure}[h]
\begin{center}
\includegraphics[width=9.6cm]{4-60-RLCCircuitGain.eps}

%\vspace*{-10.3 true cm}

\parbox{8.5 true cm}{\caption{\label{fig:4-60-RLCCircuitGain} Plot of gain as a function of input frequency, $\omega$, for various values of capacitance, $C = 0.5, 0.05, 0.005, 0.0005$ farads in (\ref{eq:circuit}) with $R$ at 1 ohm and $L$ at 1 henry.}}
\end{center}

\vspace*{-.3 true cm}
\end{figure}

Figure~\ref{fig:4-60-RLCCircuitGain} illustrates  the power of differential equation modeling. For we can alter parameters in our equation and see  the results in a physical (in this case electrical) system. Indeed, we see in this plot that for a capacitance of $C = 0.0005$ farads if we have an input voltage with a frequency around $\omega = 45$  (44.7214 to be precise) then the gain is greatest.  Optimization is a calculus problem and we merely have to take the derivative of gain with respect to $\omega$ and find where it is 0.  All other frequencies give smaller gain for this particular capacitance. In fact, we can say that as we decrease our capacitance the optimal frequency, i.e.  frequency which gives highest gain, decreases and we might want to look into this for a more exact relationship. We shall do that in Activity 2  below. 

Put another way, we see that if our input voltage has a specific frequency, $\omega$, there is a unique capacitance, $C$, for this circuit that will maximize our gain. By changing $C$ we can tune our circuit to maximize gain for a given input frequency, $\omega$. This is, in fact, how we tune a radio, for we change the capacitance of the radio's circuit so as to maximize the gain for the frequency (on our dial) that we wish to hear. So, the next time you try to find the station where   Cousin Brucie is dedicating a Top Ten song from ``Billie Bob" to ``Sally May" know that a differential equation describes exactly what you are doing.  How's that for cool?

\subsection*{Activity 2}

Use your understanding of RLC circuits to show for an imposed ${\rm Emf}(t) = \sin(\omega t)$ on the RLC circuit given by (\ref{eq:circuitMore}) the maximum gain is obtained when $\omega = \frac{1}{\sqrt{LC}}$ and thus we could tune our radio by changing the inductance $L$ as well, If that were as convenient as changing the capacitance, which it is not. So let us stick to tuning by changing the capacitance $C$.


\begin{equation}\label{eq:circuitMore}
L\cdot  y''(t)+R\cdot  y'(t)+\frac{1}{C}\cdot y(t)= {\rm Emf}'(t) = \omega \cos(\omega t)\, , \quad y'(0) = 0 \quad y(0) = 0 
\end{equation}


\subsection*{Activity 3 - Tune the Radio}

The Amplitude Modulated (AM) radio carrier frequencies are in the frequency range 535-1605 kHz.   1 Hz means 1 cycle per second while kHz means 1,000 cycles per second.  The unit Hz is called a {\it hertz}.  Carrier frequencies of 540 to 1600 kHz are assigned at 10 kHz intervals. The (Frequency Modulated (FM) radio band is from 88 to 108 MHz \cite{Hyper2009}. Recall 1 kHz means 1,000 cycles per second. So 660 kHz is oscillation at the rate of 660,000 cycles per second.  We offer up a ``radio'' (\ref{eq:CircuitODE3}) and ask you to tune in several stations by changing the capacitance and computing the optimal gain for these stations. Recall gain is the ratio of the amplitude of the steady state  output voltage , $V_{\rm out}$, to the amplitude of the input voltage, $V_{\rm in}$, i.e. ${\rm gain} = \frac{V_{\rm out}}{V_{\rm in}}$. We measure $V_{\rm out}$ as the amplitude of the steady state voltage  across the resistance $R$ in the circuit, i.e. $V_{\rm out} = R\cdot {\rm Amplitude}(y_{\rm steady \,\,\, state}(t))$. In our case $V_{\rm in}$ is just 1, for ${\rm Emf}(t) = \sin(\omega t)$.

So, we consider our radio circuit (\ref{eq:CircuitODE3}):


\begin{equation}\label{eq:CircuitODE3}
L\cdot \frac{dI^2(t)}{dt^2}  + R\cdot \frac{dI(t)}{dt} + \frac{1}{C}\cdot I(t) = {\rm Emf}'(t)\, .
\end{equation}

We will have to tell the circuit what initial current is present, i.e. $I(0) = 0$ usually until we turn the switch on and also we can presume ther is no change in the current intially, i.e. $I'(t) = 0$.  Let us build this radio with the following values $L = 0.033$ henrys, $R =100$ ohms, and $C$ in farads can vary as needed to tune to various input frequencies $\omega$. We note that if we wish to have, say  540 kHz then $\omega = 540,000\cdot 2 \pi$, and in general to have $x$ kHz we will need $\omega = x\cdot 1000 \cdot 2 \pi$.

\begin{itemize}
\item[a)] Solve the differential equation (\ref{eq:CircuitODE3}) for the radio circuit.
\item [b)] Collect the coefficients $A$ and $B$ of the steady state $\sin(\omega t)$ and $\cos(\omega t)$ terms, respectively. Show that all other terms will dissipate, i.e. go to zero quickly, leaving only $\sin(\omega t)$ and $\cos(\omega t)$ terms.
\item [c)] Using the information above compute the gain as a function of capacitance $C$ and input voltage frequency $\omega$.
\item [d)] For a given input voltage frequency $\omega$ determine the maximum gain for this circuit.
\item [e)] For several AM frequencies, say 540 kHz ($\omega = 540000\cdot 2\cdot\pi$), 880 kHz ($\omega = 880000\cdot 2\cdot\pi$), and 1520 kHz ($\omega = 1520000\cdot 2\cdot\pi$), plot gain as a function of the capacitance $C$ to demonstrate that your maximum gain is what your formula in (c) predicts and that your radio is tuned in.
\end{itemize} 

\teacher{
\section*{NOTES FOR TEACHERS}

In this Modeling Scenario we introduce many concepts:  circuits and accompanying electricity terminology, Kirchhoff's Voltage Law, phase angle, maximum amplitude, gain, tuning, and radio.  When students, especially students in an engineering or physics curriculum, see the power of differential equations to model tuning a radio they are intrigued, some are excited.

The section on phase angle is always useful in a differential equation course for in combining sine and cosine functions one can see ``more'' in an expression, e.g., amplitude and phase angle. Thus it merits our attention. The section on circuits and Kirchhoff's Voltage Law will need faith on the part of the students as quite often students are not sure of themselves in the land of electricity, certainly not as confident as they are in studying mechanical notions which they can see and feel. However, we have always found students grateful when we show them the analogy between electrical and mechanical second order differential equations as offered in Table~\ref{table:Compare}.

We have included much of the analyses for these Activities in a {\it Mathematica\/} notebook, 4-60-T-Mma-CircuitTuner-TeacherVersion.nb with an accompanying pdf version for those who do not read {\it Mathematica\/} files.

}

\begin{thebibliography}{99}

\bibitem{WikiKirchhoff2016}  Kirchhoff's circuit laws. \url{https://en.wikipedia.org/w/index.php?title=Kirchhoff's_circuit_laws\&oldid=737191986}. Accessed 9 September 2016.

\bibitem{Hyper2009} HyperPhysics. 2009. AM and FM Radio Frequencies. \url{http://hyperphysics.phy-astr.gsu.edu/hbase/audio/radio.html} Accessed 18 September 2016.

\end{thebibliography}






\end{document}




