# Problem with setting initial voltages in LT Spice

I was trying to set an initial voltage for a capacitor I was modeling in LT Spice, and I tried using the command .ic V(Vc)=20000 (Vc is the node directly after the capacitor, with ground on the other side), but the result it gave me was like this: Circuit schematic: There is a AC square wave source, but this is the part being measured. I figured that it would be more of a consistent curve, but it looks like it just immediately jumps and then discharges as I think it should. Is there another way to give a capacitor an initial voltage?

• Can you share your schematic? Without it, there's no way for us to know what's going on. Sep 10, 2018 at 15:57
• Try to set -20000
– G36
Sep 10, 2018 at 16:21
• Any difference if you add a say 100 Mohm resistor to ground? Sep 10, 2018 at 16:59

If you look closely, there is an initial spike of whatever you imposed it to be, but then the voltage discharges quickly through D21-D23-D20-...-D1 to ground. The circuit is behaving normally, I'd say. BTW, you named the same node twice: Vout and Vc. In this case, LTspice will consider the last placed name.
Else, for any circuit involving initial conditions, you can try adding .tran 10m uic to complement the .ic card. Or delete the .ic card and set ic=... next to C1's value, like this: 2n ic=20k (btw, those F do nothing, unless they are the first letter, when it means femto -- avoid units). This should work without uic, too.