Yea your right about that. Thanks for catching that. It's a typo. It's supposed to be:
That does seem to be problematic. But I'm not exactly sure what would change in the equations. The incidence matrix N and six columns and six rows. The first column represents node 1, the second column represents node 2, and so forth. Row 1 represents edge 1, row 2 represents edge 2, and so forth. I populate the incidence matrix N by looking at each edge and if crrent is leaving the node I put a negative one, and if it's entering the node I put a positive one.
The vector V is the voltage across each resistor. At least this is how I was taught but to me it looks like the opposite of the voltage drop. Like I have the following
X_2 - X_1 = V_1 when in my opinion X_1 - X_2 = V_1. But this is how we were taught, not sure if it's wrong?
The resistance matrix R is just a diagonal matrix, where column one row one represents R_1, column 2 row 2 represents R_2 and so forth.
HW solutions solved a similar problem in a similar way but the final calculation was never done. My textbook doesn't seem to have a resistive circuit example.
Yeah
X_1 = nodal voltage at node 1
X_2 = nodal voltage at node 2
X_3 = nodal voltage at node 3
.
.
.
Y_1 = current going across edge 1 (R_1)
Y_2 = current going across edge 2 (R_2)
.
.
.
Also C^(-1) = R
so I use the following relation
The matrix I represents the applied currents to the circuit. Since I only have one current source at node 4 I get the following
looks like I had it wrong before by accident.
The matrix E represents the applied voltage sources in the circuit which is only at node 6 so E is
I try re-entering this into MATLAB and create the zero matrix A to help.
>> N=[-1 1 0 0 0 0;0 -1 0 1 0 0;-1 0 1 0 0 0;0 0 1 -1 0 0;0 0 -1 0 1 0;0 0 0 0 -1 1]
N =
-1 1 0 0 0 0
0 -1 0 1 0 0
-1 0 1 0 0 0
0 0 1 -1 0 0
0 0 -1 0 1 0
0 0 0 0 -1 1
>> R=[1 0 0 0 0 0;0 2 0 0 0 0;0 0 3 0 0 0;0 0 0 4 0 0;0 0 0 0 5 0;0 0 0 0 0 6]
R =
1 0 0 0 0 0
0 2 0 0 0 0
0 0 3 0 0 0
0 0 0 4 0 0
0 0 0 0 5 0
0 0 0 0 0 6
>> I=[0;0;0;2;0;0]
I =
0
0
0
2
0
0
>> E=[0;0;0;0;0;5]
E =
0
0
0
0
0
5
>> A=[0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0]
A =
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
>> inv([R N;N' A])*[I;E]
Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
2.312965e-18. ans =
1.0e+16 *
0.0000
0.0000
-0.0000
0.0000
0.0000
0.0000
4.5036
4.5036
4.5036
4.5036
4.5036
4.5036
to solve for the matrix [y;x]. The problem is that when I plug this into MATLAB I get the error and I don't why =(. Thanks for any help.