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

Referencing Behavioral ModelsMulti-Dimensional Models

2.6.4 Nonlinear Circuit Equations

Setting up Nonlinear Equations

Using the command CircuitEquations you can set up modified nodal or sparse tableau equations for nonlinear circuits just as for linear circuits. The only restriction is that nonlinear systems of equations cannot be set up in matrix form. Therefore, whenever a netlist contains behavioral models, you must call CircuitEquations with the option MatrixEquation -> False, or as in our case, you need to switch the AnalysisMode to e.g. DC for setting up nonlinear static equations which automatically implies the setting MatrixEquation -> False.

In[5]:= dnwmna = CircuitEquations[diodeNetwork,
AnalysisMode -> DC];
DisplayForm[dnwmna]

Out[6]//DisplayForm=

Here, we have set up a system of nonlinear modified nodal equations in the unknowns V$1, V$2, I$V0, and I$AC$D1. The latter symbol has been created automatically from the port current identifier Current[A, C] in the definition of the diode model. All port branch voltages have been replaced by corresponding differences of node voltages.

Generally, a port current Current[x, y] in a model instance MX will be denoted by symbols of the form I$xy$MX. A port voltage Voltage[x, y] will be denoted by V$xy$MX, provided that branch voltages appear as unknowns in the selected analysis method. To examine both effects we set up the sparse tableau equations.

In[6]:= CircuitEquations[diodeNetwork,
Formulation -> SparseTableau, AnalysisMode -> DC
] // GetVariables

Out[7]=

We use the command GetVariables to extract the list of variables from the equation system. As you can see, the corresponding variables are called V$AC$D1 and I$AC$D1

Solving Nonlinear Equations

Solving nonlinear circuit equations analytically is, unfortunately, mathematically impossible in the general case. However, in many applications it is possible to reduce the original set of equations by eliminating a number of variables. This may already yield some qualitative insight into the behavior of a nonlinear circuit. On the other hand, we can always assign values to symbolic parameters and solve the equations numerically using NDAESolve.

Let's derive an expression which relates the diode current I$AC$D1 to the input voltage V0 by eliminating all other variables. For this task, Analog Insydes provides the function CompressNonlinearEquations which removes equations and variables from a nonlinear DAEObject that are irrelevant for solving for a set of given variables. The option setting EliminateVariables -> All additionally allows for eliminating variables that occur linear somewhere in the equations.

In[7]:= dnwsol = CompressNonlinearEquations[dnwmna, I$AC$D1,
EliminateVariables -> All];
DisplayForm[dnwsol]

Out[9]//DisplayForm=

The implicit equation is what we have been looking for. Without resorting to approximation methods such as Taylor series we cannot simplify the result any further and solve for the diode current analytically.

Referencing Behavioral ModelsMulti-Dimensional Models