# Charge of a circuit, 2nd order ODE with initial conditions.

I'm currently going over some ODEs, some help would be appreciated, a past exam says the following:

An electrical circuit consists of a capacitor, $C$, an inductance, $L$, an ammeter with resistance $R$, and an open switch, all connected in series.The capacitor initially carries a charge $Q_0$. At time $t = 0$ , the switch is closed and it is observed that current starts to flow and that, initially, the current is given by $I_0 = -\frac{5R}{L}$. The charge carried by the capacitor is described by the differential equation $$L\frac{dI}{dt} + RI + \frac{Q}{C} = 0$$ As $I = \frac{dQ}{dt}$, we can write the above equation as $$L \frac{d^2 Q}{dt^2} + R\frac{dQ}{dt} + \frac{Q}{C} = 0$$ We are asked to prove that $Q(t) = Q_0e^{-\frac{Rt}{2L}}\cos(\omega t + \phi)$ is a solution, which I did. $$\omega = \sqrt{\frac{1}{C} - \frac{R^2}{4L^2}}$$

My question is: How do you solve for $Q_0$ and $\phi$?

EDIT: The question says to find the above values, surely that would mean values of R, L and C are needed? So would it just mean find the functions?

EDIT 2: Here's the question in its entirety.

• $Q_{0}$ is constant initial charge of capacitor you needn't solve for it – Faraday Pathak Mar 16 '18 at 0:07
• @veereshpandey the paper asks you to calculate the values of $Q_0$ and $\phi$ , I understood what $Q_0$ is, just not how to calculate it. – Callum Mar 16 '18 at 1:19

Differentiating the general solution

\begin{align} Q(t) &= e^{-\frac{Rt}{2L}}(A\cos \omega t+B\sin \omega t) \\ Q'(t) &= e^{-\frac{Rt}{2L}} \left[ \left( \omega B-\frac{AR}{2L} \right) \cos \omega t- \left( \omega A+\frac{BR}{2L} \right) \sin \omega t \right] \end{align}

Equating the boundary conditions \left \{ \begin{align} Q(0) &= Q_0 \\ Q'(0) &= I_0 \end{align} \right.

Put $t=0$,

\left \{ \begin{align} Q_0 &= A \\ I_0 &= \omega B-\frac{AR}{2L} \end{align} \right.

On solving,

\left \{ \begin{align} A &= Q_0 \\ B &= \frac{I_0}{\omega}+\frac{Q_0 R}{2L\omega} \end{align} \right.

Therefore,

\begin{align} Q(t) &= e^{-\frac{Rt}{2L}} \left[ Q_0 \cos \omega t+ \left( \frac{I_0}{\omega}+\frac{Q_0 R}{2L\omega} \right) \sin \omega t \right] \\ Q_{\text{envelope}} &= e^{-\frac{Rt}{2L}} \sqrt{Q_0^2+ \left( \frac{I_0}{\omega}+\frac{Q_0 R}{2L\omega} \right)^2} \\ \tan \phi &= -\frac{1}{\omega} \left( \frac{I_0}{Q_0}+\frac{R}{2L} \right) \end{align}

• Can you walk me through the steps of what you did? I assume you've done the complementary equation to get the first line, then differentiated and substituted to get the next few. There I get lost. – Callum Mar 16 '18 at 1:27
• The first line is the general solution for $Q(t)$, differentiating gives the current $Q'(t)$, put $t=0$ to equate initial conditions. – Ng Chung Tak Mar 16 '18 at 13:06

there is something wrong in the question

$I_{0}\neq-5\dfrac{R}{L}$

because LHS has S.I. unit in $Amperes$. whereas R.H.S has S.I. unit in $(seconds)^-1$

so, this information is dimensionally incorrect .they can never be equal

• Are you sure? R would be in $\Omega$ and L in $H$ I believe. What they are in Base SI should be equal to $I$. Surely a university wouldn't have such an error in the question. – Callum Mar 16 '18 at 10:42
• @Callum: S.I. unit of $\dfrac{L}{R}$ i.e,time constant of LR circuit, is $seconds$ so it's reciprocal $\dfrac{R}{L}$ must have S.I . unit as $seconds^{-1}$ – Faraday Pathak Mar 16 '18 at 16:47

a) there is a typo in your expression for $\omega$: it shall be $$\omega = \sqrt {{1 \over {LC}} - {{R^{\,2} } \over {4L^{\,2} }}} = \sqrt {{1 \over {LC}}} \;\,\sqrt {1 - {{\left( {R/\left( {2L} \right)} \right)^{\,2} } \over {LC}}}$$

b) you shall write the general solution as $$Q(t) = Ae^{\, - \,{R \over {2L}}\,t} \cos \left( {\omega t + \varphi } \right)$$ which then gives $$I(t) = - \,{R \over {2L}}Ae^{\, - \,{R \over {2L}}\,t} \cos \left( {\omega t + \varphi } \right) - \omega Ae^{\, - \,{R \over {2L}}\,t} \sin \left( {\omega t + \varphi } \right)$$

c) you shall then impose the initial conditions $$\left\{ \matrix{ Q(0) = Q_{\,0} = A\cos \varphi \hfill \cr I(0) = I_{\,0} = - \,{R \over {2L}}A\cos \varphi - \omega A\sin \varphi \hfill \cr} \right.$$ to get $$\left\{ \matrix{ \tan \varphi = - {1 \over \omega }\left( {I_{\,0} /Q_{\,0} + {R \over {2L}}} \right) \hfill \cr A = Q_{\,0} /\cos \varphi \hfill \cr} \right.$$

d) dimensionally wise $I_0$ cannot be $-5R/L$ (which has the dimension of 1/time), as already rightly pointed out by v. pandey, it might be probably $I_0/Q_0=-5R/L$.

e) also, it is physically impossible, in a series RLC circuit, that immediately upon closing the switch you can have a non-null current: the L will impede that to occur; you will have instead a current that starts from zero with a derivative $V_0/L=Q_0/(LC)$ (apart the sign).

• How does $Q(0) = Q_0$ imply $\phi = 0$? – Callum Mar 16 '18 at 1:33
• @callum: you are right: there was some confusion around, I recasted my answer to try and put the picture in focus – G Cab Mar 16 '18 at 11:52