This document is comprised of a brief introduction to modified nodal analysis (MNA), 3 examples and some observations about the MNA method that will be useful for developing a computer algorithm.

- Introduction
- Example 1
- Example 2
- Example 3
- Observations about MNA
- An algorithm for solving circuits using MNA

Though the node voltage method and loop current method are the most widely taught, another powerful method is modified nodal analysis (MNA). MNA often results in larger systems of equations than the other methods, but is easier to implement algorithmically on a computer which is a substantial advantage for automated solution. To use modified nodal analysis you write one equation for each node not attached to a voltage source (as in standard nodal analysis), and you augment these equations with an equation for each voltage source. To be more specific, the rules for standard nodal analysis are shown below:

## Node Voltage Method

To apply the node voltage method to a circuit with

nnodes (withmvoltage sources), perform the following steps (after Rizzoni).

- Selective a reference node (usually ground).
- Name the remaining n-1 nodes and label a current through each passive element and each current source.
- Apply Kirchoff's current law to each node
notconnected to a voltage source.- Solve the system of
n-1-munknown voltages.The difficulty with this method comes from having to consider the effect of voltage sources. Either a separate equation is written for each source, or the supernode method must be used.

The rules for modified nodal analysis are given by:

## Modified Nodal Analysis

To apply the node voltage method to a circuit with

nnodes (withmvoltage sources), perform the following steps (after DeCarlo/Lin).

- Selective a reference node (usually ground) and name the remaining n-1 nodes. Also label currents through each current source.
- Assign a name to the current through each voltage source. We will use the convention that the current flows from the positive node to the negative node of the source.
- Apply Kirchoff's current law to each node. We will take currents out of the node to be positive.
- Write an equation for the voltage each voltage source.
- Solve the system of
n-1unknowns.Note: I will only discuss independent current and voltage sources. Dependent sources are a simple extension. See Litovski or DeCarlo/Lin for reference.

As an example consider the circuit below (from the previous document)

## Example 1

Consider the circuit shown below (Step 1 has already been applied)

Apply step 2 (currents through the voltage sources with current from positive node to negative node):

Apply step 3 (with positive currents out of the node):

Apply step 4:

Apply step 5:

or

Now all that is left is to solve the 5x5 set of equations (recall that the nodal analysis method resulted in just 1 equation, though we did some substitutions along the way). Solving the 5x5 equation is difficult by hand, but not so with a computer.

## Example 2

If you'll recall, the nodal analysis method became a bit more difficult when one or more of the voltage sources was not connect to ground. Let's repeat Example 2 of the previous page with MNA. Here the circuit is repeated with steps 1 and 2 completed:

Steps 3 and 4

Step 5

The fact that V1 is not grounded presented no difficulty at all.

## Example 3

Let's consider one more example, this time with a current source (this example is from Litovski). Steps 1 and 2 have been completed.

Now complete steps 3 and 4:

And finally bring all the know variables to the right hand side and complete step 5:

If you examine the matrix equations that resulted from the application of the MNA method, several patterns become apparent that we can use to develop an algorithm. All of the circuits resulted in an equation of the form.

Let us examine example 2. This circuit had 3
nodes and 2 voltage sources (*n*=3, *m*=2). The resulting matrix
is shown below.

Note that the pink highlighted portion of the **A** matrix is 3x3
(in general *n*x*n*), and includes
only known quantities, specifically the values of the passive elements (the
resistors). In addition the highlighted portion of the **A** matrix is
symmetric with positive values along the main diagonal, and only negative (or
zero) values for the off-diagonal terms. If an element is connected to
ground, it only appears along the diagonal; a non-grounded (e.g. R2) appears
both on and off the diagonal). The rest of the terms in the **A**
matrix (the non-highlighted portion) contains only ones, negative ones and
zeros. Note also that the matrix size is 5x5 (in general (*m+n*)x(*m+n*)).
For all of the circuits we will analyze (i.e., only passive elements and
independent sources), these general observations about the **A** matrix will
always hold.

Now consider the **x** matrix, the matrix of unknown quantities. It
is a 1x5 matrix (in general 1x(*n+m*)).
The topmost 3 (in general *n*) elements are simply the node voltages.
The bottom 2 (in general *m*) elements are the currents associated with the
voltage sources.

This brings us to the **z** matrix that contains only known
quantities. It is also a 5x1 matrix
(in general (*n+m*)x1). The
topmost 3 (in general *n*) elements are either zero, or the sum of
independent current sources (see example 3 for an case
in point). The bottom 2 (in general *m*) elements are the independent
voltage sources.

MNA applied to a circuit with only passive elements (resistors) and independent current and voltage sources results in a matrix equation of the form:

For a circuit with

nnodes andmindependent voltage sources:

- The
Amatrix:

- is (
n+m)x(n+m) in size, and consists only of known quantities.- the
nxnpart of the matrix in the upper left:

- has only passive elements
- elements connected to ground appear only on the diagonal
- elements not connected to ground are both on the diagonal and off-diagonal terms.
- the rest of the
Amatrix (not included in thenxnupper left part) contains only 1, -1 and 0 (other values are possible if there are dependent current and voltage sources; I have not considered these cases. Consult Litovski if interested.)- The
xmatrix:

- is an (
n+m)x1 vector that holds the unknown quantities (node voltages and the currents through the independent voltage sources).- the top
nelements are thennode voltages.- the bottom
melements represent the currents through themindependent voltage sources in the circuit.- The
zmatrix:

- is an (
n+m)x1 vector that holds only known quantities- the top
nelements are either zero or the sum and difference of independent current sources in the circuit.- the bottom
melements represent themindependent voltage sources in the circuit.The circuit is solved by a simple matrix manipulation:

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

In the next page we will use these observations to describe an algorithm for generating the matrices automatically.