bitGateLab Analog · Learn
English
Open the simulator

Learn › Topic 4

Nodal and Mesh Analysis Step by Step, with a Worked Example

8 min read · bitGateLab Team

When a circuit can no longer be reduced with series and parallel combinations, applying Kirchhoff's laws "by hand", branch by branch, gets messy. Nodal analysis and mesh analysis are two systematic recipes that always work: you choose a few unknowns, write one equation for each and solve the system. Here you'll learn both methods, how to write the equations almost by inspection and how to solve a complete three-node example.

The idea behind nodal analysis

Instead of looking for each current, you look for the node voltages: the voltage of each node with respect to one you choose as the reference (ground, 0 V). Once you know all the node voltages, any current follows from Ohm's law: the current in a resistor between nodes a and b is (Va − Vb) / R.

The procedure is:

  1. Choose the reference node; usually the one with the most connections or the negative terminal of the main source.
  2. Label the other nodes: V1, V2, …. If there are n nodes, you will have n − 1 unknowns.
  3. At each node, write KCL: the sum of the currents leaving through the resistors equals the sum of the currents the sources inject into the node.
  4. Solve the system and calculate whatever currents you need.

A three-node example

The circuit in the figure has three nodes besides ground. A current source IA = 9 mA injects current into node 1 and another, IB = 2 mA, into node 3. The resistors are: R12 = 1 kΩ and R23 = 1 kΩ between nodes, and to ground R1 = 2 kΩ, R2 = 3 kΩ and R3 = 1 kΩ.

1 2 3 1 kΩ 1 kΩ 2 kΩ 3 kΩ 1 kΩ 9 mA 2 mA
Three-node circuit. The arrows on the sources show that they inject current into nodes 1 and 3; the bottom node is the reference.

Example 1. Find V1, V2 and V3. Work in volts, kΩ and mA to avoid powers of ten (1/kΩ = mS).

  1. Node 1: current leaves to ground through 2 kΩ and toward node 2 through 1 kΩ; 9 mA flows in. V1/2 + (V1 − V2)/1 = 9, that is, 1.5 V1 − V2 = 9.
  2. Node 2: current leaves toward node 1, toward node 3 and to ground through 3 kΩ; there is no source. (V2 − V1)/1 + (V2 − V3)/1 + V2/3 = 0. Multiply by 3: −3 V1 + 7 V2 − 3 V3 = 0.
  3. Node 3: current leaves toward node 2 and to ground through 1 kΩ; 2 mA flows in. (V3 − V2)/1 + V3/1 = 2, that is, −V2 + 2 V3 = 2.
  4. From equation 1: V1 = 6 + (2/3) V2. From equation 3: V3 = 1 + V2/2.
  5. Substitute into equation 2: −3(6 + 2V2/3) + 7V2 − 3(1 + V2/2) = 0 → −18 − 2V2 + 7V2 − 3 − 1.5V2 = 0 → 3.5 V2 = 21.
  6. V2 = 6 V, V1 = 6 + 4 = 10 V, V3 = 1 + 3 = 4 V.

Currents. R12: (10 − 6)/1 = 4 mA from node 1 to node 2. R23: (6 − 4)/1 = 2 mA from node 2 to node 3. To ground: 10/2 = 5 mA, 6/3 = 2 mA and 4/1 = 4 mA.

KCL check. Node 1: 9 in, 5 + 4 = 9 out. Node 2: 4 in, 2 + 2 = 4 out. Node 3: 2 + 2 = 4 in, 4 out. Correct.

Matrix form: writing the equations by inspection

If the circuit has only resistors and current sources, the system has the form G · V = I and can be written without thinking about signs:

For the example, in mS and mA:

| 1.5    −1      0 | |V1|   | 9 |
| −1    2.333   −1 | |V2| = | 0 |
|  0     −1      2 | |V3|   | 2 |

