How to define an inductor in QSPICE with current-dependent inductance?

i have tried to define a current-dependent inductor using flux definition like

“|.SUBCKT NLIND Lp Ln Tcore\nLx Lp Ln FLUX={L0*(1 + A0V(Tcore))I(Lx) + L1(1 + A1V(Tcore))I(Lx)*2/2 + L2(1 + A2V(Tcore))*I(Lx)**3/3}\n.ENDS NLIND”

but the output window always shows “Warning: Node voltages such as V(n01) can not be used in netlist parameter expressions because these parameters are evaluated before the simulation starts.”

And is it possible to define the inductance-current relationship as a piecewise linear function (like a folded line)?

thx a lot!

Remove the curly brackets to verify if the warning can be resolved.
Next time, use “preformatted text” (Ctrl-e) and paste the netlist or subckt in the forum message. This forum automatically formats some special characters.

image

1 Like

Is everything correct here?

1 Like

@Belov, this is only related to @Lokfu copying the subckt and pasting it into the forum without using preformatted text. As I mentioned, this forum automatically formats some special characters. If this is truly his formula, Qspice will return an error instead of a warning.

This is a very common mistake that newcomers make when they paste formulas or netlists directly into the forum, and the forum automatically messes up the text.

This is preformatted text option in reply. Pasting code/netlist needs this option to quote such text.
image

2 Likes

It’s impossible to read the tea leaves and know exactly what will happen next. Source code is needed for valuation.

1 Like

I am truly deeply grateful. As a complete novice to this, i sincerely appreciate your assistance :smiling_face_with_tear:

1 Like

sorry i am complete novice for this, i believe it’s now solved, sincerely appreciation for your advise :smiling_face_with_tear: