Mth 341 Linear Algebra
Summer 1997

Kirchhoff's Laws

An Application of Linear Algebra and Maple

Consider the following simple electrical circuit

To find the effective resistance R of the network of 5 resistors illustrated above we use Ohm's Law: E = R*i0. We will find the current i0 by solving a system of linear equations derived by applying Kirchhoff's laws to the circuit.

Here are the equations obtained by balancing the current flowing into and out off each of the four nodes:

   i0 - i1 - i2 = 0
   i1 - i3 - i4 = 0
   i2 + i3 - i5 = 0
 - i0 + i4 + i5 = 0

Here are the equations obtained by considering the voltage drops around four well-chosen loops (there are many others):

   i1 R1 + i4 R4 = E
   i2 R2 + i5 R5 = E
   i1 R1 - i2 R2 + i3 R3 = 0
 - i3 R3 + i4 R4 - i5 R5 = 0

We now have a system of 8 linear equations for the 6 unknown currents i0, i1, i2, i3, i4, i5. We'll let Maple have at it.

> with(linalg):

Here's the augmented matrix of the system of linear equations above

> A := matrix([
> [1,-1,-1,0,0,0,0],
> [0,1,0,-1,-1,0,0],
> [0,0,1,1,0,-1,0],
> [-1,0,0,0,1,1,0],
> [0,R1,0,0,R4,0,E],
> [0,0,R2,0,0,R5,E],
> [0,R1,-R2,R3,0,0,0],
> [0,0,0,-R3,R4,-R5,0]
> ]);

                [ 1    -1    -1      0     0      0     0]
                [                                        ]
                [ 0    1      0     -1     -1     0     0]
                [                                        ]
                [ 0    0      1      1     0     -1     0]
                [                                        ]
                [-1    0      0      0     1      1     0]
           A := [                                        ]
                [ 0    R1     0      0     R4     0     E]
                [                                        ]
                [ 0    0     R2      0     0     R5     E]
                [                                        ]
                [ 0    R1    -R2    R3     0      0     0]
                [                                        ]
                [ 0    0      0     -R3    R4    -R5    0]

We solve the system by first computing the row reduced echelon form of the augmented matrix

> G:=rref(A);

G :=

    [1 , 0 , 0 , 0 , 0 , 0 , (R3 R1 + R1 R4 + R1 R5 + R3 R5 + R3 R2 + R2 R4 + R2 R5 + R3 R4) E /(%1)]

    [                        (R3 R5 + R3 R2 + R2 R4 + R2 R5) E]
    [0 , 1 , 0 , 0 , 0 , 0 , ---------------------------------]
    [                                       %1                ]

    [                        E (R3 R4 + R3 R1 + R1 R4 + R1 R5)]
    [0 , 0 , 1 , 0 , 0 , 0 , ---------------------------------]
    [                                       %1                ]

    [                          E (-R2 R4 + R1 R5)]
    [0 , 0 , 0 , 1 , 0 , 0 , - ------------------]
    [                                  %1        ]

    [                        (R1 R5 + R3 R5 + R3 R2 + R2 R5) E]
    [0 , 0 , 0 , 0 , 1 , 0 , ---------------------------------]
    [                                       %1                ]

    [                        E (R2 R4 + R3 R4 + R3 R1 + R1 R4)]
    [0 , 0 , 0 , 0 , 0 , 1 , ---------------------------------]
    [                                       %1                ]

    [0 , 0 , 0 , 0 , 0 , 0 , 0]

    [0 , 0 , 0 , 0 , 0 , 0 , 0]

%1 := R3 R4 R5 + R3 R4 R2 + R3 R1 R5 + R3 R1 R2 + R1 R4 R5 + R1 R4 R2 + R2 R4 R5 + R2 R1 R5

Now i0 is given by the equation associated with the first row: i0 = G[1,7]. Here G[1,7] is Maple's notation for the 7th entry in the first row. Thus we can now compute R:

> R := E/G[1,7];

     R3 R4 R5 + R3 R4 R2 + R3 R1 R5 + R3 R1 R2 + R1 R4 R5 + R1 R4 R2 + R2 R4 R5 + R2 R1 R5
R := -------------------------------------------------------------------------------------
                 R3 R1 + R1 R4 + R1 R5 + R3 R5 + R3 R2 + R2 R4 + R2 R5 + R3 R4

As a sanity check we consider the case R3=0. In this case we have two simple parallel circuits in series and we can easily compute the resistance.

Here's the result of substituting R3=0 in our general formula:

> T1 := subs(R3=0,R);

                 R1 R4 R5 + R1 R4 R2 + R2 R4 R5 + R2 R1 R5
           T1 := -----------------------------------------
                       R1 R4 + R1 R5 + R2 R4 + R2 R5

Here's the known formula for the simple series-parallel circuit:

> T2 := 1/(1/R1+1/R2)+1/(1/R4+1/R5); 

                              1             1
                   T2 := ----------- + -----------
                          1      1      1      1
                         ---- + ----   ---- + ----
                          R1     R2     R4     R5

It is difficult to see if they are the same. let's ask Maple to check for us:

> simplify(T1-T2);

                                  0

Sure enough!

As another sanity check we can take R1=R2=R3=R4=R5. By symmetry we obviously have i3=0. Thus we see quickly R=R1. This is also the result given by our general formula.

This page was prepared from a Maple worksheet created in Maple V4.

Problem: A classic problem is to find the effective resistance of a network of 12 resistors arranged along the edges of a cube. Typically we want the resistance between two diametrically opposite vertices of the cube. The classical problem (for human consideration) has all the resistances equal, but Maple doesn't care. See if you can work it out (using Maple of course).


Mth 341 Index