DC circuits: Kirchhoff's laws, mesh and nodal analysis

KCL and KVL with the passive sign convention, mesh and nodal analysis including supermesh, supernode and dependent sources, with a mesh example and a GATE-level nodal example.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Every sensor interface, motor driver and PLC input card in a mechatronic system is, at DC, a network of sources and resistors. Kirchhoff's laws together with mesh and nodal analysis let you find any current or voltage in such a network systematically, instead of guessing which resistors are "in series". They are also the foundation for every later topic: network theorems, AC phasor analysis and transistor biasing all reduce to KCL and KVL.

Key ideas

Circuit vocabulary. A node is a point where two or more elements meet; an essential node joins three or more. A branch is a single path between two nodes. A loop is any closed path; a mesh is a loop that encloses no other loop (a "window" of a planar circuit). For a connected circuit with b branches and n nodes there are n − 1 independent KCL equations and b − n + 1 independent KVL (mesh) equations.

Kirchhoff's Current Law (KCL). The algebraic sum of currents at any node is zero: current in = current out. It follows from conservation of charge, assuming no charge accumulates at the node (true for lumped circuits). KCL also holds for any closed surface (a "supernode").

Kirchhoff's Voltage Law (KVL). The algebraic sum of voltages around any closed loop is zero. It follows from conservation of energy: a charge carried round a loop returns to its starting potential. Valid for lumped circuits where changing magnetic flux is not linking the loop.

Sign convention (passive sign convention). Choose a current direction in each element. Current enters the + terminal of a resistor, so the drop across it in the direction of current is I·R. When walking round a loop, a voltage rise (− to + of a source) and a drop (+ to −) take opposite signs. If a computed current is negative, the actual current flows opposite to the assumed arrow; you do not redo the problem.

Mesh analysis (uses KVL).

  1. Check the circuit is planar. Assign a clockwise mesh current to every mesh.
  2. In a branch shared by two meshes the branch current is the difference of the two mesh currents (both clockwise means they flow in opposite directions there).
  3. Write KVL for each mesh and solve the simultaneous equations.
  4. A current source on the outer boundary fixes that mesh current directly. A current source shared by two meshes needs a supermesh: write KVL round the combined loop that avoids the source, plus the constraint equation I_a − I_b = I_s.

Nodal analysis (uses KCL).

  1. Pick a reference (ground) node, usually the one with most branches.
  2. Label the remaining n − 1 node voltages.
  3. At each non-reference node write "sum of currents leaving = 0", expressing each resistor current as (V_node − V_other)/R.
  4. A voltage source between a node and ground fixes that node voltage. A voltage source between two non-reference nodes forms a supernode: apply KCL to the closed surface around both nodes plus the constraint V_a − V_b = V_s.

Dependent (controlled) sources. VCVS, VCCS, CCVS and CCCS model transistors and op-amps. Treat them like independent sources when writing equations, then add one extra equation expressing the controlling variable in terms of the unknowns. The resulting coefficient matrix is no longer symmetric.

Choosing a method. Count equations: mesh needs b − n + 1, nodal needs n − 1 (minus one for each voltage source to ground). A current source in an outer branch fixes a mesh current and removes a mesh unknown; a voltage source to ground fixes a node voltage and removes a nodal unknown. Pick the method with fewer remaining unknowns. Nodal analysis works for non-planar circuits too and is what SPICE uses.

Series and parallel shortcuts. Series resistors add; parallel conductances add. Voltage divider and current divider rules come straight from KVL and KCL and save time on small sub-circuits.

Formulas

Σ I_entering = Σ I_leaving (KCL at a node or closed surface)

  • I: branch current (A). Applies to lumped circuits at any instant.

Σ V = 0 around any closed loop (KVL)

  • V: voltage rise or drop across each element (V), with consistent signs.

V = I·R

  • V: voltage across resistor (V); I: current through it (A); R: resistance (Ω).

R_eq = R1 + R2 + … (series); 1/R_eq = 1/R1 + 1/R2 + … (parallel)

V_k = V_s · R_k / (R1 + R2 + …) (voltage divider, series resistors only)

  • V_s: total voltage across the series string (V); V_k: voltage across R_k (V).

I_1 = I_s · R2 / (R1 + R2) (current divider, two parallel resistors)

  • I_s: total current entering the pair (A); I_1: current in R1 (A).

P = V·I = I²·R = V²/R

  • P: power (W). Power absorbed is positive with the passive sign convention.

Number of mesh equations = b − n + 1; Number of nodal equations = n − 1

  • b: number of branches; n: number of nodes.

