Appendix B

Solves the differential equation for a RC low-pass filter. Gives the homogeneous and particular solutions. This supplements the article RC Low-pass filter.

Appendix B

For old times sake, we show the traditional method to solve the differential equation for the passive filters consisting of a resistor and capacitor in series.

The output is the voltage over the capacitor $$y(t)$$ as shown in the schematic below.

Assume a switch between the input and the resistor that closes at $$t=t_1$$. Further assume $$y(t\leq t_1)=Y_0$$.

According to Kirchhoff’s Voltage Law, for $$t\geq t_1$$

\begin{align} u(t)&=u_R(t)+u_C(t)\nonumber\\[6mu] &=i(t)\,R+y(t)\quad\Rightarrow\nonumber\\[6mu] R\,i(t)+y(t)&=u(t)\label{eq:bUt} \end{align}

The relations between voltage and current for the resistor and capacitor are

\begin{align} u_R(t)&=R\,i(t)&\text{resistor}\label{eq:bUr}\\[6mu] i(t)&=C\frac{\mathrm{d}y(t) }{\mathrm{d}t}&\text{capacitor}\label{eq:bIt} \end{align}

Two differential equations follow from substituting $$\eqref{eq:bIt}$$ and $$\eqref{eq:bUr}$$ in $$\eqref{eq:bUt}$$ or its derivative

\begin{align} R\,i(t)+y(t)&=u(t)\nonumber\\[6mu] R\,C\frac{\text{d}y(t)}{\text{d}t}+y(t)&=u(t)\label{eq:bDV1}\\[20mu] \frac{\text{d}i(t)}{\text{d}t}\,R+\frac{i(t)}{C}&=\frac{\text{d}u(t)}{\text{d}t}\nonumber\\[10mu] RC\frac{\text{d}i(t)}{\text{d}t}+i(t)&=C\frac{\text{d}u(t)}{\text{d}t}\label{eq:bDV2} \end{align}

If $$u(t)$$ is continuous, we can choose either differential equation, but when $$u(t)$$ is non-continuous we can’t use $$\eqref{eq:bDV2}$$.

Assume the non-homogeneous linear differential equation of a first order High-pass LC-filter, where $$u(t)=\hat{u}\cos(\omega t)$$ is the forcing function and the current $$i(t)$$ through the inductor is the response. The differential equation for this system is

$$RC\,{y_p}^\prime(t)+\,y_p(t)=\hat{u}\cos(\omega t)\label{eq:bTrigRC_DV}$$

The solution is a superposition of the natural response and a forced response. The so called, homogeneous solution $$y_h(t)$$ and the particular solution $$y_p(t)$$

$$y(t)=y_h(t)+y_p(t)\label{eq:bTrigRC_hp}$$

Homogeneous solution

The homogeneous solutions follows from the reduced (=homogeneous) linear differential equation where the forcing function is zero.

$$RC\,{y_p}^\prime(t)+\,y_p(t)=0\label{eq:bTrigRC_homDV}$$

According the Euler, the homogeneous solutions are in the form $$y_h(t)=\mathrm{e}^{pt}\label{eq:bTrigRC_gen}$$

substituting this $$y_h(t)$$ in $$\eqref{eq:bTrigRC_homDV}$$ gives the characteristic equation with root $$p$$

\begin{align} RC\,(\mathrm{e}^{pt})^\prime+\,\mathrm{e}^{pt}&=0\nonumber\\ \Rightarrow\quad RC\,p\mathrm{e}^{pt}+\mathrm{e}^{pt}&=0&\div{\mathrm{e}^{pt}}\nonumber\\ \Rightarrow\quad RC\,p+1&=0\nonumber\\ p&=-\frac{1}{RC}\label{eq:bTrigRC_p} \end{align}

The solution base $$y_{h,1}(t)$$ follows from substituting the root $$p$$ from equation $$\eqref{eq:bTrigRC_p}$$ in back in the homogeneous differential equation $$\eqref{eq:bTrigRC_gen}$$

$$y_{h1}(t)=\mathrm{e}^{-\frac{t}{RC}t}$$

The homogeneous solution follows as a linear combination of the solution bases (only one in this case) as

$$\shaded{ y_h(t)=c\,y_{h1}(t)=c\,\mathrm{e}^{-\frac{t}{RC}} \label{eq:bTrigRC_hSolution} }$$
where the constant $$c$$ follows from the initial conditions.

