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:
- Choose the reference node; usually the one with the most connections or the negative terminal of the main source.
- Label the other nodes: V1, V2, …. If there are n nodes, you will have n − 1 unknowns.
- 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.
- 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Ω.
Example 1. Find V1, V2 and V3. Work in volts, kΩ and mA to avoid powers of ten (1/kΩ = mS).
- 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.
- 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.
- 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.
- From equation 1: V1 = 6 + (2/3) V2. From equation 3: V3 = 1 + V2/2.
- 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.
- 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:
- On the diagonal (G11, G22, …) goes the sum of the conductances connected to that node.
- Off the diagonal (G12, …) goes the negative of the conductance that joins those two nodes.
- The right-hand vector holds the current the sources inject into each node.
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.
- Mesh 1 (I1, clockwise): (1 + 2) I1 − 2 I2 = 10.
- Mesh 2 (I2, clockwise): −2 I1 + (2 + 1 + 1) I2 = 0, so I1 = 2 I2.
- Substitute: 3(2I2) − 2I2 = 10 → 4I2 = 10 → I2 = 2.5 mA and I1 = 5 mA.
- Actual current in R2: I1 − I2 = 2.5 mA downward, with 2.5 × 2 = 5 V across its terminals.
- 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
- Writing some currents as "leaving" and others as "entering" at the same node without sticking to the convention you chose.
- In matrix form, making the conductance between nodes positive off the diagonal.
- Forgetting the shared resistance when adding up the diagonal term of a mesh.
- Confusing mesh current with branch current in the shared branches.
- Leaving units mixed (ohms with milliamperes); pick one system, such as V, kΩ and mA, and stick to it.
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.
- Place two DC current sources, of 9 mA and 2 mA, pointing toward nodes 1 and 3.
- Place the five resistors and connect them as in the figure, with the bottom node grounded.
- Run the DC analysis and look at the voltages at the three nodes: they should be 10 V, 6 V and 4 V.
- Measure the current in R12 and R23 with the multimeter.
- Change IB to 0 mA and compare with Exercise 1.
Exercises
-
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.
-
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.
-
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.
-
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.