Electrical – Why Doesn’t SPICE Show the Discharging of a Capacitor after Input Voltage is Removed

capacitorltspicespice

I have a very simple circuit that includes a capacitor meant to provide a few seconds of battery-like backup to a few LEDs when power is removed. In real life, it does exactly that. However, when I simulate it in LTSPICE it seems that after the input voltage is removed the capacitor doesn't "pick up" to power the circuit. Being rather new to LTSPICE, is there something about how to simulate it that I'm missing?

enter image description here

Best Answer

You might think that setting your PWL to zero makes it open circuit. It doesn't. It's generating a low impedance zero, that discharges the capacitor.

If you want to simulate removing it, then you need a switch in series with it that opens at some time, or a variable resistor that you set to a very large value.

Series diodes are often used in real life so that a collapsed main power supply doesn't drag down its backup supply. You could do the same here.