I want to make a spice simulation with a time varying capacitor. Is it possibel to do that in LTSpice or PSpice e.g. with a control voltage. As far I know with LTSpice it is just possible to vary the charge. But I have to change the capacitnace and keep the charge constant to simulate an electrostatic energy harvester.
Yes. This is possible in PSpice. As FvM mentioned you can use G devices to create various types of controlled impedances (inductor/capacitor/resistance). You can refer the following application note for detailed step by step instruction on how to do this.