This project is based on a project by Brian Winkel. https://www.simiode.org/resources/518

Electrical circuit analysis is an application of differential equations. We'll study circuits with resistors, capacitors, inductors, and voltage and current sources.

Introductory Notions for Circuit Study

Consider a typical one-loop RLC circuit:

OneLoop.png

$R$ is resistance in ohms, $L$ is inductance in henrys, and $C$ is capacitance in farads, or more usually microfarads. There is an electromotive force, $E(t) = E_0\sin(\omega t)$, in volts driving the circuit. This voltage produces an alternating current, $I(t)$, in amperes at time $t$, in the circuit as a measure of the flow of electrons in the particular branch of the circuit.

Kirchhoff's Voltage Law says that in the circuit at all times $t$ the voltage source, $E(t) = E_0\sin(\omega t)$, equals the sum of the three voltage drops -- over $R$, $L$, and $C$, i.e. $E = E_R + E_L + E_C$. The voltage drop over each of the devices, resistor $R$, inductor $L$, and capacitor $C$ is given by the following formulae, respectively:

  • $E_R = R I$,
  • $E_L = L I'$, and
  • $E_C = \frac{1}{C}\int I(t)\, dt$.

Consider the following differential equation in $I(t)$, the current in the one loop circuit of this circuit. We use Kirchhoff's Voltage Law. Sum the voltages across the resistor, the inductor, and the capacitor and set this sum equal to the voltage from our source or driver, $E(t)$:

\begin{equation}\label{eq:initial} L I'(t) + R I(t) + \frac{1}{C}\int I(t)\, dt = E_0\sin(\omega t) \,\, . \end{equation}

Convert this into a second order differential equation in $I(t)$ by differentiating both sides with respect to $t$:

\begin{equation}\label{eq:convert} L I''(t) + R I'(t) + \frac{1}{C}I(t) = E_0\omega \cos(\omega t) \,\, . \end{equation}

Note that prior to the voltage source being applied there is nothing happening in the circuit, i.e.~there is no voltage or force to move the electrons in the circuit. Hence, the reasonable initial conditions are $I(0) = 0$ and $I'(0) = 0$.

Another example.

We'll modify the notation from above just a little. We'll follow the convention of using lower case letters for functions in the time domain, and when we get there upper case letters for the frequency domain. We'll study circuits with resistors, capacitors, inductors, and voltage and current sources. We have the following voltage drops and current through the three types of elements:

  • Resistors resistor.png

$v(t)=R\cdot i(t)$ ($R$ is the resistance in ohms)

  • Capacitors capacitor.png

$v(t)=\frac{1}{C}\int i(t)\ dt +v(0)$ which means $i(t)=C\frac{dv}{dt}$ ($C$ is the capacitance in farads)

  • Inductors inductor.png

$v(t)=L \frac{di(t)}{dt}$ which means $i(t)=\frac{1}{L}\int v(t)\ dt + i(0)$ ($L$ is the inductance in henrys)

In general, we'll assume any initial conditions are zero, hence the two integrals above simplify in this case.

Consider the following circuit, taken from Circuits, Signals, and Systems by William McC. Siebert.

003circuit.png

The goal is to write differential equations for the state variables $v_C(t)$ and $i_L(t)$ in terms of the sources $v_0(t)$ and $i_0(t)$.

The way I think about Kirchhoff's Laws are:

  • KVL: the sum of the voltage drops around any loop is zero. If you are moving in the direction of the current the voltage drop is positive, if you are moving against the current the voltage drop is negative.
  • KCL: the sum of currents into a node is zero. In is counted as positive, out is counted as negative.

First, I labeled the direction of the currents. The current of the source, $i_0$ is given, but the others I labeled. I may have chosen incorrectly, but this will take care of itself: I'll discover a negative current if I labeled going the wrong way.

We'll start with $v_C(t)$, and look at the node on the left. We have:

$$i_v-i_C-i_1=0,$$

or $$i_C=i_v-i_1.$$

But, we know the current through the capacitor is $i_C=C\frac{dv_c}{dt}$:

$$C\frac{dv_c}{dt}=i_v-i_1.$$

From the nodes labeled $v_2$ and $v_1$ we have, respectively: $i_v=i_L+i_2$ and $i_1=i_L-i_0$. Substitute:

\begin{align*} C\frac{dv_c}{dt}&=i_L+i_2-(i_L-i_0)\\ &=i_2+i_0\\ &=\frac{v_2}{R_2} +i_0\\ \end{align*}

Finally, use KVL around the outside loop: $v_0+v_C+v_2=0$. (Notice this means I've labeled one of my currents going the "wrong" way but that will work itself out.) So, $v_2=-v_0-v_C$ and we have:

$$C\frac{dv_c}{dt}=-\frac{v_0}{R_2}-\frac{v_c}{R_2}+i_0$$

which is the desired differential equation in $v_c(t)$.

Next, we'll find a differential equation in $i_L(t)$ in terms of $v_0(t)$ and $i_0(t)$. Start with KVL around the top loop:

$$v_0+i_1R_1+L\frac{di_L}{dt}=0,$$

so $$L\frac{di_L}{dt}=-v_0-i_1R_1.$$ From the node labeled $v_1$ we have $i_1+i_0=i_L,$ or $i_1=i_L-i_0$ which we substitute: \begin{align*} L\frac{di_L}{dt}&=-v_0-i_1R_1\\ L\frac{di_L}{dt}&=-v_0-(i_L-i_0)R_1\\ L\frac{di_L}{dt}&=-v_0-i_LR_1+i_0R_1\\ \end{align*} which is the desired differential equation.

Exercise 1

Write a differential equation for the state variable $v_C$ in terms of $i$, $R$, and $C$.

circuitexercise1.png

Find the transfer function. Find $V_C(s)$ for $v(t)=sin(\omega t)$, $v(t)=e^{-t}cos(\omega t)$, $v(t)=h(t-3)$. Assume initial conditions are zero.

Exercise 2

Write a differential equation for the state variable $v_C$ in terms of $v$, $R$, and $C$.

circuitexercise2.png

Find the transfer function. Find $V_C(s)$ for $v(t)=sin(\omega t)$, $v(t)=e^{-t}cos(\omega t)$, $v(t)=h(t-3)$. Assume initial conditions are zero.

Exercise 3

Write a differential equation for the state variable $i$ (that is the current through the inductor) in terms of $v$, $R$, and $L$.

circuitexercise3.png

Find the transfer function. Find $I_L(s)$ for $v(t)=sin(\omega t)$, $v(t)=e^{-t}cos(\omega t)$, $v(t)=h(t-3)$. Assume initial conditions are zero.

References:

Foundations of Analog and Digital Electronic Circuis by Agarwal and Lang

Circuits, Signals, and Systems by William McC. Siebert

In [ ]: