Stability issue with behavioral Capacitor

I have run into some issues with a behavioral Capacitor of the definition:

C = 40.0 * V(T1)^3 / (V(T1) + 20)^3 + 1m

This is the simulation:

This is a thermal model following the usual SPICE equivalences of:

  • heat capacitances are capacitors
  • heat conductances are conductances
  • heat flows are currents
  • temperatures are voltages
  • heat reservoirs are voltage sources

The simulation should show how the objects (C1 and C2) cool from room temperature down to 1.5 K:

Applying the proper Debye formula for the heat capacitance will reveal a faster cooldown:

It all works well until the voltage on C1 suddenly bursts into oscillation:

This is unexpected, because the formula for C is well behaved and smooth on the positive domain.

I have tried different step sizes, but nothing solved the issue reliably, however forcing a small stepsize on a millisecond scale made the simulation stable, but deliver wrong results, namely the temperature (aka voltage) got stuck at 40, slightly oscillating around that value.

If I change the value 20 in the capacitor’s definition, the wrong result will continue stabilizing at twice that value.

Just for completeness’ sake, below is the correct simulation, which I got by pure trial and error or some value tuning, but which is not at all reliable, especially once I add more things to the circuit or change values:

1 Like

I reproduced your simulation and change the capacitor definition in the form of Q= Cdebye * x and I think the result is much better. Perhaps you can try that. Best regards



Hi alastas, sorry. I have only seen that now. Can you explain what you did there? How can the capacitor behave the same, when in one instance we specify the Q(V) and in another instance we specify the C(V) ? :thinking:

(I noticed too, that giving the charge formula is much more numerically stable, but the Q(V) formula was more lengthy (finite integral of C(V)), so I didn’t like it.)

Hello well I used the non linear definition of capacitance that I used in LTspice Q = f(x) and if you do this ; x is thus understood as the voltage at the capacitance node. So a simple 1µF cap, can be defined as Q= 0.000001*x. So I just reply the 1µF by your Debye formula. In fact there is an error in my formula , I should have written Q = ( complete debye formula ) x . my mistake. sorry. may be it would be fine to write Q =(1m +40(x/(x+20))^3)*x .Maybe you can try that..