[Math] Differential Equation Setup for an RLC Circuit

ordinary differential equations

I'm getting confused on how to setup the following differential equation problem:

You have a series circuit with a capacitor of $0.25*10^{-6}$ F, a resistor of $5*10^{3}$ ohms, and an inductor of 1H.

A 12 volt battery is connected and is closed at $t=0$. I need to find the equation for the charge of the capacitor at time $t$.

Based on the information given in the book I am using, I would think to setup the equation as follows:

$LQ''+RQ'+\frac1cQ=E(t)$

$L$, the inductance, would be $1$

$R$ is resistance and is $5*10^3$

Finally, capitance is $C=0.25*10^{-6}$

$Q(t)$ would represent the charge of the capacitor at time $t$, which is the solution to my problem.

The issue I am having is with the 12 volt battery that is connected. Normally, I would think to set $E(t)$ to 0 because $E(t)$ is the impressed voltage, but obviously with the battery, the impressed voltage would be 12 volts and not 0.

I'm guessing that my equation for $E(t)$ is wrong (and should be a function of time), but could someone point me in the right direction to complete the setup of the problem?

Best Answer

Using KVL, we would have ($V_S$ is your $E(t)$ = Voltage Source = constant DC $12 V$ source):

$$\tag 1 V_R + V_L + V_C = V_S \Rightarrow iR + L\frac{di}{dt} + \frac{1}{C}\int idt = V_S$$

Differentiating $(1)$ wrt $t$, we get:

$$R \frac{di}{dt} + L\frac{d^{2}i}{dt^2} + \frac{1}{C} i = 0$$

That is:

$$\frac{d^{2}i}{dt^2} + \frac{R}{L} \frac{di}{dt} + \frac{1}{LC} i = 0$$

This a 2nd-order ODE with constant coefficients.

You would of course solve the homogeneous and non-homogeneous case.

Maybe these notes will also be helpful.

Make sense?