Kirchhoff’s Law

← Numerical Methods

Source inspiration: (Mathew 2000-2019).

Background

Kirchhoff’s voltage law (KVL) states that the algebraic sum of voltage drops around any closed loop is zero. Using loop currents, resistor networks lead directly to linear systems. The examples below are Mathews’ Examples 1, 3, 5 and 6; his Examples 2 and 4 solve networks #1 and #2 again with other values and are not repeated here.

NoteDefinition - KVL Loop Equation

For each loop, \[ \sum (R\,I) = \sum E, \tag{1} \] where \(R\,I\) is the drop across each resistor in the loop, \(I\) being the net current through that resistor (the sum or difference of the loop currents sharing it), and \(E\) are the source voltages in the loop, each counted positive when it drives current in the direction of the loop current.

A resistor in only loop \(j\) carries \(i_j\) and contributes \(r\) to the diagonal entry \((j,j)\). A resistor \(r\) shared by loops \(j\) and \(k\) contributes \(r\) to both diagonal entries \((j,j)\) and \((k,k)\), and \(+r\) to the off-diagonal entries \((j,k)\) and \((k,j)\) when both loop currents pass through it in the same direction, \(-r\) when they pass through it in opposite directions. The signs of the off-diagonal entries therefore depend on the orientation chosen for each loop current.

Collecting all loop equations gives

\[ A\mathbf{i}=\mathbf{b}, \tag{2} \]

with unknown loop-current vector \(\mathbf{i}\).

Network #1 (Two Loops)

Network #1 has one source \(e_1\) and two loops side by side. Loop 1 (left) contains \(e_1\), \(r_1\) (top), \(r_5\) (bottom) and the middle resistor \(r_3\); loop 2 (right) contains \(r_2\) (top), \(r_4\) (right), \(r_6\) (bottom) and \(r_3\). Both loop currents are taken clockwise, so they pass through the shared resistor \(r_3\) in opposite directions (\(i_1\) downward, \(i_2\) upward) and the off-diagonal entries are \(-r_3\):

\[ \begin{aligned} (r_1+r_3+r_5)i_1-r_3i_2&=e_1,\\ -r_3i_1+(r_2+r_3+r_4+r_6)i_2&=0. \end{aligned} \tag{3} \]

Example 1

Given

\[ r_1=10,\; r_2=10,\; r_3=10,\; r_4=20,\; r_5=10,\; r_6=30,\; e_1=20. \]

Step 1: Substitute into (3):

\[ \begin{aligned} 30i_1-10i_2&=20,\\ -10i_1+70i_2&=0. \end{aligned} \]

Step 2: Matrix form and solve:

\[ \begin{pmatrix} 30 & -10\\ -10 & 70 \end{pmatrix} \begin{pmatrix} i_1\\ i_2 \end{pmatrix} = \begin{pmatrix} 20\\0 \end{pmatrix} \quad\Longrightarrow\quad \begin{pmatrix} i_1\\ i_2 \end{pmatrix} = \begin{pmatrix} \tfrac{7}{10}\\[2pt]\tfrac{1}{10} \end{pmatrix}. \]

So

\[ i_1=0.7,\qquad i_2=0.1. \]

Verification:

Loop equation Left side Right side
\(30i_1-10i_2=20\) \(30(0.7)-10(0.1)=20\) \(20\ \checkmark\)
\(-10i_1+70i_2=0\) \(-10(0.7)+70(0.1)=0\) \(0\ \checkmark\)

Network #2 (Three Loops, One Source)

Network #2 has one source \(e_1\) and three loops in a row. Loop 1 contains \(e_1\), \(r_1\), \(r_7\) and \(r_4\); loop 2 contains \(r_2\), \(r_8\) and the shared resistors \(r_4\) (with loop 1) and \(r_5\) (with loop 3); loop 3 contains \(r_3\), \(r_6\), \(r_9\) and \(r_5\). All three loop currents are taken clockwise, so adjacent loop currents pass through each shared resistor in opposite directions and the off-diagonal entries are \(-r_4\) and \(-r_5\); loops 1 and 3 share no resistor, so their entries are zero:

\[ \begin{aligned} (r_1+r_4+r_7)i_1-r_4i_2&=e_1,\\ -r_4i_1+(r_2+r_4+r_5+r_8)i_2-r_5i_3&=0,\\ -r_5i_2+(r_3+r_5+r_6+r_9)i_3&=0. \end{aligned} \tag{4} \]

Example 2

Given

\[ \begin{aligned} r_1=r_2=r_3=r_4=r_7=r_8=r_9&=10,\\ r_5=r_6&=20,\\ e_1&=36. \end{aligned} \]

Step 1: Substitute into (4):

\[ \begin{aligned} 30i_1-10i_2&=36,\\ -10i_1+50i_2-20i_3&=0,\\ -20i_2+60i_3&=0. \end{aligned} \]

Step 2: Solve

\[ \begin{pmatrix} i_1\\ i_2\\ i_3 \end{pmatrix} = \begin{pmatrix} \tfrac{13}{10}\\[2pt] \tfrac{3}{10}\\[2pt] \tfrac{1}{10} \end{pmatrix} = \begin{pmatrix} 1.3\\0.3\\0.1 \end{pmatrix}. \]