Worked examples

Example 1 (standard: mesh analysis). A 10 V source (positive terminal up) in the left mesh feeds R1 = 2 Ω to node A. R3 = 4 Ω connects node A to the bottom (ground) rail and is shared by both meshes. From node A, R2 = 3 Ω leads to a 5 V source (positive terminal up) in the right mesh, whose negative terminal returns to ground. Find all branch currents and the voltage of node A.

  1. Assign clockwise mesh currents I1 (left) and I2 (right). Current in R3 (downward) = I1 − I2.
  2. Mesh 1 KVL: rise of 10 V equals drops: 10 = 2·I1 + 4·(I1 − I2), so 6·I1 − 4·I2 = 10.
  3. Mesh 2 KVL (clockwise: through R2 to the right, down through the 5 V source from + to −, up through R3): 3·I2 + 5 + 4·(I2 − I1) = 0, so −4·I1 + 7·I2 = −5.
  4. Determinant = 6 × 7 − (−4)(−4) = 42 − 16 = 26.
  5. I1 = [10 × 7 − (−4)(−5)] / 26 = (70 − 20)/26 = 50/26 = 1.923 A.
  6. I2 = [6 × (−5) − (−4)(10)] / 26 = (−30 + 40)/26 = 10/26 = 0.385 A.
  7. Current in R3 = I1 − I2 = 40/26 = 1.538 A downward; V_A = 4 Ω × 1.538 A = 6.154 V.
  8. Nodal cross-check: (10 − 6.154)/2 = 1.923 A in R1 and (6.154 − 5)/3 = 0.385 A in R2, which agree.

I1 = 1.92 A, I2 = 0.385 A (flowing into the + terminal of the 5 V source, so that source is absorbing power), I_R3 = 1.54 A, V_A = 6.15 V.

Example 2 (GATE level: nodal analysis with a dependent source). A 2 A independent current source injects current into node 1. R_a = 4 Ω connects node 1 to ground, R_b = 2 Ω connects node 1 to node 2, and R_c = 6 Ω connects node 2 to ground. A voltage-controlled current source injects 0.25·V1 (A, with V1 in volts) into node 2 from ground. Find V1, V2 and the power delivered by the dependent source.

  1. KCL at node 1 (currents leaving = current injected): V1/4 + (V1 − V2)/2 = 2, so 0.75·V1 − 0.5·V2 = 2.
  2. KCL at node 2: (V2 − V1)/2 + V2/6 = 0.25·V1, so −0.75·V1 + 0.6667·V2 = 0, giving V2 = 1.125·V1.
  3. Substitute in step 1: 0.75·V1 − 0.5 × 1.125·V1 = 0.1875·V1 = 2, so V1 = 10.667 V.
  4. V2 = 1.125 × 10.667 = 12.0 V.
  5. Check at node 2: current in R_c = 12/6 = 2.0 A; current from node 1 to node 2 = (10.667 − 12)/2 = −0.667 A; dependent source = 0.25 × 10.667 = 2.667 A. Leaving node 2: 2.0 + 0.667 = 2.667 A, which matches.
  6. Power delivered by the dependent source = V2 × 0.25·V1 = 12 × 2.667 = 32.0 W.

V1 = 10.67 V, V2 = 12.0 V; the dependent source delivers 32.0 W.

Common mistakes

  • Writing the shared-branch current as I1 + I2 when both mesh currents are clockwise; they oppose each other in the shared branch, so it is I1 − I2 (or I2 − I1).
  • Mixing "rise" and "drop" signs part-way round a loop. Fix one rule and keep it for every element in that loop.
  • Treating a negative answer as an error. It only means the true direction is opposite to the assumed arrow.
  • Writing a KCL equation at the reference node or one too many mesh equations; the extra equation is dependent and gives a singular system.
  • Forgetting the constraint equation for a supernode or supermesh, or writing KVL through a current source (its voltage is unknown).
  • Dropping the controlling-variable equation for a dependent source, or "switching off" a dependent source as if it were independent.
  • Applying the voltage divider to resistors that are not truly in series (a branch leaves the node between them).

For GATE ME

Expect short numericals: find a node voltage or branch current in a two- or three-node resistive network, power delivered or absorbed by a source (watch the sign), circuits with a current source that need a supermesh, or a voltage source that needs a supernode, and simple dependent-source circuits. Practise writing equations quickly in matrix form and solving 2 × 2 and 3 × 3 systems by Cramer's rule on the calculator. Always do a one-line KCL or power-balance check before marking.

