# Charging a capacitor. Calculations and PSpice simulation don't match

I started using PSpice only yesterday and I have a problem with a really simple circuit.

Vs = 2 V

R1 = 1 kΩ

C1 = 50 nF

The switch closes at t = 0 (it's not really needed). After running a Time Domain analysis and tracing the voltage across the capacitor, I saw that it takes around ~250ms to raise the Vc to Vs. This seemed like too much time, so I decided to double check in MatLab by graphing a function of voltage across a charging capacitor:

$\ Vc(t) = Vs \cdot (1- e^{-{{t}\over{RC}}})$

where

$RC = 1kΩ \cdot 50 nF = 0.00005s$

$Vs = 2 V$

I can't post the screenshot of the result, because I don't have enough reputation for another link. But it's easy to check that the Vc reaches 2 V shortly after t = 0.25ms.

Why do I get different results for the same circuit in PSpice?

• Hmm, something somewhere is out by a factor of 1000 in your simulation. It should indeed reach $V_s$ at around $5\tau = 5RC = 250\mu s$. I would try redoing the simulation to make sure there is nothing cached and that it is actually simulating the circuit you are intending it to simulate. – Tom Carpenter Oct 9 '16 at 17:56
• What is the on and off resistance of the switch? Are you sure it actually closed? – Mario Oct 9 '16 at 18:01
• @Mario Yes, it was probably because of the switch. I removed it altogether and now everything seems right. Thanks. – Maxim Mikhaylov Oct 9 '16 at 18:04