Verification:

Loop equation Left side Right side
\(30i_1-10i_2=36\) \(30(1.3)-10(0.3)=36\) \(36\ \checkmark\)
\(-10i_1+50i_2-20i_3=0\) \(-13+15-2=0\) \(0\ \checkmark\)
\(-20i_2+60i_3=0\) \(-6+6=0\) \(0\ \checkmark\)

Network #3 (Three Loops, Two Sources)

Network #3 has two sources and three loops: two side by side on top and one below them spanning the full width. Loop 1 (upper left) contains \(e_1\), \(r_1\), \(r_3\) and \(r_4\); loop 2 (upper right) contains \(e_2\), \(r_2\), \(r_3\) and \(r_5\); loop 3 (bottom) contains \(r_4\), \(r_5\) and \(r_6\). So \(r_3\) is shared by loops 1 and 2, \(r_4\) by loops 1 and 3, and \(r_5\) by loops 2 and 3. Following Mathews’ figure, \(i_1\) is taken clockwise and \(i_2\), \(i_3\) counterclockwise; \(i_1\) and \(i_2\) are each in the direction their source drives them, so \(e_1\) and \(e_2\) enter with a plus sign. Then \(i_1\) and \(i_2\) both pass downward through \(r_3\), and \(i_1\) and \(i_3\) both pass leftward through \(r_4\), giving \(+r_3\) and \(+r_4\); \(i_2\) and \(i_3\) pass through \(r_5\) in opposite directions, giving \(-r_5\):

\[ \begin{aligned} (r_1+r_3+r_4)i_1+r_3i_2+r_4i_3&=e_1,\\ r_3i_1+(r_2+r_3+r_5)i_2-r_5i_3&=e_2,\\ r_4i_1-r_5i_2+(r_4+r_5+r_6)i_3&=0. \end{aligned} \tag{5} \]

Taking all three loops clockwise instead would make every off-diagonal entry negative, put \(-e_2\) on the right side, and reverse the signs of \(i_2\) and \(i_3\); the physical currents are the same.

Example 3

Given

\[ r_1=r_2=r_4=1,\quad r_3=r_5=2,\quad r_6=4,\quad e_1=23,\quad e_2=29. \]

Step 1: Substitute into (5):

\[ \begin{aligned} 4i_1+2i_2+i_3&=23,\\ 2i_1+5i_2-2i_3&=29,\\ i_1-2i_2+7i_3&=0. \end{aligned} \]

Step 2: Solve

\[ \begin{pmatrix} i_1\\ i_2\\ i_3 \end{pmatrix} = \begin{pmatrix} 3\\5\\1 \end{pmatrix}. \]

Verification:

Loop equation Left side Right side
\(4i_1+2i_2+i_3=23\) \(4(3)+2(5)+1=23\) \(23\ \checkmark\)
\(2i_1+5i_2-2i_3=29\) \(2(3)+5(5)-2(1)=29\) \(29\ \checkmark\)
\(i_1-2i_2+7i_3=0\) \(3-10+7=0\) \(0\ \checkmark\)

Example 4

Given

\[ r_1=1,\quad r_2=2,\quad r_3=4,\quad r_4=3,\quad r_5=1,\quad r_6=5,\quad e_1=41,\quad e_2=38. \]

Step 1: Substitute into (5):

\[ \begin{aligned} 8i_1+4i_2+3i_3&=41,\\ 4i_1+7i_2-i_3&=38,\\ 3i_1-i_2+9i_3&=0. \end{aligned} \]

Step 2: Solve

\[ \begin{pmatrix} i_1\\ i_2\\ i_3 \end{pmatrix} = \begin{pmatrix} 4\\3\\-1 \end{pmatrix}. \]

Verification:

Loop equation Left side Right side
\(8i_1+4i_2+3i_3=41\) \(8(4)+4(3)+3(-1)=41\) \(41\ \checkmark\)
\(4i_1+7i_2-i_3=38\) \(4(4)+7(3)-(-1)=38\) \(38\ \checkmark\)
\(3i_1-i_2+9i_3=0\) \(3(4)-3+9(-1)=0\) \(0\ \checkmark\)

The negative value \(i_3=-1\) is not an error: it means a current of magnitude 1 circulates around loop 3 clockwise, opposite to the counterclockwise direction assumed for \(i_3\).

With positive resistances and one equation per independent loop, the coefficient matrix is symmetric positive definite, so the loop currents are always uniquely determined. When resistances differ by orders of magnitude the system can still be ill-conditioned, and small changes in the data can then produce large changes in the computed currents.

Summary

Kirchhoff loop modeling converts circuits into linear algebra:

  1. Write one KVL equation per independent loop.
  2. Assemble the system matrix and source vector.
  3. Solve for loop currents and verify each equation numerically.

This gives a direct bridge from circuit laws to matrix methods used throughout numerical analysis.

References

Mathew, John H. 2000-2019. Numerical Analysis - Numerical Methods Modules. https://web.archive.org/web/20190808102217/http://mathfaculty.fullerton.edu/mathews/n2003/NumericalUndergradMod.html.