Quick check

  1. A node has 3 A and 2 A entering and one other branch. What current flows in that branch, and in which direction?
  2. A circuit has 6 branches and 4 nodes. How many independent mesh equations are there?
  3. Two clockwise mesh currents are 5 A and 2 A. What is the current in their shared resistor?
  4. When is a supernode needed?
  5. In nodal analysis, a 12 V source is connected between node A and ground. How many unknowns does node A contribute?

Answers: 1. 5 A leaving the node. 2. b − n + 1 = 6 − 4 + 1 = 3. 3. 3 A, in the direction of the 5 A mesh current. 4. When a voltage source connects two non-reference nodes. 5. None; V_A = 12 V is known.

Try answering each one aloud before you open it.

  1. 1.What is Kirchhoff's Current Law (KCL) and how is it applied in DC circuits?Concept

    Kirchhoff's Current Law (KCL) states that the total current entering a junction in a circuit equals the total current leaving the junction. This is based on the principle of conservation of charge. In DC circuits, KCL is used to analyze the flow of current at any node, ensuring that the sum of currents entering and leaving the node is zero.

  2. 2.Explain Kirchhoff's Voltage Law (KVL) and its significance in circuit analysis.Concept

    KVL states that the algebraic sum of all voltage rises and drops around any closed loop is zero. It is a statement of energy conservation: a charge taken round a loop returns to the same potential. It is the basis of mesh analysis, the voltage-divider rule and every loop equation you write, and it holds for lumped circuits where no changing magnetic flux links the loop.

  3. 3.What is mesh analysis and how is it used in solving DC circuits?Concept

    Mesh analysis assigns a circulating current (usually clockwise) to each mesh of a planar circuit, writes KVL around each mesh, and solves the resulting b − n + 1 simultaneous equations. The current in a branch shared by two meshes is the difference of the two mesh currents. A current source on the boundary fixes a mesh current directly; one shared by two meshes is handled with a supermesh plus a constraint equation. It applies only to planar circuits.

  4. 4.Describe nodal analysis and its application in DC circuit analysis.Concept

    Nodal analysis is a technique used to determine the voltage at various nodes in a circuit. It involves applying KCL at each node, except the reference node, to set up a system of equations. Solving these equations provides the node voltages, which can then be used to find branch currents.

  5. 5.Why is mesh analysis preferred over nodal analysis in certain circuits?Application

    You pick the method that gives fewer unknowns. Mesh analysis needs b − n + 1 equations and nodal analysis needs n − 1, so a circuit with few meshes but many nodes (for example a long series-parallel ladder with few windows) favours mesh analysis. Current sources in outer branches also reduce mesh unknowns, while voltage sources to ground reduce nodal unknowns. Mesh analysis cannot be used on non-planar circuits, where nodal analysis is the only choice.

  6. 6.What happens if a resistor in a DC circuit is short-circuited? How does it affect the circuit analysis?Application

    If a resistor is short-circuited, it effectively has zero resistance, causing the current to bypass the resistor entirely. This can lead to an increase in current through the shorted path and potentially alter the voltage distribution in the circuit. In circuit analysis, the short-circuited resistor is treated as a wire with zero resistance.

  7. 7.How does the presence of a dependent source affect the application of Kirchhoff's laws?Application

    KCL and KVL still apply unchanged; you write the dependent source into the equations exactly like an independent source. The extra step is one constraint equation expressing its controlling voltage or current in terms of the chosen unknowns (mesh currents or node voltages). The coefficient matrix then loses its symmetry, and unlike an independent source a dependent source must never be set to zero during superposition or Thevenin analysis.

  8. 8.Calculate the current through a 10 Ω resistor in a simple series circuit with a 20 V battery and a total resistance of 30 Ω.Numerical

    To find the current, use Ohm's Law: I = V / R. Here, V = 20 V and R = 30 Ω. So, I = 20 V / 30 Ω = 0.67 A. The current through the 10 Ω resistor is 0.67 A, as it is a series circuit and the current is the same through all components.

  9. 9.In a circuit with two loops, if the clockwise mesh currents are I1 = 2 A and I2 = 3 A, what is the current through a resistor shared by both loops?Numerical

    When both mesh currents are drawn clockwise, they flow in opposite directions through the shared branch, so the branch current is their difference: 3 A − 2 A = 1 A. It flows in the direction of the larger mesh current, I2. If the two mesh currents were drawn so that they flowed the same way through the shared branch, the branch current would be their sum, 5 A.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?