Nodal Analyses Reference


In the following discussion we assume that x is the vector of nodal variables. We denote matrices and frequency-domain quantities with uppercase letters.

This section documents the formulation used for nodal-based analyses. For all analyses there are four types of devices to consider:

Linear VCCS/QS

Contribute the G and C matrices, respectively. Elements provide the following attributes to build these matrices: linearVCCS and linearVCQS.

Nonlinear VCCS/QS

Contribute i(v, v_T) and q(v, v_T) vector functions. Here v is a vector with controlling port voltages and v_T is a vector with time-delayed control voltages. For the j^{th} nonlinear device, vector [i_j , q_j]^T and its Jacobian are returned by eval_and_deriv(). The Jacobian is returned in a single matrix with the following format:

\left[ \begin{array}{cc} di_j/dv & di_j/dv_T \\
                         dq_j/dv & dq_j/dv_T
                         \end{array} \right]

In nodal analyses, controlling port voltages (v) are obtained as differences between elements of the nodal variables vector (x). In compact form this can be denoted as:

v = T_{cv} x \; ,

where T_{cv} is an incidence matrix. All nonzero entries in T_{dv} are either equal to 1 or -1 and there are at most two nonzero entries per row. This matrix is implicitly stored in the simulator with the control port definitions in each element. Samples of time-delayed control voltages can be calculated in a similar way using a T_{dv} incident matrix but the effect of time delays depends on the analysis type.

Vector functions i(v, v_T) and q(v, v_T) are mapped into the nodal equations using incidence matrices T_i and T_q, which have the same properties as the transpose of T_{cv}.

Frequency-defined devices

Contribute the complex, frequency-dependent Y(f) matrix. The corresponding impulse-response matrix is denoted Y(t). The following methods are used to build this matrix: get_Y_matrix() for f \neq 0 and get_G_matrix() for f = 0. More details will be provided when time-domain support for this kind of device is implemented.


Contribute a source vector. There are 3 types of source: DC (s_{DC}), time-domain (s(t)) and frequency-domain (S(f)). The following element methods are used: get_DCsource(), get_TDsource(), get_FDsource() and get_AC().

OP/DC Equations

For DC analysis, time-delayed control voltages are calculated as regular control voltages; C and q(v, v_T) are ignored and only the DC component of sources (s_{DC}) and the DC conductance matrix of frequency-defined elements (G_0) are considered.

The analysis solves the following nonlinear equation iteratively using Newton’s method:

(G + G_0) x + T_i i(T_{cv} x, T_{dv} x) = s_{DC} \; .

Let G_1 = G + G_0. The iteration is defined by linearizing i(T_{cv} x, T_{dv} x) as follows:

G_1 x^{k+1} + i^k + J^k_i \, (x^{k+1} - x^k) = s_{DC} \; ,

where the k superscript indicates the iteration number and

i^k = T_i i \left(T_{cv} x^k, T_{dv} x^k \right)

J^k_i = \left(
        \frac{di^k}{dv} T_{cv} + \frac{di^k}{dv_T} T_{dv}
        \right) \; .

The x^k vector is assumed to be known for each iteration and x^{k+1} is the unknown to solve for. The initial guess (x_0) is set to the values suggested by the nonlinear devices, if any, or otherwise to zero. The previous equation can be re-arranged as as the following system of linear equations:

(G_1 + J^k_i) \, \Delta x^{k+1} =
       s_{DC} - G_1 x^k - i^k \; ,

with \Delta x^{k+1} = x^{k+1} - x^k. This equation can be seen as the nodal equation of a linearized circuit obtained by substituting all devices by transconductances in parallel with current sources that are dependent of the current approximation for the nodal voltages (x^k).

The condition to stop Newton iterations is:

| \Delta x^{k+1}_j | <
    \mbox{reltol} \; \max(|x^{k+1}_j|,  |x^k_j|) + \mbox{abstol}

for each nodal variable (j). In addition, if errfunc is set to True, nodal equations are also checked:

|(G + G_0) x^{k+1} + i^{k+1} - s_{DC}| < \mbox{abstol} \; ,

and iterations stop when both conditions are satisfied. Normally the first condition is enough to obtain an acceptable solution and that is why by default the second check is not enabled to save the CPU time required to re-evaluate the nodal equations.

AC Formulation

Here X(f) is the nodal vector in frequency domain. A DC operating point analysis is performed first to obtain the incremental conductances and capacitances given by di/dx and dq/dx, respectively. The analysis solves for X(f) for all requested frequencies using the following equation:

\left[ (G + J_i + j 2 \pi f (C + J_q)
       + Y(f) \right] \, X(f) = S(f)

The J_i and J_q Jacobian matrices are calculated as follows:

J_i = T_i \left(
       \frac{di}{dv} T_{cv} + \frac{di}{dv_T} E_{\tau} T_{dv}
       \right) \; ,

J_q = T_q \left(
       \frac{dq}{dv} T_{cv} + \frac{dq}{dv_T} E_{\tau} T_{dv}
       \right) \; ,

where E_{\tau} is a diagonal matrix that includes the effect of time delays in each control port:

E_{\tau} = \mbox{diag}\left( [\exp(-j \omega \tau_1),
           \exp(-j \omega \tau_2), \dots , \exp(-j \omega \tau_m)]

Transient Analysis Equations

Transient analysis solves the following nonlinear algebraic-integral-differential equation given an initial condition, x(0) = x_0:

G x + C \dot{x} + T_i i(T_{cv} x, d(T_{dv} x)) +
  T_q \dot{q}(T_{cv} x, d(T_{dv} x)) +
  \int_{0}^\infty Y(\tau) x(t - \tau) d\tau
  = s_{DC} + s(t)  \; ,

where dotted quantities indicate derivative with respect to time and d() is a vector function that applies a (possibly different) time delay to each control voltage. The delay function (d()) is implemented by storing all time-delayed control port voltages and using an interpolation function to find the voltage at the desired time in the past.

The initial condition (x(0)) is usually obtained by calculating the operating point of the circuit using the OP analysis.

An integration method such as Backward Euler (BE) or trapezoidal rule is applied to transform the differential equation into a difference equation by discretizing time and approximating derivatives with respect to time. Here we assume the time step (h) is constant. For example, using the BE rule:

\dot{q}(t_n) = \dot{q}_n \approx \frac{q_n - q_{n-1}}{h} \; ,

here, the subscript n denotes the time sample number. For implicit methods in general,

\dot{q_n} \approx a_0 q_n - f_{n-1}(q) \; ,

with f_{n-1}(x) being a function that depends on the previous samples of q:

f_{n-1}(q) = a_1 q_{n-1} + a_2 q_{n-2} + \dots \; .

The a_i; i=0,1,\dots coefficients depend on the time step size and the integration method. Substituting dotted variables and discretizing the convolution operation the resulting circuit equation is the following:

G' x_n + i'(x_n) = s' \; ,


G' = G + Y_0 + a_0 C

i'(x_n) = T_i i(T_{cv} x_n, d(T_{dv} x_n)) +
          a_0 T_q q(T_{cv} x_n, d(T_{dv} x_n))

s' = s_n - \sum_{m=1}^\infty \textbf{Y}_m x_{n-m}
          + f_{n-1}(C x + T_q q) \; ,

where Y_m = Y(t_m) and Y_0 = Y(0). Note that s' is a known vector at the n^{th} time step. This is the equation of a DC circuit with a conductance matrix equal to G', a set of nonlinear currents given by the i'(x_n) function and a source vector given by s'. The unknown (x_n) is iteratively solved using Newton’s Method (similarly as in OP/DC analysis). Iterations are defined by linearizing i'(x) as follows:

G' x^{k+1}_n + i'(x^k_n) + J^k_n \Delta x^{k+1}_n
    = s' \; ,

where the k subscript denotes the Newton iteration number, \Delta x^{k+1}_n = x^{k+1}_n - x^k_n and J^k_n =
di'(x^k_n)/dx. This equation is re-arranged as follows:

( G' + J^k_n ) \Delta x^{k+1}_n =
  s' - G' x^k_n - i'(x^k_n) \; ,

as the right-hand side of this equation is known at the k^{th} iteration, x^{k+1}_n can be found by solving a linear system of equations.

The criterion to stop iterations is the same as in the DC analysis.

Table Of Contents

Previous topic

Internal Circuit Representation Reference

Next topic

Analyses Utility Classes and Functions

This Page