424 Practical MATLAB® Applications for Engineers
ANALYTICAL Solution
The loop equation of the preceding circuit in the s domain (KVL) is given by
10 3
3
42
20
30
9
2420
22
2
2
()
() () ()
()
s
Is sIs
s
Is
s
Is
s
ss
Then solving for I(s)
Is
s
ss s s
()
15
43 2 (^2191890)
and the voltage drop across each element are
Vs s
ss s s
Vs
s
ss s s
V
R
L
C
()
()
(
60
2191890
30
2191890
43 2
2
43 2
ss
ss s s
)
300
43 2 (^2191890)
The time functions i(t), vR(t), vl(t), and vc(t) can be obtained by evaluating the inverse LTs
(£−^1 ) on each of the frequency functions I(s), VR(s), Vl(s), and Vc(s).
MATLAB Solution
% Script file : RLC _ series
% plot of i(t) vs t
t = 0:.1:10;
Inum = [0 0 0 15 0];
Iden = [1 2 19 18 90];
figure(1)
subplot(2,2,1)
it = impulse(Inum,Iden,t);
plot(t,it);title(‘i(t) vs t’);ylabel(‘Amplitude (amps)’)
%plot of VR(t) vs t
VRnum=[0 0 0 60 0];
VRden=Iden;
subplot(2,2,2)
vrt = impulse(VRnum,VRden,t);
plot(t,vrt);title(‘vr(t) vs t’);ylabel(‘Amplitude (volts)’)
% plot of VL(t) vs t
VLnum=[0 0 30 0 0];
VLden=Iden;
vlt=impulse(VLnum,VLden,t);
subplot(2,2,3)