I would like to know how to connect a transistor (MOSFET) to a capacitive load. I would like to rapidly charge and discharge a capacitor.
How do I do it correctly? I basically want the transistor to work as a mechanical switch.
What I have tried so far
I have tried the following circuit, but for some reason, VDS (voltage, drain-source) is always zero. Here VDS = V_cap (Voltage over the capacitor)
Here is a transient analysis:
As you can see VDS is always zero. I expect it to be alternating.
As suggested, putting a small Resistor (here I put 10Ohms) in parallel solves the issue: