Subsections


Modified Nodal Analysis

Many different kinds of network element are encountered in network analysis. For circuit analysis it is necessary to formulate equations for circuits containing as many different types of network elements as possible. There are various methods for equation formulation for a circuit. These are based on three types of equations found in circuit theory:

The equations have to be formulated (represented in a computer program) automatically in a simple, comprehensive manner. Once formulated, the system of equations has to be solved. There are two main aspects to be considered when choosing algorithms for this purpose: accuracy and speed. The MNA, briefly for Modified Nodal Analysis, has been proved to accomplish these tasks.

MNA applied to a circuit with passive elements, independent current and voltage sources and active elements results in a matrix equation of the form:

$\displaystyle \left[A\right] \cdot \left[x\right] = \left[z\right]$ (3.1)

For a circuit with N nodes and M independent voltage sources:

The circuit is solved by a simple matrix manipulation:

$\displaystyle \left[x\right] = \left[A\right]^{-1} \cdot \left[z\right]$ (3.2)

Though this may be difficult by hand, it is straightforward and so is easily done by computer.

Generating the MNA matrices

The following section is an algorithmic approach to the concept of the Modified Nodal Analysis. There are three matrices we need to generate, the A matrix, the x matrix and the z matrix. Each of these will be created by combining several individual sub-matrices.

The A matrix

The A matrix will be developed as the combination of 4 smaller matrices, G, B, C, and D.

$\displaystyle A = \begin{bmatrix}G & B\\ C & D \end{bmatrix}$ (3.3)

The A matrix is (M+N)$ \times$(M+N) (N is the number of nodes, and M is the number of independent voltage sources) and:

Rules for making the G matrix

The G matrix is an N$ \times$N matrix formed in two steps.

  1. Each element in the diagonal matrix is equal to the sum of the conductance (one over the resistance) of each element connected to the corresponding node. So the first diagonal element is the sum of conductances connected to node 1, the second diagonal element is the sum of conductances connected to node 2, and so on.
  2. The off diagonal elements are the negative conductance of the element connected to the pair of corresponding node. Therefore a resistor between nodes 1 and 2 goes into the G matrix at location (1,2) and locations (2,1).

If an element is grounded, it will only have contribute to one entry in the G matrix - at the appropriate location on the diagonal. If it is ungrounded it will contribute to four entries in the matrix - two diagonal entries (corresponding to the two nodes) and two off-diagonal entries.

Rules for making the B matrix

The B matrix is an N$ \times$M matrix with only 0, 1 and -1 elements. Each location in the matrix corresponds to a particular voltage source (first dimension) or a node (second dimension). If the positive terminal of the ith voltage source is connected to node k, then the element (k,i) in the B matrix is a 1. If the negative terminal of the ith voltage source is connected to node k, then the element (k,i) in the B matrix is a -1. Otherwise, elements of the B matrix are zero.

If a voltage source is ungrounded, it will have two elements in the B matrix (a 1 and a -1 in the same column). If it is grounded it will only have one element in the matrix.

Rules for making the C matrix

The C matrix is an M$ \times$N matrix with only 0, 1 and -1 elements. Each location in the matrix corresponds to a particular node (first dimension) or voltage source (second dimension). If the positive terminal of the ith voltage source is connected to node k, then the element (i,k) in the C matrix is a 1. If the negative terminal of the ith voltage source is connected to node k, then the element (i,k) in the C matrix is a -1. Otherwise, elements of the C matrix are zero.

In other words, the C matrix is the transpose of the B matrix. This is not the case when dependent sources are present.

Rules for making the D matrix

The D matrix is an M$ \times$M matrix that is composed entirely of zeros. It can be non-zero if dependent sources are considered.


The x matrix

The x matrix holds our unknown quantities and will be developed as the combination of 2 smaller matrices v and j. It is considerably easier to define than the A matrix.

$\displaystyle x = \begin{bmatrix}v\\ j \end{bmatrix}$ (3.4)

The x matrix is 1$ \times$(M+N) (N is the number of nodes, and M is the number of independent voltage sources) and:

Rules for making the v matrix

The v matrix is an 1$ \times$N matrix formed of the node voltages. Each element in v corresponds to the voltage at the equivalent node in the circuit (there is no entry for ground - node 0).

For a circuit with N nodes we get:

$\displaystyle v = \begin{bmatrix}v_{1}\\ v_{2}\\ \vdots\\ v_{N}\\ \end{bmatrix}$ (3.5)

Rules for making the j matrix

The j matrix is an 1$ \times$M matrix, with one entry for the current through each voltage source. So if there are M voltage sources $ V_{1}$, $ V_{2}$ through $ V_{M}$, the j matrix will be:

$\displaystyle j = \begin{bmatrix}i_{V_{1}}\\ i_{V_{2}}\\ \vdots\\ i_{V_{M}}\\ \end{bmatrix}$ (3.6)

The z matrix

The z matrix holds our independent voltage and current sources and will be developed as the combination of 2 smaller matrices i and e. It is quite easy to formulate.

$\displaystyle z = \begin{bmatrix}i\\ e \end{bmatrix}$ (3.7)

The z matrix is 1$ \times$(M+N) (N is the number of nodes, and M is the number of independent voltage sources) and:

Rules for making the i matrix

The i matrix is an 1$ \times$N matrix with each element of the matrix corresponding to a particular node. The value of each element of i is determined by the sum of current sources into the corresponding node. If there are no current sources connected to the node, the value is zero.

Rules for making the e matrix

The e matrix is an 1$ \times$M matrix with each element of the matrix equal in value to the corresponding independent voltage source.

A simple example

The example given in fig. 3.1 illustrates applying the rules for building the MNA matrices and how this relates to basic equations used in circuit analysis.

