# Resistor Cube Problem

## Homework Statement

So I need to find the total voltage across the current source.

Looking at the attachment, I took

front square: B_______C
...................|..............|
...................|..............|
...................A_______D

back square: E_______H
...................|..............|
...................|..............|
...................F_______G

node analysis

## The Attempt at a Solution

So I used node analysis at each corner to get a set of equations:
-g6Vc-g1Ve-g3Vg+(g3+g1+g6)Vh=0.001
-g5Vd-g4Vf+(g5+g4+g3)Vg-g3Vh=0
-g8Va-g2Ve+(g8+g4+g2)Vf-g4Vg=0
-g7Vb+(g1+g7+g2)Ve-g2Vf-g1Vh=0
-g12Va+(g12+g9+g7Vb)-g9Vc-g7Ve=0
-g9Vb+(g9+g10+g6)Vc-g10Ve-g6Vh=0
-g11Va-g10Vc+(g5+g10+g11)Vd-g5Vg=0
(-g12-g11-g8)Va+g12Vb+g11Vd+g8Vf=0.001

where g(x) is the conductance=1/R(x)

So I notice this as 8 equations with 8 unknowns. However, when I plug this into matlab,
I get (Warning: Matrix is close to singular or badly scaled.)

Is there a problem with my equations?
Any help would be appreciated.

#### Attachments

• Cube_Problem.pdf
936.4 KB · Views: 235

The Electrician
Gold Member
Node A is the reference node (ground). You don't need to solve for the voltage at that node, so you should eliminate that node from your equations. If you solve for 7 unknowns with 7 equations you shouldn't get that error message.

alright so I removed the first column in matrix a as well as the last row

so i did it and got that
Vb=0.7196
Vc=1.5696
Vd=0.7541
Ve=1.7336
Vf=1.3792
Vg=1.4909
Vh=2.3588

So my voltage across the current source would be 2.3588V?
But when I check my answers looking around loops, the total voltage does not equal 0.

The Electrician
Gold Member
It's easy to make a mistake entering all the coefficients in a problem like this. The first thing you should do is make sure that the transpose of your coefficient matrix is the same as the matrix itself.

If you could paste the matrix from Matlab into a post here, I could check it out.

g1=1/1000
g2=1/3000
g3=1/4000
g4=1/1000
g5=1/7000
g6=1/5000
g7=1/2000
g8=1/6000
g9=1/4000
g10=1/3000
g11=1/2000
g12=1/1000

a=[0, -g6, 0, -g1, 0, -g3, g3+g1+g6;
0, 0, -g5, 0, -g4, g5+g4+g3, -g3;
0, 0, 0, -g2, g8+g4+g2, -g4, 0;
-g7, 0, 0, g1+g7+g2, -g2, 0, -g1;
g12+g9+g7, -g9, 0, -g7, 0, 0, 0;
-g9, g9+g10+g6, 0, -g10, 0, 0, -g6;
0, -g10, g5+g10+g11, 0, 0, -g5, 0]

b=[0.001; 0; 0; 0; 0; 0;0]

then I do x=a\b

The Electrician
Gold Member
You must arrange the matrix so that the elements containing the driving point admittances (such as g3+g1+g6) are all on the main diagonal. If you don't do this, then the columns and rows don't apply to your node variables in the same order.

Right now, the rows of your matrix are associated with the nodes in this order:

H
G
F
E
B
C
D

Rearrange the last three rows so the order is:

H
G
F
E
D
C
B

and fix them up so that the main diagonal elements are the sums of the 3 admittances connected to the particular node. It will be less confusing and easier for me to help you if you do this.

Your matrix should be (showing the first four fixed):

a=[g3+g1+g6, 0, -g3, 0, -g1, 0, -g6;
-g3, g5+g4+g3, -g4, 0, 0, 0, -g5;
0, -g4, g8+g4+g2, -g2, 0, 0, 0;
-g1, 0, -g2, g1+g7+g2, -g7, 0, 0;
............
............
............]

The solution vector I get when this is done is:

Vh = 2.0601
Vg = 1.2625
Vf = 1.1724
Ve = 1.4885
Vd = 0.5560
Vc = .91499
Vb = .49719

Keep in mind that I could have made a mistake with all the numbers that have to be typed in, so I can't give an absolute guarantee that these are correct. But I did recheck several times.

Alright so I rearranged the matrix to get:

a=[g3+g1+g6, -g3, 0, -g1, 0, -g6, 0;
-g3,g5+g4+g3,-g4,0,-g5,0,0;
0,-g4,g8+g4+g2,-g2,0,0,0;
-g1,0,-g2,g1+g7+g2,0,0,-g7;
0,-g5,0,0,g5+g10+g11,-g10,0;
-g6,0,0,-g10,0,g9+g10+g6,-g9;
0,0,0,-g7,0,-g9,g12+g9+g7]

however, this does not look like the one you started?

And I also get the same answer as before.

The Electrician
Gold Member
Alright so I rearranged the matrix to get:

a=[g3+g1+g6, -g3, 0, -g1, 0, -g6, 0;
-g3,g5+g4+g3,-g4,0,-g5,0,0;
0,-g4,g8+g4+g2,-g2,0,0,0;
-g1,0,-g2,g1+g7+g2,0,0,-g7;
0,-g5,0,0,g5+g10+g11,-g10,0;
-g6,0,0,-g10,0,g9+g10+g6,-g9;
0,0,0,-g7,0,-g9,g12+g9+g7]

however, this does not look like the one you started?

And I also get the same answer as before.

The reason it doesn't look like the one I started is that I mixed up some of your rows.
You see how easy it is to do! :-(

I think you've got it correct except for one little problem.

I think it should be:

a=[g3+g1+g6, -g3, 0, -g1, 0, -g6, 0;
-g3,g5+g4+g3,-g4,0,-g5,0,0;
0,-g4,g8+g4+g2,-g2,0,0,0;
-g1,0,-g2,g1+g7+g2,0,0,-g7;
0,-g5,0,0,g5+g10+g11,-g10,0;
-g6,0,0,0,-g10,g9+g10+g6,-g9;
0,0,0,-g7,0,-g9,g12+g9+g7]

This shows that if you arrange your matrix so that the driving point admittances are on the main diagonal, the matrix will be equal to its transpose (for networks of linear, passive components). Checking that would have revealed your last little error.

Try that and see what you get.

I think you've got the method ok; you're just having problems with the details (as I did when trying to rearrange your matrix).

See the attached image for my solution. I multiplied everything by 1000 to make the matrix more compact. If you still don't get what I get, compare yours to the attached image.

#### Attachments

• ForumCube.png
3.4 KB · Views: 576
Last edited:
yep I got
Vh = 2.0601
Vg = 1.2625
Vf = 1.1724
Ve = 1.4885
Vd = 0.5560
Vc = .91499
Vb = .49719

ya nice catch on that little mistake there. thanks a lot.