I am trying to make current dependent inductor in LTspice according my mesurements. LTspice includes feature flux where "x" is referred to inductor's current but when I used it in combination with my measured results flux=(2E-11*x*x - 3E-09*x + 1E-06)*x it does not work and gives me wrong value. Measured current reffers to value L=1uH but it should be L=1.19uH. Can anyone help me with this problem or give me any advice how to make current dependant inductor which will be represanting my measurements? If you need any further info please ask. Thank you very much in advance for your help.printscreen of LTspice


1 Answer 1


The x signifies the derivative, so you have to integrate your expression, first, in order to obtain it correctly.

For your case:



To verify the inductance, you can use a unity ramp current source, which will give a voltage proportional to its inductance:


Notes (in case you want to try it out yourself):

  • Since your function varies slowly, I chose an interval of 200s to show its variation which, given the great dynamic range difference between the function's values and the time range, LTspice, by default, can show misleading results, so I disabled the waveform compression (imposing a small enough timestep would also have been enough).

  • There is a sharp rise right at the beginning. That is due to the derivative, I'm afraid it "comes with the territory".

  • \$\begingroup\$ what is that y = 20p*time**2 - 3n*time -1u in your behavioral voltage source? \$\endgroup\$
    – Unknown123
    Dec 10, 2020 at 22:30
  • 1
    \$\begingroup\$ @Unknown123 I can't quite tell if you do't understand the notation or the presence of the expression, but to address both, 20p=2e-11, 3n=3e=9, and 1u=1e-6, which means the behavioural source implements OP's f(x). Its purpose is to show that the desired function and the one given by the current through the behavioural inductor are the same (their difference, V(x,y), is zero). I'm surprised you didn't ask about the expression for Flux=. (BTW, it's V=, not y=, unless you meant V(y)?). \$\endgroup\$ Dec 11, 2020 at 22:21
  • \$\begingroup\$ (Yes it's V=, because voltage in y node is defined as expression V=, thus I wrote it as y=, it's subconscious, sorry for the confusion.) I was confused why x become time, then realized that you made time and V in that simulation analogous to current and inductance. Thank you very much. \$\endgroup\$
    – Unknown123
    Dec 12, 2020 at 10:20
  • \$\begingroup\$ @Unknown123 You're welcome. In case someone else reads this, the time keyword is used in B1 because it's an expression for a behavioural source (V=, or I=), whereas x is used in L1 because it's an expression for a behavioural inductor (Flux=), for whom the keyword x has a special meaning: the current through it; similarly for the behavioural capacitor, Q=, where x means the voltage across it. \$\endgroup\$ Dec 13, 2020 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.