The matrix is symmetric, a good sign that you made no mistakes. This is the same kind of system a circuit simulator solves internally when it runs a DC analysis. If there is a voltage source between a node and ground, that node voltage is already known and drops out as an unknown; if the source sits between two nodes, they are grouped into a supernode.

Mesh analysis

The dual method uses mesh currents as the unknowns: a fictitious current that circulates around each mesh, clockwise by convention. The actual current in a shared branch is the difference between the two mesh currents that flow through it. For each mesh you write KVL.

By inspection: on the diagonal goes the sum of the resistances in the mesh, off the diagonal the negative of the shared resistance, and on the right-hand side the sum of the voltage sources that push in the direction of the mesh current.

Example 2. Left mesh: a 10 V source (positive at the top) in the left branch and R1 = 1 kΩ in the top segment. Shared middle branch: R2 = 2 kΩ. Right mesh: R3 = 1 kΩ in the top segment and R4 = 1 kΩ in the right branch. Find the currents.

  1. Mesh 1 (I1, clockwise): (1 + 2) I1 − 2 I2 = 10.
  2. Mesh 2 (I2, clockwise): −2 I1 + (2 + 1 + 1) I2 = 0, so I1 = 2 I2.
  3. Substitute: 3(2I2) − 2I2 = 10 → 4I2 = 10 → I2 = 2.5 mA and I1 = 5 mA.
  4. Actual current in R2: I1 − I2 = 2.5 mA downward, with 2.5 × 2 = 5 V across its terminals.
  5. Check by another route: R3 + R4 = 2 kΩ is in parallel with R2 (1 kΩ equivalent), in series with R1: 10 V / 2 kΩ = 5 mA. It matches I1.

Which one should you use? Count the unknowns. Nodal analysis needs n − 1 equations (nodes minus one); mesh analysis needs b − n + 1 (branches minus nodes plus one). Choose whichever gives fewer. With current sources, nodal analysis usually wins; with voltage sources in series, mesh analysis does.

Common mistakes

Try it in the simulator

The simulator's DC analysis shows the node voltages directly, so it is the quickest way to check your system of equations.

  1. Place two DC current sources, of 9 mA and 2 mA, pointing toward nodes 1 and 3.
  2. Place the five resistors and connect them as in the figure, with the bottom node grounded.
  3. Run the DC analysis and look at the voltages at the three nodes: they should be 10 V, 6 V and 4 V.
  4. Measure the current in R12 and R23 with the multimeter.
  5. Change IB to 0 mA and compare with Exercise 1.

Exercises

  1. In the three-node example, turn off the source IB (0 mA). Find V1, V2 and V3.

    Show answer

    Equation 3 is now −V2 + 2V3 = 0, so V3 = V2/2. Substituting: −18 − 2V2 + 7V2 − 1.5V2 = 0 → V2 = 18/3.5 = 36/7 ≈ 5.143 V. Then V1 = 6 + (2/3)(5.143) ≈ 9.429 V and V3 ≈ 2.571 V.

  2. In the mesh example, you change the source to 20 V. What are I1 and I2?

    Show answer

    The circuit is linear: everything doubles. I1 = 10 mA, I2 = 5 mA.

  3. A circuit has 5 nodes (counting ground) and 7 branches. How many equations do you need with each method?

    Show answer

    Nodal: 5 − 1 = 4 equations. Mesh: 7 − 5 + 1 = 3 equations. Mesh analysis is the better choice.

  4. To the mesh example, add a 6 V source in the right branch whose polarity pushes I2 clockwise. Find I1, I2 and the current in R2.

    Show answer

    Equations: 3I1 − 2I2 = 10 and −2I1 + 4I2 = 6. From the second, I1 = 2I2 − 3. Substituting: 6I2 − 9 − 2I2 = 10 → I2 = 4.75 mA, I1 = 6.5 mA. In R2: 6.5 − 4.75 = 1.75 mA downward.

To simplify large networks as seen from a load, continue with Thévenin, Norton and superposition. If you need a refresher, go back to Kirchhoff's laws.