162 Practical MATLAB® Applications for Engineers
- The resulting system nodal matrix equation is given by
31
142
3
YVVIX
Y *V where Y is the admittance matrix of the network, and the current vector I is given byI2
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.19The 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.
baR 3 = 3 Ω
R 2 = 1 ΩR 1 = 7 ΩV 0 = 100 VC = 0.5 FiC(t)
vC(t)+
−