# phase shift in LRC circuit

I need to use a L-R-C tank in my design and I'm having trouble with the calculations. And I think it is because of the phase shift I didn't take into account. Here you can see there is a differential equation introduced to extract the current-wave-charge equation. To my calculations the frequency is correct but I also need to know the phase shift $$\ \theta \$$ as well.

This is supposed to be the voltage wave of my LRC circuit:

ww = 660.764; vc = 30; slip = 0.99; result =
Cos[ww*t]*
vc*(Exp[-t*((0.461 + (ww*slip)*
ww*1715.38/(66564 +
6648.72*(ww*
slip)^2))/(2*(134*10^-5 + (5420 + (ww*
slip)^2*5.385)/(66564 +
6648.72*(ww*slip)^2))))]); Plot[result, {t, 0, Pi/ww}]


However, as you can see, the cosine wave is slightly shifted and it messes with my further calculations. So, what is the equation for the phase shift $$\ \theta \$$ ?

simulate this circuit – Schematic created using CircuitLab

I added the example schematic. In the initial condition, VC is 30V. Then I showed the graph of VC. VC is charged up to 30V in initial state and then slowly dies.

This above graph is taken from circuit lab simulation of the circuit above. This is the correct waveform with no phase shift because the simulator included the phase shift into equation. How can I so?

• Speaking about "phase shift" it is necessary to state which signals you want to compare. Phase shift is always the phase difference between two signals of the same frequency. – LvW Feb 27 '19 at 9:15
• @LvW I meant that instead of ACos[wwt] the wavefowm is seen like Cos[ww*t+$\theta$] and by phase shift I meant this $\theta$ in the formula. – Alper91 Feb 27 '19 at 9:35
• Show the actual circuit used and make it clear where the input is and where the output is. Include all (or any) loads and any impedances in series with the stimulus voltage. – Andy aka Feb 27 '19 at 10:09
• @Andyaka I edited the question and added the schematic. – Alper91 Feb 27 '19 at 11:03
• Where it says “practical” , I wrote “product of” and iPad changed it. But in reality and exponential decay has no zero slope at the start, but the cosine product almost looks like a zero slope in the 1st pixels. I think it is still a misunderstanding and there is no error AFAIK in the result, within the graphical resolution limits. Mine has the Peak +- current and voltage limits on the traces to much higher resolution and so the only error I see is the current polarity . – Tony Stewart Sunnyskyguy EE75 Jun 17 '19 at 3:01

The takeaways you should get from this answer for an underdamped sinusoidal 2nd order response are;

• there was no "error" in the question for the values or slopes or initial conditions or his calculations. It was his expectation that was perplexed.
• The formula with some phase offset almost looked like the response but in fact, there is no initial phase shift.
• It is not a cosine that starts at some lag angle for theta, so it= 0
• It is a product of a decaying exponential $$\e^{-t/\tau}\$$ times a cosine wave so the slope just at t=0 for switch closure IMMEDIATELY starts to decay at some rate, $$\V/τ=dV/dt=Ic/C\$$
• The 2nd plot shows I(L1) which was defined in the opposite direction of I(C1),
• both dV/dt and Ic are negative. (-ve ) just after t=0
• except for above, my simulation is exactly the same as given, only by plot scale & resolution

You should expect capacitor current phase to always lead voltage phase by 90 deg. This is due to the current being the rate of change of voltage property. Your IL(t) reference direction was reversed such that discharging capacitor current was shown positive but should have been negative.

$$I_C=C\cdot dV/dt$$ By convention a negative slope for capacitor voltage decay creates a negative current. So your trace pairs looked like they were (mis) leading phase instead of lagging.

The frequency of the underdamped decay is; $$f=\dfrac{1}{2\pi\sqrt{LC}}$$

However in your formula, since the initial condition for Ic current was 0, thus θ = 0.

Sorry for the pun.

• My Falstad Simulations show the peak levels on the left.
• The oscillating cycle period is just < 10ms as expected.
• OP is asking about phase shift between voltage plot he or she calculated using the formula in the original post and the VOLTAGE PLOT in the simulation result. OP is not asking about phase shift between voltage and current. – mkeith Jun 16 '19 at 20:29
• @mkeith I realize that and addressed the initial conditions for 0 zero is 0 phase offset when switch is closed. Not only his plot agree with his formula by my plot agreed with his plot and his schematic except for his direction of +ve current. So where’s your answer? if I may ask. – Tony Stewart Sunnyskyguy EE75 Jun 16 '19 at 23:40

You have in an unknown way got a solution formula where the unknown angle and the max charge in C are the freely selectable parameters. Physically they can be derived from the circuit current and capacitor's charge at t=0. We call generally them "initial conditions" and both are needed.

Your cryptic program code doesn't at least produce right plot for a case where inductor current is zero at t=0. I must admit I cannot see any connection between the code and the circuits in the question.

If you want symbolic solution formula for a differential equation and take automatically initial conditions into the account as explicit variables, try Laplace transform method. There you must input the initial conditions as symbols as soon as you convert the equation to s-domain.

You have also another circuit which has three inductors. It's not equivalent with your first circuit which has only one. If the 3 inductor version happens to be the right one which presents your practical problem, do not expect any manageably simple formula to exist for VC. It can be easily calculated only numerically as you did with the simulator. You can do the same for ex. in Excel or Mathematica if you present your circuit as a group of state variable equations where the derivatives of the capacitor voltage and inductor currents are expressed as a function of cumulated values. You can step through the evolution of the state variables by integrating numerically.

If you wanted formulas for tuning the actual performance measures, which you haven't revealed at all, you have two possiblities:

1. forget it, search the needed component values with simulations

2. use approximate simplified circuit where R1, R2, L1. L2 and L3 are replaced by one L and one R. Do it after you have with simulations confirmed yourself the result is accurate enough, not before!

• I found his plot is accurate except for polarity of I. – Tony Stewart Sunnyskyguy EE75 Jun 14 '19 at 13:29
• The programmed plot is wrong or the inductors have initial current. – user287001 Jun 14 '19 at 14:27
• Both his and my plot start at 0 A. Pls explain. Mine is shown, his looks like 0. And both peak ~ -14A – Tony Stewart Sunnyskyguy EE75 Jun 14 '19 at 14:30
• I can see it wrongly. But the voltage plot just above text "however as you can see" seems to start non horizontally – user287001 Jun 14 '19 at 15:50
• @SunnyskyguyEE75 the problematic plot has value 30 (unit=unknown) at t=0, drops, reaches 0 at t=2.4 ms . The plot covers time interval 0...5 ms, there's nothing plotted at t=10 ms. – user287001 Jun 14 '19 at 16:50

Your question is in error. You have fixated on the Theta term, but that is not your problem.

You present two circuits. The first is a simple RLC circuit. You present a circuit analysis of that simple circuit which neglects initial conditions (in particular the initital current through the inductor).

THEN, you show a second circuit which is not equivalent to the first, and you are concerned because the simulation result does not match the calculations and your own simulation based on the FIRST circuit which is different.

Because of the circuit differences, you should have no expectation that the simulation you calculated yourself and the actual simulation results should match. Why don't you try simulating a simple RLC circuit and see if your calculated results match the simulation result when you assume the phase at t=0 is 0?