Nodal Circuit Analysis


Background: This page provides a visual representation of nodal circuit analysis applied to simple circuits.

Sample Circuits:
Circuit Components: Wire Resistor Current Source Ground
Circuit Tools: Probe Examine Eraser  
Drawing Properties:   Node Coloring: Voltage Depiction: Nodes Wires None

Not Supported

Introduction: This application demonstrates the evaluation of a circuit using nodal circuit analysis. The application provides a design interface for constructing a circuit, and an algorithm to identify and color-code nodes; apply node voltage analysis to the circuit; and identify node voltages.

Directions: A circuit can be designed on the grid below using the following tools:

More Info:

Circuits that involve only resistors and constant current sources can be algorithmically evaluated using mesh voltage analysis to determine the voltages around the circuit. This technique involves identifying nodes within the circuit; constructing a conductance matrix that relates the set of resistors to the currents flowing through each node; and solving the matrix to determine the voltage of each node.

Nodal circuit analysis is performed whenever the circuit is altered. The results are displayed as color-coded nodes, where the voltage of each node is indicated by ripples (propagating outward for positive voltage, and inward for negative voltage). The elements of the circuit can be examined to determine the voltages of the nodes, as well as the voltage, current, and power consumed by each resistor.

A few notes about the output:

The most difficult part of this project was simply identifying the segments and coordinates that comprise each node. The following process was devised for this task:
  1. The circuit is represented as a three-dimensional array of grid segments, represented by x-coordinate, y-coordinate, and orientation (0 = horizontal, 1 = vertical). Each element of the array stores the component type, orientation (important for voltage sources), and value (resistance or voltage supplied). This matrix is also constructed with an extra, invisible segment beyond the boundary: i.e., the (n x n circuit shown is modeled as n+2 x n+2 circuit elements, with the edges not drawn or selectable). This model permits the outermost segments to remain empty, and extensively reduces bounds-checking during the following steps.

  2. Starting with the coordinate to which the ground is attached, a trace is performed through all of the connected wire segments, ending with each resistor or current source. All of the wires and coordinates identified in this trace are identified as node 0.

  3. Starting from the top-left, the schematic is scanned to identify every wire segment that is not yet associated with any node. When an unassigned wire segment is found, a trace is performed, as above, to add the network of connected wire segments to the node. This process continues until all wire segments have been assigned to some node.

  4. A conductance matrix is created by evaluating each resistor and determining the nodes to which the wires at each end of the resistor are assigned (presuming that they are different; if not, then the resistor is shorted and does not function - see above). Also, each current source is examined to determine the nodes to which the wire at each of the current source is assigned.

  5. The conductance matrix is solved, via Cramer's Rule and expansion of minors - which is not even remotely optimized or performant (hence the limited scalability to larger circuits), but could be easily replaced with more efficient algorithms. The matrix solution indicates the voltage of each node.
One area that could be added to this demonstration: the direction and rate of current flow through each segment. However, this task is difficult because the model presumes that the individual segments have no resistance (otherwise, they would constitute different nodes). A complex network of segments can therefore have multiple equivalent solutions, and while one can be chosen arbitrarily, it just seems like a bad idea that generates unlikely and unexpected results - and is outside the scope of this project.

More Engineering Applications

(C) 2015, David Stein. All rights reserved.