Figure 3.1: example circuit applied to modified nodal analysis
\includegraphics[width=10cm]{MNAexample}

Going through the MNA algorithm

The G matrix is a 2$ \times$2 matrix because there are 2 different nodes apart from ground which is the reference node. On the diagonal you find the sum of the elements conductances connected to the nodes 1 and 2. The off-diagonal matrix entries contain the negative conductances of the elements connected between two nodes.

$\displaystyle G = \begin{bmatrix}\frac{1}{R_{1}} & -\frac{1}{R_{1}}\\ -\frac{1}...
...{1}{R_{2}} \end{bmatrix} = \begin{bmatrix}0.2 & -0.2\\ -0.2 & 0.3 \end{bmatrix}$ (3.8)

The B matrix (which is transposed to C) is a 1$ \times$2 matrix because there is one voltage source and 2 nodes. The positive terminal of the voltage source $ V_{1}$ is connected to node 1. That is why

$\displaystyle B = C^{T} = \begin{bmatrix}1\\ 0 \end{bmatrix}$ (3.9)

and the D matrix is filled with zeros only because there are no dependent (active and controlled) devices in the example circuit.

$\displaystyle D = \begin{bmatrix}0 \end{bmatrix}$ (3.10)

The x matrix is a 1$ \times$3 matrix. The MNA equations deliver a solution for the unknown voltages at each node in a circuit except the reference node and the currents through each voltage source.

$\displaystyle x = \begin{bmatrix}v_{1}\\ v_{2}\\ i_{V_{1}} \end{bmatrix}$ (3.11)

The z matrix is according to the rules for building it a 1$ \times$3 matrix. The upper two entries are the sums of the currents flowing into node 1 and node 2. The lower entry is the voltage value of the voltage source $ V_{1}$.

$\displaystyle z = \begin{bmatrix}0\\ I_{1}\\ U_{1} \end{bmatrix} = \begin{bmatrix}0\\ 1\\ 1 \end{bmatrix}$ (3.12)

According to the MNA algorithm the equation system is represented by

$\displaystyle \left[A\right] \cdot \left[x\right] = \left[z\right]$ (3.13)

which is equivalent to

$\displaystyle \begin{bmatrix}G & B\\ C & D \end{bmatrix} \cdot \begin{bmatrix}x \end{bmatrix} = \begin{bmatrix}z \end{bmatrix}$ (3.14)

In the example eq. (3.14) expands to:

$\displaystyle \begin{bmatrix}\frac{1}{R_{1}} & -\frac{1}{R_{1}} & 1\\ -\frac{1}...
..._{2}\\ i_{V_{1}} \end{bmatrix} = \begin{bmatrix}0\\ I_{1}\\ U_{1} \end{bmatrix}$ (3.15)

The equation systems to be solved is now defined by the following matrix representation.

$\displaystyle \begin{bmatrix}0.2 & -0.2 & 1\\ -0.2 & 0.3 & 0\\ 1 & 0 & 0 \end{b...
..._{1}\\ v_{2}\\ i_{V_{1}} \end{bmatrix} = \begin{bmatrix}0\\ 1\\ 1 \end{bmatrix}$ (3.16)

Using matrix inversion the solution vector x writes as follows:

$\displaystyle \left[x\right] = \left[A\right]^{-1}\cdot \left[z\right] = \begin...
...1}\\ v_{2}\\ i_{V_{1}} \end{bmatrix} = \begin{bmatrix}1\\ 4\\ 0.6 \end{bmatrix}$ (3.17)

The result in eq. (3.17) denotes the current through the voltage source $ V_{1}$ is $ 0.6\ampere$, the voltage at node 1 is $ 1\volt$ and the voltage at node 2 is $ 4\volt$.

How the algorithm relates to basic equations in circuit analysis

Expanding the matrix representation in eq. (3.15) to a set of equations denotes the following equation system consisting of 3 of them.

$\displaystyle \rm {I:}$ $\displaystyle \qquad 0 = \frac{1}{R_{1}}\cdot v_{1} - \frac{1}{R_{1}}\cdot v_{2} + i_{V_{1}}$ KCL at node 1 (3.18)
$\displaystyle \rm {II:}$ $\displaystyle \qquad I_{1} = -\frac{1}{R_{1}}\cdot v_{1} + \left(\frac{1}{R_{1}} + \frac{1}{R_{2}}\right)\cdot v_{2}$ KCL at node 2 (3.19)
$\displaystyle \rm {III:}$ $\displaystyle \qquad U_{1} = v_{1}$ constitutive equation (3.20)

Apparently eq. I and eq. II conform to Kirchhoff's current law at the nodes 1 and 2. The last equation is just the constitutive equation for the voltage source $ V_{1}$. There are three unknowns ($ v_{1}$, $ v_{2}$ and $ i_{V_{1}}$) and three equations, thus the system should be solvable.

Equation III indicates the voltage at node 1 is $ 1\volt$. Applying this result to eq. II and transposing it to $ v_{2}$ (the voltage at node 2) gives

$\displaystyle v_{2} = \frac{I_{1} + \frac{1}{R_{1}}\cdot U_{1}}{\frac{1}{R_{1}} + \frac{1}{R_{2}}} = 4\volt$ (3.21)

The missing current through the voltage source $ V_{1}$ can be computed using both the results $ v_{2} = 4\volt$ and $ v_{1} = 1\volt$ by transforming equation I.

$\displaystyle i_{V_{1}} = \frac{1}{R_{1}}\cdot v_{2} - \frac{1}{R_{1}}\cdot v_{1} = 0.6\ampere$ (3.22)

The small example, shown in fig. 3.1, and the excursus into artless math verifies that the MNA algorithm and classic electrical handiwork tend to produce the same results.


This document was generated by Stefan Jahn on 2007-12-30 using latex2html.