% To plot response of RL and RC circuits
% R = 10, L = 20e-3 H for RL circuit
V = 100; % Volts
R = 10; % Ohms
L = 20e-3; % Henry
Im = V/R;
to = L/R;
t = 0:10e-6:0.02;
i = Im*(1-exp(-t/to));
figure(1)
plot(t,i)
title('Response of R-L circuit')
xlabel('T (sec)'), ylabel('i(t)')
% R = 100, C = 20e-6 F for RC circuit
R = 100;
C = 200e-4;
Vm = V;
to = 1/(R*C)
t = 0:10e-6:6;
v = Vm*(1-exp(-t/to));
figure(2)
plot(t,v)
title('Response of R-C circuit')
xlabel('T (sec)'), ylabel('v(t)')
No comments:
Post a Comment