Chapter 2 - Resistive Capacitive RC Circuits

Example E3 - Pg 36

In [12]:
#Caption:Calculate voltage after 8ms
c=1.#Capacitance of capacitor(in micro farad)
vs=6.#Source voltage(in volts)
r=10.#Resistor(in kilo ohm)
vi=-3.#Initial voltage(in volts)
t=8.#Time (in milli sec)
e=vs-((vs-vi)*2.718**(-t/(r*c)))
print '%s %.2f' %('Voltage after 8ms(in volts)=',e)
Voltage after 8ms(in volts)= 1.96

Example E4 - Pg 38

In [11]:
#Caption:Determine (a)Ec at 1.5ms (b)Ec at 6ms
r1=1.#Resistor(in kilo ohm)
c1=1.#Capacitance(in micro farad)
e1=10.#Voltage(in volts)
r2=20.#Resistor(in kilo ohm)
c2=0.1#Capacitance(in micro farad)
e2=12.#Voltage(in volts)
t1=r1*c1*0.78
e=e1*1.
ec1=e*t1
t2=r2*c2*0.025
E=e2*1.
ec2=E*t2
print '%s %.1f %s %.1f'%('(a)Ec at 1.5ms(in volts) =',ec1,'\n(b)Ec at 6ms(in volts) =',ec2)
(a)Ec at 1.5ms(in volts) = 7.8 
(b)Ec at 6ms(in volts) = 0.6

Example E5 - Pg 46

In [8]:
#Caption:Calculate Rise time,time for capacitor to charge to required amount and time required for complete charging
V=5.#Voltage source(in volts)
r=39.#Resistor(in kilo ohm)
c=500.#Capacitance of capacitor(in pf)
tr=2.2*r*c*10.**(-3)
t=r*c*10.**(-3)
tc=5*r*c*10.**(-3)
print '%s %.1f %s %.1f %s %.1f' %('Rise time=',tr,'\ntime for  63.2% charging=',t,'\nand time required for complete charging(in micro sec)=',tc)
Rise time= 42.9 
time for  63.2% charging= 19.5 
and time required for complete charging(in micro sec)= 97.5

Example E6 - Pg 47

In [7]:
#Caption:Calculate minimum square wave frequency
C=1.#Coupling capacitor(in micro farad)
R=1.#Input resistance(in Mega ohm)
t=0.01#Tilt
PW=t*R*C
f=1./(2.*PW)
print '%s %.f' %('Frequency required(in hertz)=',f)
Frequency required(in hertz)= 50

Example E7 - Pg 47

In [6]:
#Caption:Determine fastest rise time
r=600.#Output resistance(in ohms)
c=30.#Input capacitance(in pf)
tr=2.2*r*c*10.**(-3)
print '%s %.1f' %('Fastest rise time(in ns)=',tr)
Fastest rise time(in ns)= 39.6

Example E8 - Pg 49

In [6]:
#Caption:Calculate voltage at 14 ms 
Eo=0#Voltage at t=0sec(in volt)
E=20.#Peak voltage(in volts)
r=3.3#Resistance(in kilo ohm)
c=1.#Capacitance(in micro farad)
t1=4.#Time(in ms)
t2=2.#Time(in ms)
e1=E-((E-Eo)*(2.718)**(-t1/(r*c)))
e2=Eo-((Eo-e1)*(2.718)**(-t1/(r*c)))
e3=E-((E-e2)*(2.718)**(-t1/(r*c)))
e3=Eo-((Eo-e3)*(2.718)**(-t2/(r*c)))
print '%s %.2f' %('Voltage at 14ms(in volts)=',e3)
Voltage at 14ms(in volts)= 8.34

Example E9 - Pg 50

In [5]:
#Caption:Determine max and min voltage at which capacitor voltage will settle
E=20.#Peak voltage(in volts)
t=4.#Time interval(in ms)
r=3.3#Resistance(in kilo ohms)
c=1.#Capacitance(in micro farad)
Emax=E/(1.+(2.718**(-t/(r*c))))
Emin=E-Emax
print '%s %.2f %s %.2f' %('Maximum voltage(in volts)=',Emax, '\n minimum voltage(in volts)=',Emin)
Maximum voltage(in volts)= 15.41 
 minimum voltage(in volts)= 4.59

Example E10 - Pg 52

In [3]:
#Caption:Calculate output voltage for (a)10V and 1ms Pw (b)10V and 2ms PW (c)20V and 1ms PW
e1=10.#Voltage applied(in volts)
e0=0#Voltage at t=0sec(in volts)
t1=1.#PW(in ms)
t2=2.#PW(in ms)
e2=20.#Input voltage(in volts)
r=10.#Resistance(in kilo ohm)
c=20.#Capacitance(in micro farad)
eo1=(e1-((e1-e0)*(2.718)**(-t1/(r*c))))*1000
eo2=(e1-((e1-e0)*(2.718)**(-t2/(r*c))))*1000
eo3=(e2-((e2-e0)*(2.718)**(-t1/(r*c))))*1000
print '%s %.f %s %.f %s %.f' %('Output voltage for\n(a)(in mv)=',eo1,'\n(b)(in mv)=',eo2,'\n(c)(in mv)=',eo3)
Output voltage for
(a)(in mv)= 50 
(b)(in mv)= 99 
(c)(in mv)= 100

Example E11 - Pg 59

In [2]:
#Caption:Calculate output voltage for (a)10V and (b)20V
E1=10.#Input voltage(in volts)
E2=20.#Input voltage(in volts)
c=1.#Capacitance(in micro farad)
r=1.#Resistance(in kilo ohm)
t=100.#Pulse width(in ms)
i1=(c*E1*10.**(-6.))/(t*10.**(-3.))
eo1=i1*r*1000.
print '%s %.1f' %('Output voltage for (a)(in volts)=',eo1)
i2=(c*E2*10.**(-6.)/(t*10.**(-3.)))
eo2=i2*r*1000.
print '%s %.1f' %('Output voltage for (b)(in volts)=',eo2)
Output voltage for (a)(in volts)= 0.1
Output voltage for (b)(in volts)= 0.2

Example E12 - Pg 59

In [1]:
#Caption:Calculate amplitude of output waveform for (a)Rise time (b)Fall time
r=1.#Resistance(in kilo ohm)
c=100.#Capacitance(in pf)
tr=1.#Rise time(in micro sec)
tf=3.#Fall time(in micro sec)
e1=8.#Change in voltage for rise time(in volts)
e2=-8.#Change in voltage for fall time(in volts)
eo1=r*c*0.001*e1/tr
print '%s %.1f' %('Amplitude of output waveform for (a)Rise time(in volts)=',eo1)
eo2=r*c*0.001*e2/tf
print '%s %.2f' %('Amplitude of output waveform for (b)Fall time(in volts)=',eo2)
Amplitude of output waveform for (a)Rise time(in volts)= 0.8
Amplitude of output waveform for (b)Fall time(in volts)= -0.27