Particular solution

We will show how to get the particular solution using both trigonometry and complex arithmetic.

Using the trigonometry method

If we force a signal $$\hat{u}\cos(\omega t)$$ on a linear system, the output will have the same frequency but with a different phase $$\phi$$ and amplitude $$A$$.

\begin{align} y_p(t)&=A\cos(\omega t+\phi)\label{eq:bTrigRC_form}\\ \Rightarrow\quad y^\prime_p(t)&=-A\,\omega\sin(\omega t+\phi)\label{eq:bTrigRC_formDer} \end{align}

Substituting $$(\eqref{eq:bTrigRC_form},\eqref{eq:bTrigRC_formDer})$$ in the differential equation $$\eqref{eq:bTrigRC_DV}$$

\begin{align} -ARC\,\omega\sin(\omega t+\phi)+A\cos(\omega t+\phi)&=\hat{u}\cos(\omega t)\nonumber\\ \Rightarrow\quad \color{green}{1}\cos(\omega t+\phi)-\color{green}{\omega RC}\,\sin(\omega t+\phi)&=\frac{\hat{u}\cos(\omega t)}{A}\label{eq:bTrigRC_part}\\ \end{align}

Work towards the trigonometric identity

\begin{align} \gamma\cos(\alpha+\beta)=\gamma\cos\alpha\cos\beta-\gamma\sin\alpha\sin\beta\nonumber \end{align} \nonumber

by assigning the two independent variables $$R$$ and $$\omega L$$ to two more convenient independent variables $$\gamma\cos\alpha$$ and $$\gamma\sin\alpha$$

\begin{align} \gamma\cos\alpha&\triangleq 1\label{eq:bTrigRC_CcosAlpha}\\ \gamma\sin\alpha&\triangleq\omega RC\label{eq:bTrigRC_CsinAlpha}\\ \end{align}

to dot the ‘i’, introduce $$\beta$$

$$\beta\triangleq\omega t+\phi\label{eq:bTrigRC_beta}$$

we can rewrite $$\eqref{eq:bTrigRC_part}$$ and use the aforementioned trigonometric identity

\begin{align} \gamma\cos\alpha\cos\beta- \gamma\sin\alpha\sin\beta&=\frac{\hat{u}\cos(\omega t)}{A}\nonumber\\ \gamma\cos(\alpha+\beta)&=\frac{\hat{u}\cos(\omega t)}{A}\label{eq:bTrigRC_alpabetaC}\\ \end{align}

Divide $$\eqref{eq:bTrigRC_CsinAlpha}$$ by $$\eqref{eq:bTrigRC_CcosAlpha}$$ to solve for $$\alpha$$, and apply the geometric identity $$\sin^2\alpha+\cos^2\alpha=1$$ to $$\eqref{eq:bTrigRC_CsinAlpha}$$ by $$\eqref{eq:bTrigRC_CcosAlpha}$$ to solve for $$C$$

\begin{align} \frac{\cancel{\gamma}\sin\alpha}{\cancel{\gamma}\cos\alpha}=\frac{\omega RC}{1} \quad\Rightarrow\quad \alpha&=\arctan\left(\omega RC\right)\label{eq:bTrigRC_alpha} \\ \left(\frac{\omega RC}{\gamma}\right)^2+\left(\frac{1}{\gamma}\right)^2=1 \quad\Rightarrow\quad \gamma&=\sqrt{1+(\omega RC)^2}\label{eq:bTrigRC_C} \end{align}

Substituting $$\eqref{eq:bTrigRC_beta}, \eqref{eq:bTrigRC_alpha},\eqref{eq:bTrigRC_C}$$ in equation $$\eqref{eq:bTrigRC_alpabetaC}$$

$${\sqrt{1^2+(\omega RC)^2}}\, \cos{\large(}{\arctan\left(\omega RC\right)+\beta}\,{\large)} = {\frac{\hat{u}}{A}}\cos({teal}{\omega t})$$

and combine like terms

\begin{align} A &= \frac{\hat{u}}{\sqrt{1+(\omega RC)^2}} \label{eq:bTrigRC_A} \\ \arctan\left(\omega RC\right)+\cancel{\omega t}+\phi=\cancel{\omega t} \quad\Rightarrow\quad \phi &= -\arctan\left(\frac{\omega L}{R}\right) \label{eq:bTrigRC_Phi} \end{align}

