# My calculation for an RC circuit are not agreeing with the LTSpice simulation

I am doing calculations for an RC circuit to create a first order low pass filter. The input is a 5V peak periodic square wave with a 10kHz frequency. The resistor is 220 Ohms and the Capacitor is 100nF.

When I calculate it I get an output of 4.95V however on the simulation I only get 3.96V. What am I doing wrong?

• Use step inputs when finding time constants, not square waves – Voltage Spike Aug 1 '19 at 17:55

## 1 Answer

The period of your square wave is 100 us, but its duty cycle is 50%, so the input is at +5 V for only 50 us, not 100, before switching again.

This means it's only at +5 V for about 2.3 time constants rather than 4.6, and it's not able to come as close to fully charging the capacitor as it would have if kept at that voltage longer.

As another answer points out, you've also assumed a 5 V voltage step, while your simulation applies a 10 V step.

There's also a small effect because the simulator assumes the voltage source was at -5 V for a "very long time" before the simulation started, so there is a transient effect at the beginning of the simulation. You can see the 2nd peak in your output reaches a slightly higher voltage than the first one. You should let the simulation run for several (10?) cycles before measuring the peak voltage if you want a result close to the steady state behavior.

• So the simulation is wrong because of the assumption of the 5V voltage step, right? Can you please show me how to change this to 10V step? – Jared Aug 1 '19 at 18:03
• The simulation has a 10 V step. Your hand calculation assumed a 5 V step. Do you want to change the simulation to match the hand calculation or vice versa? – The Photon Aug 1 '19 at 18:15
• I want to change the hand calculation please. – Jared Aug 1 '19 at 18:19
• To match what you simulated, the formula (for the first half cycle) should be $v(t) = -5 + 10[1-\exp(-t/\tau)]$, and $t$ should be 50 us, not 100 us. – The Photon Aug 1 '19 at 18:20
• If you don't mind, could you please also show me the other way around(To match my calculated results). Thank you so much for all the help – Jared Aug 1 '19 at 18:57