Example 4: Kirchoff 's Current Law with Matrices

Solving a Simple KCL Equation

Using Matrix Methods solve for loop currents (Subscript[I, 1]) and (Subscript[I, 4]) in the network in the figure.  (Dr. M. Fogiel, Director, Staff of Research and Education Association, The Electric Circuits Problem Solver, Problem 3.23).  (Figure drawn using Quickroute 4.0.)

Since there are four loops in the network, we can write four loop equations.  Starting from the left side and going counterclockwise, the equations are as shown below.

l2 = 
      {-1.3 == -0.71 (Subscript[i, i]) + 1.86  (Subscript[i, 2]) - 0.92  (Subscript[i, 3]) - 0.23  (Subscript[i, 4])}

l3 = {1.3 - 8.4 == -0.92 (Subscript[i, 2]) + 2.86  (Subscript[i, 3]) - 1.12  (Subscript[i, 4])}

l4 = 
      {-2.1 == -3.25 (Subscript[i, i]) - 0.23  (Subscript[i, 2]) - 1.12  (Subscript[i, 3]) + 5.55  (Subscript[i, 4])}

To write the above notations in matrix form, you can either enter them as lists of lists or use the Mathematica Basic Input palettes. For arbitrary size matrix you can use the Input pull-down menu.

eqnL={(({{5.11, -0.71, 0, -3.25}, {-0.71, 1.86, -0.92, -0.23}, {0, -0.92, 2.86, -1.12}, {-3.25, -0.23, -1.12, 5.55}})).(({{(Subscript[i, 1])}, {(Subscript[i, 2])}, {(Subscript[i, 3])}, {(Subscript[i, 4])}}))==(({{1.5}, {-1.3}, {-7.1}, {-2.1}}))}

The above output gives the result of the matrix as a lists of lists.  In solving for these matrices, the elimination needed to reduce the matrix can be done automatically.

Solve[eqnL,  {(Subscript[i, 1]), (Subscript[i, 2]), (Subscript[i, 3]), (Subscript[i, 4])}]

Solving for this type of matrix would be very tedious to do by hand and might lead to a lot of errors. But as shown, the result was obtained very simply using the Mathematica function Solve in one single line of code, plus results are given to a specified number of significant figures.  This was another simple example that  undergraduates may encounter in an introductory course in circuit analysis. It still teaches the students the basic concepts in analyzing circuits, but it eliminates the many hours spent doing the math.