The particular solution follows from substituting $$(\eqref{eq:bTrigRC_A}, \eqref{eq:bTrigRC_Phi})$$ in $$\eqref{eq:bTrigRC_form}$$

\shaded{\begin{align} y_p(t)&=A\cos(\omega t+\phi)\label{eq:bTrigRC_pSolution}\\ \text{where}\quad A&=\frac{\hat{u}}{\sqrt{1+(\omega RC)^2}}\nonumber\\ \text{and}\quad\phi&=-\arctan\left(\omega RC\right)\nonumber \end{align} }

Using the complex arithmetic method

Using a complex forcing function $$\underline{u}(t)$$ provides a less involved method of finding the particular solution as introduced in Linear Differential Equations. Using a complex forcing function

$$\underline{u}(t)=\hat{u}\,\mathrm{e}^{j\omega t}$$

the corresponding complex response is of the form

\begin{align} \underline{y}_p(t)&=A\,\mathrm{e}^{j(\omega t+\phi)}\label{eq:bCaRC_yp}\\ \Rightarrow\quad {\underline{y}_p}^\prime(t)&=j\omega\,A\,\mathrm{e}^{j(\omega t+\phi)}\label{eq:bCaRC_ypDer}\\ \end{align}

Substituting $$\underline{y}_p(t)$$ and $${\underline{y}_p}^\prime(t)$$ in the differential equation $$\eqref{eq:bTrigRC_DV}$$

\begin{align} RC\,j\omega\,A\,\mathrm{e}^{j(\omega t+\phi)}+\,A\,\mathrm{e}^{j(\omega t+\phi)}&=\hat{u}\mathrm{e}^{j\omega t},&\div\mathrm{e}^{j\omega t}\nonumber\\ \Rightarrow\quad j\omega RC\,A\,\mathrm{e}^{j\phi} +A\,\mathrm{e}^{j\phi}&=\hat{u}\nonumber\\ \Rightarrow\quad A\,\mathrm{e}^{j\phi}(j\omega RC+1)&=\hat{u}\nonumber\\ \Rightarrow\quad A\,\mathrm{e}^{j\phi}&=\frac{\hat{u}}{j\omega RC+1} \end{align}

The amplitude $$A$$ and phase $$\phi$$ of the complex response follow as

\begin{align} A&=\left|\frac{\hat{u}}{j\omega RC+1}\right|\\ \phi&=\angle\hat{u}-\angle(j\omega RC+1) =0-\mathrm{atan2}\left(\omega RC,1 \right) =-\arctan\left(\omega RC\right) \end{align}

Now that $$A$$ and $$\phi$$ are known, the complex particular response follows as equation $$\eqref{eq:bCaRC_yp}$$

$$\underline{y}_p(t)=A\,\mathrm{e}^{j(\omega t+\phi)}=A\cos(\omega t)+jA\sin(\omega t) \label{eq:bRLSol}$$

Since the forcing function was only the real part of $$\underline{u}(t)$$, are only interested in the real part of the complex particular solution $$\eqref{eq:bRLSol}$$ as well

\shaded{ \begin{align} y_p(t)&=\Re\left\{\underline{y}_{\,p}\right\}=A\,\cos(\omega t+\phi),\label{eq:bCaRC_pSolution}\\[6mu] \text{where}\quad A&=\frac{\hat{u}}{\sqrt{1+(\omega RC)^2}},\nonumber\\ \text{and}\quad\phi&=-\arctan\left(\omega RC\right)\nonumber \end{align} }

General solution

The general solution follows from substituting $$\eqref{eq:bTrigRC_hSolution}$$ and $$\eqref{eq:bTrigRC_pSolution}\text{ or }\eqref{eq:bCaRC_pSolution}$$ in equation $$\eqref{eq:bTrigRC_hp}$$.

\shaded{ \begin{align} y(t)&=c\,\mathrm{e}^{-\frac{t}{RC}}+A\cos(\omega t+\phi)\nonumber\\ \text{where}\quad A&=\frac{\hat{u}}{\sqrt{1+(\omega RC)^2}}\nonumber\\ \text{and}\quad\phi&=-\arctan\left(\omega RC\right)\nonumber \end{align} }\label{eq:bTrigRC_solution}