# LTSpice capacitance dependend on voltage source

I am looking for a way to change the value of a capacitance dependent on the voltage source of the circuit.

How do I create a voltage dependent capacitor in LT spice?

Edit: Two capacitances in a row are connected to a voltage source. The voltage source has a defined slope of the voltage. One capacitance shall be dependend (nonlinear) on the current voltage that the voltage source outputs. Example:::: Voltage (Power supply)= 200V -> Capacitor_1 = 10uF :::: Voltage (Power supply)= 400V -> Capacitor_1 = 1uF

• What methods have you found so far and, importantly, what is your question? Commented Jun 19, 2018 at 9:35
• Are you looking for a voltage dependent capacitor? Not clear what is the voltage source of the circuit and I am sure that it is not a general name. Commented Jun 19, 2018 at 11:23
• I know that I can change the Cap with .step param, but then ltspice outputs various simulations of the steps. What I have is this: Two capacitances in a row are connected to a voltage source. The voltage source has a defined slope of the voltage. One capacitance shall be dependend (nonlinear) on the current voltage that the voltage source outputs. Example:::: Voltage (Power supply)= 200V -> Capacitor_1 = 10uF :::: Voltage (Power supply)= 400V -> Capacitor_1 = 1uF Commented Jun 19, 2018 at 13:41
– Bort
Commented Jun 19, 2018 at 14:48
• State your purposes. Is this for the purposes of improving a MOSFET model? Do you want a two-terminal device that varies its capacitance based upon the impressed voltage? Do you want a 4-terminal device that is separately controlled? Do you want this table-based? One sentence does not a question make! And yes, I can see your comment. Put this and other information into good form in the question.
– jonk
Commented Jun 19, 2018 at 16:15

The behavioural elements include, besides the voltage and current, resistor, inductor, and capacitor. If you ran a quick search through the manual you would have found out quicker than it would have taken you to ask here: LTspice > Circuit Elements > C, bottom. Simply place a capacitor and add Q=<...> as the value. If the formula includes x, that signifies a derivative of the current, so your expression needs to be integrated first -- unless you don't need x, it can be done, for example external voltage, in your case.
So, for example, if you want your capacitance to vary according to $\sin x$, then you have to integrate that first, which gives you $-cos x$:
See the expression is -cos(x), whre x is the derivative of the current. The driving voltage is a unity ramp, which means the current through the capacitor is directly its value (I(C1)). The behavioural voltage is for confirmation, V(test), which shows the same sine. Here, for reasons of clarity, I avoided dividing by 2$\pi$, so that the current has a different amplitude; had I not, the current and the voltage would have overlapped and it would not have been clear.