# Extracting the equation of oscillation in an LC circuit

Above you see an LC tank combined of two ideal capacitor and one ideal inductance.

And general equations of condansators and inductance are as follows (when SW is closed):

$\frac{d(V_1(t))}{dt}\times C = I(t)$

$\frac{d(V_2(t))}{dt}\times C = -I(t)$

$\frac{d(I(t))}{dt}\times L = V_1(t) - V_2(t)$

Now, think the initial condition as this:

SW open and left side capacitance charged up to $V_1$ which is higher than $V_2$. After capacitance on the left is charged SW is closed and see what happens. Since all the components are ideal and there is no loss I assumed that there will be an oscillation.

$\frac{d^2(I(t))}{(dt)^2}\times L \times C = \frac{d(V_1(t))}{dt} \times C - \frac{d(V_2(t))}{dt} \times C$

$\frac{d^2(I(t))}{(dt)^2}\times L \times C = 2 \times I(t)$

when I solve this differential equation:

$I(t) = C_1 \times e^{-(\frac{\sqrt{2}t}{\sqrt{LC}})} + C_2 \times e^{(\frac{\sqrt{2}t}{\sqrt{LC}})}$

Now, I can think that $V_1, V_2, I$ relation will be something like this when SW is closed:

It is reasonable because when derivatives of $V_1(t)$ and $V_2(t)$ is zero (at local maxima and minima) $I(t)$ is zero and when they are highest $I(t)$ also highest. So I think it is reasonable to assume that at at t = 0, $I(t) = 0$ since I assumed that in initial state $V_1(t)$ was pulled the highest voltage and $V_2(t)$ was pulled down to lowest voltage level (local minima and maximas)

Lastly, I can also assume that since $I(t)$ starts as a sine wave, derivative of $I(t)$ is 1 at t = 0;

$\frac{dsin(t)}{dt} = cos(t)$ , $cos(0) = 1$

$\frac{dI(t)}{dt} = 1$

When to finalize it I solve the equation with initial conditions but this is what I get:

$I(t) = \frac{ \sqrt{LC} \times ( e^{ \frac{ 2 \sqrt{2} t}{ \sqrt{CL} } } - 1) }{2 \sqrt{2} e^{ \frac{ 2 \sqrt{2} t}{ \sqrt{CL} } } }$

But this function does not oscillate. It is something like this:

So could you please tell me where am I doing wrong and what is the correct equation?

You have an error with your signs in these equations.

$\frac{d(V_1(t))}{dt}\times C = I(t)$

$\frac{d(V_2(t))}{dt}\times C = -I(t)$

It is also not clear which sign convention you are using.

Given the direction of the current $I(t)$ as shown in your diagram

$\frac{d(0-V_1(t))}{dt}C = I(t)$

$\frac{d(V_2(t)-0)}{dt}C = I(t)$

where I have assumed that the current flows due to a potential difference across the component in a direction from higher potential to lower potential.

In terms of the equation $\frac{d(0-V_1(t))}{dt}C = I(t)$, initially the voltage across the left hand capacitor will be dropping so $\frac{dV_1(t)}{dt}$ will be negative and $-\frac{dV_1(t)}{dt}=I$ will be positive as you would expect?

$\frac{d^2I}{dt^2}= -\frac{2}{LC}I$
$I(t) = A_1 e^{-j(\frac{\sqrt{2}t}{\sqrt{LC}})} + A_2 e^{j(\frac{\sqrt{2}t}{\sqrt{LC}})}$ or $I(t) = B_1 \sin (\frac{\sqrt{2}t}{\sqrt{LC}}) + B_2 \cos(\frac{\sqrt{2}t}{\sqrt{LC}})$