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
1. Write the two node equations (for nodes X and Y )
2. Arrange the result of part 1 into a matrix equation
3. Use MATLAB to solve for the two voltages (V X and V Y )
ANALYTICAL Solution
1. The node equations are
For node X:
I 1 = (
1
___
R 1
+ 1
___
R 2 ) V X – V Y or 2 = (1 + 2) V X − V Y
For node Y:
I 2 = –V X + (
1
___
R 3
+ 1
___
R 1 ) V Y or 3 = −V X + (3 + 1)V Y
The two simplifi ed and rearranged node equations are
2 = 3V X − V Y
3 = −V X = +4V Y
FIGURE 2.61
Network of Example 2.18.
X
Y
R 1 = 1 Ω
I 2 = 3 A
I 1 = 2 A
R 3 =
3
1
+
+
−
−
Ω
R 2 =
2
1 Ω
V X
V Y
CRC_47760_CH002.indd 161
CRC_47760_CH002.indd 161
7/23/2008 1:38:51 PM
7/23/2008 1:38:51 PM
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
1. Write the two node equations (for nodes X and Y )
2. Arrange the result of part 1 into a matrix equation
3. Use MATLAB to solve for the two voltages (V X and V Y )
ANALYTICAL Solution
1. The node equations are
For node X:
I 1 = (
1
___
R 1
+ 1
___
R 2 ) V X – V Y or 2 = (1 + 2) V X − V Y
For node Y:
I 2 = –V X + (
1
___
R 3
+ 1
___
R 1 ) V Y or 3 = −V X + (3 + 1)V Y
The two simplifi ed and rearranged node equations are
2 = 3V X − V Y
3 = −V X = +4V Y
FIGURE 2.61
Network of Example 2.18.
X
Y
R 1 = 1 Ω
I 2 = 3 A
I 1 = 2 A
R 3 =
3
1
+
+
−
−
Ω
R 2 =
2
1 Ω
V X
V Y
CRC_47760_CH002.indd 161
CRC_47760_CH002.indd 161
7/23/2008 1:38:51 PM
7/23/2008 1:38:51 PM
