# Difference between revisions of "The Arbitrary Inductor model"

Line 1: | Line 1: | ||

− | LTspice allows specifying a behavioral inductance with an expression for the flux. The inductor's current ''may'' be referred to by the keyword "x" in the expression, but otherwise | + | LTspice allows specifying a behavioral inductance with an expression for the flux. The inductor's current ''may'' be referred to by the keyword "x" in the expression, but otherwise it may be completely arbitrary, that is, it may be any valid function of system dynamics (e.g., time and/or node voltages and/or branch currents). |

Below is a netlist example of an inductor with simple saturation. | Below is a netlist example of an inductor with simple saturation. | ||

Line 12: | Line 12: | ||

flux={L*Is}*tanh(x/{Is}) ; L= inductance and Is= "saturation" current | flux={L*Is}*tanh(x/{Is}) ; L= inductance and Is= "saturation" current | ||

− | Here this is further extended to add exponential control of saturation "sharpness". | + | Here this is further extended to add exponential control of saturation "sharpness" where an exponent of 1 = normal and >1 = sharper. |

flux={L*Is}*tanh((x/{Is})**{a})**{1/a} ; a= saturation "sharpness" (1=normal, >1=sharper) | flux={L*Is}*tanh((x/{Is})**{a})**{1/a} ; a= saturation "sharpness" (1=normal, >1=sharper) | ||

Line 20: | Line 20: | ||

.param L=330mH Is=2A a=3 ; fairly sharp saturation at 2A (the "a" factor is exponential) | .param L=330mH Is=2A a=3 ; fairly sharp saturation at 2A (the "a" factor is exponential) | ||

− | Unlike the standard inductor, which defaults to a series resistance of 1mΩ, the arbitrary inductor has no series resistance unless explicitly specified (ctrl-right mouse button click on the inductor). Also note that the numerical dynamic range of the arbitrary inductor seems to be about | + | Unlike the standard inductor, which defaults to a series resistance of 1mΩ, the arbitrary inductor has no series resistance unless explicitly specified (ctrl-right mouse button click on the inductor). Also note that the numerical dynamic range of the arbitrary inductor seems to be about 15 decades or so. |

## Revision as of 00:58, 21 September 2009

LTspice allows specifying a behavioral inductance with an expression for the flux. The inductor's current *may* be referred to by the keyword "x" in the expression, but otherwise it may be completely arbitrary, that is, it may be any valid function of system dynamics (e.g., time and/or node voltages and/or branch currents).

Below is a netlist example of an inductor with simple saturation.

L1 1 0 flux=0.33*2*tanh(x/2) ; 330mH inductor "saturates" at 2A (0.66 volt-seconds) I1 0 1 PWL(0 0 1 1) ; supplies unity di/dt so inductance corresponds to voltage .tran 0 5 1u 10m ; 5s transient run starting after 1us with 10ms maximum step size .end

LTspice's behavioral inductor may be parametrized, but the parser requires that all parameters or strictly parametric expressions must be enclosed within *curly braces*. Strictly parametric expressions may not include "x" (inductor current) or other *dynamic variables*. Below is a flux expression example of this technique.

flux={L*Is}*tanh(x/{Is}) ; L= inductance and Is= "saturation" current

Here this is further extended to add exponential control of saturation "sharpness" where an exponent of 1 = normal and >1 = sharper.

flux={L*Is}*tanh((x/{Is})**{a})**{1/a} ; a= saturation "sharpness" (1=normal, >1=sharper)

Note that the parameters for the above expressions must be defined elsewhere upon the schematic, usually as a parameter statement within a SPICE directive (SPICE text placed anywhere within the schematic).

.param L=330mH Is=2A a=3 ; fairly sharp saturation at 2A (the "a" factor is exponential)

Unlike the standard inductor, which defaults to a series resistance of 1mΩ, the arbitrary inductor has no series resistance unless explicitly specified (ctrl-right mouse button click on the inductor). Also note that the numerical dynamic range of the arbitrary inductor seems to be about 15 decades or so.