Continue to Site

# time varying capacitor and inductor in LTspice

#### MuroSamuro

##### Member level 4
Hello,

I would like to generate a time variant capcitor (C(t)) and inductor ((L(t)) in LTspice, however I do not know how.
I could not find any step-by-step manual for this issue.

Thanks

It's surely possible with behavioral modeling. Your question could be clearer if you specify what kind of time dependency you want to model. What is the physical effect behind?

Depending on what you're after you might be able to
use passives and poly vccs elements to make a node
voltage pair, control the current "scale factor" applied
to a unit C or L. I use this scheme to make voltage
variable resistor (I omit the resistor and just loop the
second control terminal pair of the N=2 source, back
to the "through-terminals") that I use as a switch,
minus the discontinuous derivatives (if you use the
right control voltage waveform) and hidden goings-on.

Hi,

Variable capacitor circuits can be built: On can use an OPAMP with variable gain and a capacitor at it´s output.
If you are able to make the gain varaiable ... then also the capacitance is varaiable.

****
How "realistic" do you need the "change" to be?

When I think back about physics class.. We had this big plates capacitor, where we could change the distance of the plates to change the capacitance.
I remember there was a mechanical force between the plates. So when the capacitor is charged, and you wanted to move the plates there needed to be extra mechanical energy.

In other words: the stored energy is: W = 0.5 * C * V * V ... so if you wanted to "compensate" for the extra mechanical energy (set to be zero) then you need to change V accordingly. In a way that W1 = W2 --> C1 * V1 * V1 = C2 * V2 * V2
As an example: When you change the capacitance to become 1/4 of before, then you need to double the voltage.

Klaus

Example using LTspice behavioral modelling

#### Attachments

• varcap.zip
735 bytes · Views: 41
MuroSamuro

### MuroSamuro

Points: 2
Example using LTspice behavioral modelling

View attachment 189579
Thanks,
can you tell the syntax for the case C(t)=exp(-alpha*t), where alpha is some const and C(t) is the capacitance.

Are you trying to show that Cap current is the rate of change in both Vc(t) and C(t) ?

Are you trying to show that Cap current is the rate of change in both Vc(t) and C(t) ?
yes, for time variant capacitors Ic=d/dt (C(t)Vc(t))

I have seen ceramic caps with C(v) inverse to voltage increase, but not linear with Vc. The sensitivity I recall was Ic= C dVc/dt + Vc dC/dt characteristics due to X7R memory effects** in S/H cap for which ceramic must not be used unless NP0. That was 45 yrs ago, so I don't remember much more.

** double-electric layer effect?

Last edited:

can you tell the syntax for the case C(t)=exp(-alpha*t), where alpha is some const and C(t) is the capacitance.
In the example, you can use exp(-alpha*time) instead of V(ctrl). You'll find all avaible behavioral functions in B component documentation.