Tuesday, 4 May 2010

Simplifying complex resistor networks

After seeing this circuit diagram there were several differing answers in the associated forum regarding the resistance of the tangle of one Ohm resistors on the right side. The most common method seemed to be repeatedly applying the star-delta conversion on various parts and using other various simplifying tricks. The problem with these methods is obvious if you read the posts to the xkcd forum, everyone makes mistakes!

What is needed is a more robust, systematic method to solve problems like this, then a computer can solve it, and computers don't make mistakes. The method I will derive results in two relatively simple steps to solve any resistor network, no matter how complex. The first step is to set up a matrix that describes which nodes are connected together, the second step is to invert the matrix and solve.

There are only two very simple assumptions that need to be made to solve this problem:

Ohm's law states that the voltage across a resistor is equal to the current flowing through it multiplied by its resistance. Kirchoff's law states that the net current flowing into and out of any node is zero.

To make things easier, number all the nodes from one upwards. No we'll consider just the first node. We know there are several connections from node 1 to other nodes. Nodes that are not connected to node 1 essentially have an infinite resistance, or zero conductance. Conductance is the reciprocal of resistance, and here it makes things easier to use. Ohm's law changes from V=IR to I=VC, where C is the conductance of the resistor.

So let's apply Ohm's law to every resistor connected node 1, and sum up all the current entering the node. Here Cnm means the conductance of whatever is connected between node n and m. If there is no connection C will be zero, and if there is a resistor of value R, then C will be 1/R.

I1 = (V2-V1)C12 + (V3-V1)C13 +(V4-V1)C14 + ...

As the -V1 value appears in each term, we can take it out:

I1 = V1(-C12 - C13 - C14 - ...) + V2C12 + V3C13 + V4C14 + ...

Of course this is just the formula for the first node, we can write the same for the second node:

I2 = V1C21 + V2(-C21 - C23 - C24 - ...) + V3C23 + V4C24 + ...

Now, anyone who had studied matrix algebra should immediately recognise that the system of equations for every node can be written in matrix form. V is the vector of voltages at each node, I is the vector of net currents at each node, and C is a matrix of conductances:

I = CV

Matrix C is set up so that each off-diagonal element Cnm is equal to the conductance between node n and m. The diagonal elements are set to the negative of the sum of all conductances connected to that node. This can been explained by looking at the above formulas for each node.

Now finally to calculate the actual equivalent resistance. The aim is to find the total resistance between two nodes. To simulate this we can simply assume that a current of 1A is entering one node, and a current of -1A is entering the other node. This means the current vector I will be all zero apart from the two elements that we are connecting to the outside world. I is then typically something like {0,0,1,0,0,0,0,-1,0,0}.

All that remains is to find the voltage at each node, then we can use Ohm's law to find the equivalent resistance between the two nodes. All we need to do is to solve the I = CV equation for V, ie V = C-1I. However in most cases it is not necessary, and a bad idea to actually invert the C matrix. Better to use something like Gaussian elimination to get the values of V.

No comments:

Post a Comment