Documentation /  Analog Insydes /  Tutorial /  Modeling and Analysis of Nonlinear Circuits /

Defining Behavioral ModelsNonlinear Circuit Equations

2.6.3 Referencing Behavioral Models

Behavioral models are referenced exactly like subcircuits. Since we have already learned in Chapter 2.3 how to write hierarchical netlists we can start immediately with an example. Let's write a netlist for the diode circuit in Figure 6.3 using the diode model developed above.

Figure 6.3: Diode circuit

In[4]:= diodeNetwork =
Circuit[
Netlist[
{V0, {1, 0}, V0},
{R1, {1, 2}, R1},
{D1, {2 -> A, 0 -> C},
Model -> Diode,
Selector -> DC}
],
Model[
Name -> Diode,
Selector -> DC,
Ports -> {A, C},
Parameters -> {Is, Global[Vt]},
Variables -> {Current[A, C], Voltage[A, C]},
Definition ->
Equations[
Current[A, C] == Is (Exp[Voltage[A, C]/Vt] - 1)
]
]
]

Out[4]=

Defining Behavioral ModelsNonlinear Circuit Equations