\documentclass[12pt]{article}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\setlength{\textheight}{23cm}
\setlength{\textwidth}{15cm}
\setlength{\topmargin}{-2cm}
\setlength{\oddsidemargin}{0cm}
\raggedbottom

\begin{document}

\begin{center}
\textbf{Physics 120  \smallskip - \smallskip David Kleinfeld \smallskip - \smallskip Spring 2017}
\end{center}

\setcounter{section}{0}
\setcounter{equation}{0}

\section{Notes on time domain circuit analysis}

\subsection{Background}
The most common first-order differential equation in circuit analysis, such as for a RC high-pass or low-pass
filter, has constant coefficients and is of the form
\begin{equation}
\tau \frac{dV(t)}{dt} \; + \; V(t)  \; = \;  F(t).
\end{equation}
The full solution is the solution to the homogeneous equation, denoted $V_H(t)$ plus the solution to the
inhomogeneous solution, denoted $V_I(t)$. The homogeneous equation is the part with $F(t) = 0$, i.e., the equation for the
decay from $V(0)$ for which the homogeneous solution is, to within a constant,
\begin{equation}
V_H (t) \; = \;  V(0^+) \Phi(t)
\end{equation}
with
\begin{equation}
  \Phi(t) = e^{-t/\tau}.
\end{equation}.

The inhomogeneous solution satisfies the full equation
\begin{equation}
\tau \frac{dV_I(t)}{dt} \; + \; V_I(t)  \; =  \; F(t)
\end{equation}
and we take as an ansatz that the inhomogeneous solution is proportion to the homogeneous solution
times a yet to be detemined function of time $\alpha(t)$, i.e., 
\begin{eqnarray}
V_I(t) \;  &=&  \; \Phi(t) \alpha(t) \\
&=& \; e^{-t/\tau} \alpha(t) \nonumber
\end{eqnarray}
and
\begin{equation}
\tau \frac{dV_I(t)}{dt} \; = \; \tau e^{-t/\tau} \frac{d\alpha(t)}{dt} - \tau e^{-t/\tau} \frac{1}{\tau}\alpha(t).
\end{equation}
If we plug these back into the original equation, we get
\begin{equation}
 \tau e^{-t/\tau} \frac{d\alpha(t)}{dt} -  e^{-t/\tau} \alpha(t)+e^{-t/\tau} \alpha(t) = F(t)
 \end{equation}
 or
