Direct Current and Transient Analysis 161
MATLAB Solution
>> R = [3 -2 0; -2 9 -4; 0 -4 10];
>> V = [20; -15; -10];
>> I = inv(R)*V;
>> Result = [I(1) I(2) I(3)];
>> disp(‘***********************************************’)
>> disp(‘The loop currents I1, I2 and I3(in amp) are:’);
>> disp(Result’);
>> disp(‘***********************************************’)
*************************************************
The loop currents I1, I2 and I3 (in amp) are:
6.0440
-0.9341
-1.3736
*************************************************
Example 2.18
For the circuit diagram shown in Figure 2.61
- Write the two node equations (for nodes X and Y)
- Arrange the result of part 1 into a matrix equation
- Use MATLAB to solve for the two voltages (VX and VY)
ANALYTICAL Solution
- The node equations are
For node X: I 1 = (^) ( ___^1
R 1
- ^1
R 2
(^) ) VX – VY or 2 = (1 + 2) VX − VY
For node Y: I 2 = – VX + (^) ( ^1
R 3 - ___^1
R 1
(^) ) VY or 3 = −VX + (3 + 1)VY
The two simplifi ed and rearranged node equations are
2 = 3 VX − VY
3 = −VX = + 4 VY
FIGURE 2.61
Network of Example 2.18.
XYR^1 =^1 Ω
I 2 = 3 A
I 1 = 2 A
R 3 =
3
1
- −−
R 2 = Ω
2
(^1) Ω
VX VY
- −−