3  Modified Nodal Analysis

In 1975, Ho, Ruehli, and Brennan (1975) published a paper titled, The Modified Nodal Approach to Network Analysis. This was the original scholarly paper on the subject. The analysis method they presented allows for the ability to process voltage sources and current-dependent circuit elements in a simple and efficient manner. The paper describes the formulation of the matrices, the use of stamps and a pivot ordering strategy. The authors compare their algorithm to the tableau method, a circuit analysis technique, which was an analysis technique being described in scholarly papers at the time. At the time of this publication, the authors were affiliated with the IBM Thomas J. Watson Research Center in Yorktown Heights, N.Y.

The development of MNA was driven by the critical need for efficient circuit equation formulation in computer-aided design programs, particularly for integrated circuits. While the traditional nodal approach offered flexibility and efficiency for manual analysis, its inherent limitations—especially concerning the treatment of voltage sources and current-dependent elements—demanded a more generalized and computationally friendly method. This highlights a pattern of industry-driven innovation; the practical demands of integrated circuit design within a leading industrial research center directly spurred this fundamental analytical advancement.

The timing of MNA’s publication in 1975 was opportune, coinciding with the maturation of digital computing capabilities, which enabled its rapid and widespread adoption as the computational infrastructure became ready to fully leverage its algorithmic advantages. If MNA had been proposed much earlier, the computational resources might not have been sufficient to efficiently handle the large matrices generated. By 1975, digital computers had advanced to a point where MNA’s sophisticated matrix operations and iterative solutions became practically feasible and efficient. This technological readiness allowed MNA’s inherent algorithmic advantages to be fully exploited, leading to its rapid integration into circuit simulation software and its eventual dominance.

Circuit analysis and theory are fundamental to electrical engineering and is usually one of the first topics taught to electrical engineering students. The purpose of this book is to describe a circuit analysis method called Modified Nodal Analysis (MNA) implemented in Python and using the SymPy library.

Consider the example circuit shown in Figure 3.1. This circuit has five branches and three nodes. There is a voltage source \(V_1\), which drives the circuit and each of the nodes is labeled along with the ground node.

Figure 3.1: Modified naodal analysis example circuit.

For this circuit, the MNA procedure generates the following system of equations:

\(I_{V1} + \frac{v_{1}}{R_{1}} - \frac{v_{2}}{R_{1}} = 0\)
\(I_{L1} + v_{2} \left(C_{2} s + \frac{1}{R_{1}}\right) - \frac{v_{1}}{R_{1}} = 0\)
\(C_{1} s v_{3} - I_{L1} = 0\)
\(v_{1} = V_{1}\)
\(- I_{L1} L_{1} s + v_{2} - v_{3} = 0\)

where, \(s\) is the Laplace variable, \(C_1\) and \(C_2\) are capacitors, \(R_1\) is a resistor, \(L_1\) is an inductor, \(v_1\), \(v_2\) and \(v_3\) are the unknown node voltages, \(V_1\) is the input voltage source, \(I_{V1}\) is the unknown current flowing through \(V_1\) and \(I_{L1}\) is the unknown current flowing in \(L_1\).

The first of theses five equations is the KVL equation for node 1, where current through \(R_1\) is equal to the current from \(V_1\). The second equation describes the current flowing from branches connected to node 2. For node 2, the unknown current in \(L_1\) is assigned to \(I_{L1}\). The third equation describes the current flowing from the branches into node 3. The fourth equations just says that the voltage at node 2 is equal to \(V_1\). The last equation describes the current in \(L_1\). There are five network equations in total, but one of the equations, \(v_1=V_1\) is trivial.

Solving this set of equations is easily accomplished by using a computer with MATLAB, Python with NumPy, an on-line matrix calculator or a modern graphical calculator that has matrix algebra capabilities. Inverting a 4 by 4 matrix by hand is probably the largest matrix that would be attempted given the numerous modern calculating tools available.

These equations can be solved by the afore mentioned tools to obtain the unknown voltages and currents as either numerical or analytic expressions. The analytical expression for the unknown voltages and currents are displayed below.

\(v_{1} = V_{1}\)
\(v_{2} = \frac{C_{1} L_{1} V_{1} s^{2} + V_{1}}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)
\(v_{3} = \frac{V_{1}}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)
\(I_{V1} = \frac{- C_{1} C_{2} L_{1} V_{1} s^{3} - C_{1} V_{1} s - C_{2} V_{1} s}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)
\(I_{L1} = \frac{C_{1} V_{1} s}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)

In the following chapters, Python will be used to automatically generate and solve circuit analysis problems using Python, SymPy, NumPy and SciPy.

3.1 Pros and Cons of MNA

The MNA approach is a suitable technique for hand analysis of small circuits as well as for computer analysis of larger circuits using the same algorithm as illustrated in this book. One disadvantage of the MNA technique is that often additional equations are generated, when a smaller number would be sufficient. For students doing homework problems and solving sets of equations by hand, the extra equation or two, generated by the MNA technique makes matrix inversions much harder.

For example, the circuit in Figure 3.1, can be described by the following two mesh equations:

\(\displaystyle L_{1} s \left(i_{1} - i_{2}\right) + R_{1} i_{1} + \frac{i_{1} - i_{2}}{C_{1} s} = V_{1}\)

\(\displaystyle L_{1} s \left(- i_{1} + i_{2}\right) + \frac{i_{2}}{C_{2} s} + \frac{- i_{1} + i_{2}}{C_{1} s} = 0\)

where \(i_1\) and \(i_2\) are the unknown currents.

The MNA procedure generated five equations (but one of them was trivial) to find the node voltages, whereas only two equations are need to be solved to find the mesh currents, which are:

\(i_{1} = \frac{C_{1} C_{2} L_{1} V_{1} s^{3} + C_{1} V_{1} s + C_{2} V_{1} s}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)
\(i_{2} = \frac{C_{1} C_{2} L_{1} V_{1} s^{3} + C_{2} V_{1} s}{C_{1} C_{2} L_{1} R_{1} s^{3} + C_{1} L_{1} s^{2} + C_{1} R_{1} s + C_{2} R_{1} s + 1}\)

Modern pocket scientific calculators that engineering students now use can solve sets of linear equations relatively easily. However, some effort is required to enter the equations into the calculator.

When a computer is used to generate the schematic for a circuit and the net list is exported to the Python code, the extra equations that the MNA approach generates is not a practical concern. Using the examples in this book as templates for problem solving makes the work flow very easy, which is the main benefit of using MNA.

3.2 Summary