I want to vary a capacitor's value over time. A previous question (LTspice: Vary a resistor's value over time) asked how to vary a resistor's value over time. One of the answers was to use a time variable in the resistor's value e.g. R=11-100*time. I tried this for a resistor and sure enough it worked. I thought I could use a similar approach for a capacitor e.g. C=11-100*time, but it doesn't work and I get an error message "Can't find definition of model 'C' ". I'm far from being an LTspice guru and would appreciate some help. Thanks.
Electronic – LTspice: Vary a capacitor’s value over time
ltspice
Related Topic
- Electronic – LTSpice: How to vary resistances in a simulation depending on the value of a voltage
- Electronic – LTSpice: Pass/Fail in Error Log if Voltage < Constant Reference
- Electronic – LTSpice: Can I vary schematic temperature over time
- Electronic – Plot voltage for different resistor values in LTSpice
- Electronic – LTspice a voltage source as a function of time
Best Answer
Well, yes and no. From the ltspice help:
This requires a bit of different thinking, and although you can make use of the special
time
variable, I have never verified that things work as expected. Especially intresting would be the point where the capacity will suddenly be lower than what the cap is currently holding in energy, what will ltspice do here? Or if when for the next timestep the capacity is now higher, will the stored energy be the same or scaled too?You should test if it behaves the way you want it in a seperate test circuit first.