# What is the time constant of a 20-H coil having 100 Ohms of series resistance?
# Given data
L = 20.# # Inductor=20 Henry
R = 100.# # Resistor=100 Ohms
T = L/R#
print 'The Time Constant = %0.2f Seconds'%T
# An applied dc voltage of 10 V will produce a steady-state current of 100 mA in the 100-Ohms coil. How much is the current after 0.2 s? After 1 s?
# Given data
L = 20.# # Inductor=20 Henry
R = 100.# # Resistor=100 Ohms
I = 100.*10**-3# # Steady-state current=100 mAmps
print 'Since 0.2 sec is one time constant, I is 63% of 100 mA'
I1 = 0.63*I#
print 'The current at 0.2 sec time constant = %0.2f A'%I1
print 'After 1 sec the current reaches its steady state value of 100 mAmps '
# If a 1-M Ohms R is added in series with the coil, how much will the time constant be for the higher resistance RL circuit?
# Given data
L = 20.# # Inductor=20 Henry
R = 1.*10**6# # Resistor=1 MOhms
T = L/R#
print 'The Time Constant = %0.2e Seconds'%T
print 'i.e 20 us'
# What is the time constant of a 0.01-uF capacitor in series with a 1-M Ohmsresistance?
# Given data
C = 0.01*10**-6# # Capacitor=0.01 uFarad
R = 1*10**6# # Resistor=1 MOhms
T = C*R#
print 'The Time Constant = %0.2e Seconds'%T
# With a dc voltage of 300 V applied, how much is the voltage across C in Example 22–4 after 0.01 s of charging? After 0.05 s? After 2 hours? After 2 days?
# Given data
C = 0.01*10**-6# # Capacitor=0.01 uFarad
R = 1.*10**6# # Resistor=1 MOhms
V = 300.# # Applied DC=300 Volts
T = C*R#
print 'The Time Constant = %0.2e Seconds'%T
print 'Since 0.01 sec is one time constant, the voltage across C then is 63% of 300 V,'
T1 = 0.63*V#
print 'The Capacitor voltage at 0.01 Sec = %0.2f Volts'%T1
T2 = V
print 'After 5 time constants or 0.05 Sec Capacitor voltage = %0.2f volts '%V
print 'After 2 hours or 2 days the C will be still charged to 300 V if the supply is still connected'
# If the capacitor is allowed to charge to 300 V and then discharged, how much is the capacitor voltage 0.01 s after the start of discharge? The series resistance is the same on discharge as on charge.
# Given data
C = 0.01*10**-6# # Capacitor=0.01 uFarad
R = 1.*10**6# # Resistor=1 MOhms
V = 3000# # Applied DC=300 Volts
print 'In one time constant, C discharges to 37% of its initial voltage'
V1 = 0.37*V#
print 'The Capacitor voltage after 0.01 sec start of discharge = %0.f volts'%V1
# Assume the capacitor is discharging after being charged to 200 V. How much will the voltage across C be 0.01 s after the beginning of discharge? The series resistance is the same on discharge as on charge.
# Given data
C = 0.01*10**-6# # Capacitor=0.01 uFarad
R = 1*10**6# # Resistor=1 MOhms
V = 200# # Capacitor voltage=200 Volts
print 'In one time constant, C discharges to 37% of its initial voltage'
V1 = 0.37*V#
print 'The Capacitor voltage after 0.01 sec start of discharge = %0.f volts'%V1
# If a 1-M Ohms resistance is added in series with the capacitor 0.01-uF and resistor 1-M Ohms in, how much will the time constant be?
# Given data
C = 0.01*10**-6# # Capacitor=0.01 uFarad
R = 2*10**6# # Resistor= 2 MOhms
T = C*R#
print 'The Time Constant = %0.2e Seconds'%T
from math import log10
# An RC circuit has a time constant of 3 s. The capacitor is charged to 40 V. Then C is discharged. After 6 s of discharge, how much is Vr?
# Given data
RC = 3# # RC time constant=3 Sec
t = 6# # Discharge time=6 Sec
Vc = 40# # Capacitor voltage=40 Volts
A = t/RC# # constant factor
B = log10(Vc)#
Vr = 10**(B-(A*0.434))#
print 'The Value of Vr = %0.2f Volts'%Vr
from math import log10
# An RC circuit has an R of 10 k Ohms and a C of 0.05 uF. The applied voltage for charging is 36 V. (a) Calculate the time constant. (b) How long will it take C to charge to 24 V?
C = 0.05*10**-6# # Capacitor=0.05 uFarad
R = 10*10**3# # Resistor=10 kOhms
V = 36# # Applied voltage=36 Volts
v = 12# # Voltage drops from 36 to 12 Volts
A = 2.3# # Specific factor
T = C*R#
print 'The Time Constant = %0.2e Seconds'%T
print 'i.e 0.5*10**-3 Sec OR 0.5 mSec'
t = A*T*log10(V/v)#
print 'Time required to charge Capacitor upto 24 Volts = %0.2e Seconds'%t
print 'i.e approx 0.549*10**-3 Sec OR 0.549 mSec'