# Nodal analysis algorithm applied to a circuit without voltage sources

1. Oct 1, 2009

### oswald2323

1. The problem statement, all variables and given/known data

I am having some trouble with the nodal analysis algorithm explained in this web page http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA3.html

My electrical circuits knowledge is very basic, and I need to get the equivalent resistance of a circuit for a non related task (I am building an automated Hex player, see http://home.earthlink.net/~vanshel/VAnshelevich-01.pdf if you are interested).

The most basic circuit would be (excuse the ugly drawing):

2. Relevant equations

I set 1 Ampere for the generator, all resistors to 1 ohm and all wires 0.01 ohm (except the ones from the generator to A and B, which should have resistance 0). I want to get equivalent resistance from A to B. As you can see, there are no voltage sources so this is the most basic case of nodal analysis: I want to solve G*v = I, so I can get the voltage at node A and finally use it to calculate the circuit resistance (which should be equal to [voltage at node A] Ohms).

3. The attempt at a solution
I have coded a little program that solves the thing. The problem is that following the algorithm, it comes up with this G matrix:

Code (Text):
200.00     -100.00     -100.00        0.00        0.00
-100.00      103.00       -1.00       -1.00       -1.00
-100.00       -1.00      102.00        0.00       -1.00
0.00       -1.00        0.00        2.00       -1.00
0.00       -1.00       -1.00       -1.00        3.00
which is singular, and thus I cannot solve the linear system. The I vector is set as:

Code (Text):

1.00
0.00
0.00
0.00
0.00

Do you have any clues as to what I am doing wrong? Should node B be represented in the G matrix? (I tried it and the same thing happens, G matrix is singular).

PD: even though this is not a homework or coursework assignment, I am posting here because I got a warning when I posted in the electrical engineering forum.

2. Oct 1, 2009

### The Electrician

I see that this question is a follow-on from your earlier thread.

You have followed my advice to replace wires with small resistors, but you have not provided a new schematic where the little .01 ohm resistors are shown. This puts those who might help you in a difficult position. We have to guess where the .01 ohm resistors are.

You should also show in your schematic the numbering of the nodes that you used when you created your matrix.

However, I can tell that you have a couple of .01 ohm resistors between node A and each of V1 and V2, and that node A is node 1, and nodes V1, V2, V3 and V4 are numbered 2, 3, 4 and 5.

Your problem is that you have treated nodes V3 and V4 as though they weren't grounded. Unless you insert .01 resistors between V3 and ground, and between V4 and ground, your matrix will be singular.

But if you eliminate rows 4 and 5, and columns 4 and 5 in the matrix shown in your post #1 (this is what you should get by taking into account the fact that V3 and V4 are at ground potential), and shorten your I vector to only have 3 elements, then you can solve the system.

If I do this, I get a result of .338870967742 ohms.

If you don't insert the .01 ohm resistors, the resistance from A to B is .333333333333 ohms.

The .01 ohm resistors don't make much difference.

If you insert .01 ohm resistors between V3 and ground, and between V4 and ground, then you will have a matrix which won't be singular.

If I do this, I get a result of .344415584416 ohms.

3. Oct 1, 2009

### oswald2323

Great! Now I get what I was doing wrong. I have fixed that and the resistance calculation is working perfectly, even for a larger circuit =)

Thanks again!

4. Jan 18, 2010