162 Practical MATLAB® Applications for Engineers
- The resulting system nodal matrix equation is given by
31
14
2
3
Y
V
VI
X
Y
*V
where Y is the admittance matrix of the network, and the current vector I is given by
I
2
3
MATLAB Solution
>> Y = [3 -1;-1 4];
>> I = [2;3];
>> V= inv(Y)*I;
>> VX = V(1);
>> VY =V(2);
>> Result = [VX VY];
>> disp (‘**********************************’)
>> disp (‘The voltage drops Vx and Vy (in volts) are given by:’);
>> disp (Result)
>> disp (‘**********************************’)
************************************************************
The nodal voltages Vx and Vy (in volts) are given by:
1.0000 1.0000
************************************************************
Example 2.19
The switch shown in the circuit diagram in Figure 2.62 has been in position a for a long
time. At t = 0, the switch is moved to position b where it remains for 2 s and then moves
back to position a, where it remains indefi nitely.
- Obtain analytical expressions for vC(t) and iC(t) for all t
- Use MATLAB to obtain plots over the range 0 s ≤ t ≤ 10 s of
a. The voltage vC(t) versus t
b. The current iC(t) versus t
FIGURE 2.62
Network of Example 2.19.
b
a
R 3 = 3 Ω
R 2 = 1 Ω
R 1 = 7 Ω
V 0 = 100 V
C = 0.5 F
iC(t)
vC(t)
+
−