You are on page 1of 1

Suppose that, a series RC circuit where, supply voltage, E=10V, resistance,

R=1000Ω and capacitance, C=0.0001F,0.00015F.


Solution: Vt=E(1-e^(-t/rc)) 𝑤ℎ𝑒𝑟𝑒 𝜏 = 𝑅𝐶
Let, voltage across the capacitor, V t v vt
MATLAB CODE: 0 0 0
clear all 0.0100 0.9524 0.9516
clc 0.0200 1.8140 1.8127
E=10; 0.0300 2.5937 2.5918
r=1000; 0.0400 3.2990 3.2968
c=[0.0001,0.00015]; 0.0500 3.9372 3.9347
for s=1:2; 0.0600 4.5146 4.5119
t=0:0.01:0.2; 0.0700 5.0370 5.0341
n=length(t); 0.0800 5.5097 5.5067
f=@(t,v)((E-v)/(r*c(s))); 0.0900 5.9373 5.9343
h=0.01; 0.1000 6.3243 6.3212
v(1)=0;
for i=1:n-1;
v(i+1)=v(i)+h*f(t(i),v(i));
for j=1:3;
v(i+1)=v(i)+(h/2)*(f(t(i),v(i))+f(t(i+1),v(i+1)));
end
end
t,v;
vt=E*(1-(exp((-t)/(r*c(s)))));
if s==1;
plot(t,v,'bo',t,vt,'r*-')
hold on
grid on
else
plot(t,v,'x-',t,vt,'s-')
end

end
Respone of RC Circuit
9

8
RC=0.1
RC=0.1(vt)
7 RC=0.15
RC=0.15(vt)

5
Voltage(V)

0
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Time(t)

You might also like