\begin{equation}
\frac{d\alpha(t)}{dt} \; = \;  \frac{1}{\tau}e^{t/\tau} F(t)
\end{equation}
or
\begin{equation}
\alpha (t) \;  =   \int \limits_{0}^{t} \frac{dt'}{\tau}  e^{t'/\tau} \; F(t') \;+\; \rm{Constant}
\end{equation}
and, substituting back for $\alpha(t)$ gives
\begin{eqnarray}
V_I(t) \;  &=&  e^{-t/\tau} \int \limits_{0}^{t} \frac{dt'}{\tau}  e^{t'/\tau} \; F(t') \;+\; \rm{Constant} \\
&=&  \int \limits_{0}^{t} \frac{dt'}{\tau}  e^{-(t-t')/\tau} \; F(t') \;+\; \rm{Constant} \nonumber.
\end{eqnarray}
Thus
\begin{eqnarray}
V(t) \;  &=&  V_I(t)  \; + \; V_H(t) \\
&=&  \int \limits_{0}^{t} \frac{dt'}{\tau} \;  e^{-(t-t')/\tau} \; F(t') \;+\; V(0^+) e^{-t/\tau} \nonumber
\end{eqnarray}

The integral for the driven response is call the "convolution" integral. The above relation is a
special case, for constant coefficients, between the input and the driven response for a linear system.
In general,  the response of such a linear system to a pulse ("delta function") is given by $\Phi(t)$ and 
\begin{equation}
V_I(t) \; = \;  \int \limits_{0}^{t} \frac{dt'}{\tau} \;  \Phi{(t-t')} \; F(t').
\end{equation}

\subsection{Example of step input}

Here we have a signal that is $F(t) = 0$ for $t<0$ and $F(t) = V_0$ for $t \ge 0$.

\begin{eqnarray}
V(t) \;  &=&  \int \limits_{0}^{t} \frac{dt'}{\tau} \;  e^{-(t-t')/\tau} \; V_0 \;+\; V(0^+) e^{-t/\tau} \\
&=& V_0 \; (1 \; - \;  e^{-t/\tau}) \;+\; V(0^+) e^{-t/\tau} \nonumber
\end{eqnarray}

\subsection{Example of sine input}

Here we have a signal that is $F(t) = 0$ for $t<0$ and $F(t) = V_0 sin (\omega_0 t)$ for $t \ge 0$.
For focus only on the driven part and take $V(0^-) = 0$.

\begin{eqnarray}
V(t) \;  &=&  \int \limits_{0}^{t} \frac{dt'}{\tau} \;  e^{-(t-t')/\tau} \;  V_0 sin (\omega_0 t') \\
&=&  V_0 \; e^{-t/\tau}  \int \limits_{0}^{t} \frac{dt'}{\tau} \;  e^{t'/\tau} \; \frac{e^{i\omega_0 t'} - e^{-i\omega_0 t'}}{2i} \nonumber \\
&=&  V_0 \; \frac{e^{-t/\tau}}{2i}  \int \limits_{0}^{t/\tau} dx \;  e^x \left( e^{i\omega_0 \tau x} - e^{-i\omega_0 \tau x} \right) \nonumber \\
&=&  V_0 \; \frac{e^{-t/\tau}}{2i}  \int \limits_{0}^{t/ \tau} dx \;  \left( e^{(1 + i\omega_0 \tau)x} - e^{(1 - i\omega_0 \tau)x} \right) \nonumber \\
&=&  V_0 \; \frac{e^{-t/\tau}}{2i}  \;  \left( \frac{e^{t/\tau}e^{ i\omega_0 t} -1}{1+i\omega_0 \tau} - \frac{e^{t/\tau}e^{ -i\omega_0 t} -1}{1-i\omega_0 \tau}  \right) \nonumber \\
&=&  V_0 \; \frac{1}{2i}  \;  \left[ \left( \frac{e^{ i\omega_0 t}}{1+i\omega_0 \tau} - \frac{e^{- i\omega_0 t}}{1-i\omega_0 \tau} \right) - e^{-t/\tau} \left( \frac{1}{1+i\omega_0 \tau} - \frac{1}{1-i\omega_0 \tau} \right) \right] \nonumber \\
&=&  V_0 \; \frac{1}{2i}  \;  \left[ \frac{(1-i\omega_0\tau)e^{ i\omega_0 t}   -  (1+i\omega_0\tau)e^{- i\omega_0 t}   + 2 i \omega_0 \tau e^{-t/\tau}}{1+(\omega_0\tau)^2}\right] \nonumber \\
&=&  V_0 \; \frac{1}{1+(\omega_0\tau)^2}  \;  \left[  \frac{e^{i \omega_0t} - e^{i \omega_0t}}{2i}  - \omega_0\tau \frac{e^{i \omega_0t} + e^{i \omega_0t}}{2}  + \omega_0\tau e^{-t/\tau}  \right] \nonumber \\
&=& V_0  \;  \left[  \frac{1}{1+(\omega_0 \tau)^2} \; \rm{sin}(\omega_0 t) -  \frac{\omega_0 \tau}{1+(\omega_0 \tau)^2} \; \rm{cos}(\omega_0 t) +  \frac{\omega_0 \tau}{1+(\omega_0 \tau)^2} \; e^{-t/\tau} \right]  \nonumber
\end{eqnarray}
The sine term represents a faithful transmission of the input and the cosine term represents a phase shifted version, while the exponential represents the transient
from turning the signal on at t=0. With a bit more algebra, and recalling that $\sin(a-b)$ =  $\sin(a) \cos(b)$ - $\cos(a) \sin(b)$, we can simply this.
 \begin{eqnarray}
V(t) \; &=& \frac{ V_0}{\sqrt{1+(\omega_0 \tau)^2}}  \left[  \frac{1}{\sqrt{1+(\omega_0 \tau)^2}} \rm{sin}(\omega_0 t) - \frac{\omega_0 \tau}{\sqrt{1+(\omega_0 \tau)^2}} \rm{cos}(\omega_0 t) + \frac{\omega_0 \tau}{\sqrt{1+(\omega_0 \tau)^2}} e^{-t/\tau} \right]   \nonumber \\
&=& \frac{ V_0 }{\sqrt{1+(\omega_0 \tau)^2}}  \;  \left[ \rm{sin} \Big[\omega_0 t - \rm{atan(\omega_0 \tau} ) \Big] + \frac{\omega_0 \tau}{\sqrt{1+(\omega_0 \tau)^2}} e^{-t/\tau} \right] 
\end{eqnarray}

At short times, i.e., $t << \tau$, 
\begin{equation}
V(t) \;  \approx \; \frac{\omega_0 \tau}{1+(\omega_0 \tau)^2}  \; \frac{t}{\tau}
\end{equation}
and in steady state, i.e., $t >> \tau$, 
\begin{equation}
V(t) \; = \frac{ V_0 }{\sqrt{1+(\omega_0 \tau)^2}}  \;  \rm{sin} \Big[\omega_0 t - \rm{atan(\omega_0 \tau} ) \Big] 
\end{equation}


\end{document}
