#importing modules
import math
from __future__ import division
#Variable declaration
L=0.1; #inductance(H)
R=10; #resistance(ohm)
t1=0; #time(sec)
t2=0.002; #time(sec)
t3=0.04; #time(sec)
E=5; #voltage(V)
#Calculation
tow=L/R; #time(sec)
a=E/R;
i1=a*(1-math.exp(-t1/tow)); #current for t=0 sec(A)
i2=a*(1-math.exp(-t2/tow)); #current for t=0.002 sec(A)
i3=a*(1-math.exp(-t3/tow)); #current for t=0.04 sec(A)
i4=a*(1-math.exp(-tow/tow)); #current for t=tow sec(A)
#Result
print "current for t=0 sec is",i1,"A"
print "current for t=0.002 sec is",round(i2,2),"A"
print "current for t=0.04 sec is",round(i3,2),"A"
print "current for t=tow sec is",round(i4,3),"A"
#importing modules
import math
from __future__ import division
#Variable declaration
L=0.5; #inductance(H)
R=5; #resistance(ohm)
E=2; #voltage(V)
t=0.2; #time(sec)
#Calculation
tow=L/R; #time(sec)
a=E/R;
i=a*(1-math.exp(-t/tow)); #current(A)
dibydt=(E-(R*i))/L; #rate of growth of current(A/s)
E=(1/2)*L*(i**2); #energy stored by inductor(J)
#Result
print "rate of growth of current is",round(dibydt,2),"A/s"
print "energy stored by inductor is",round(E,2),"J"
#importing modules
import math
from __future__ import division
#Variable declaration
L=10; #inductance(H)
R=10; #resistance(ohm)
E=10; #voltage(V)
t1=0.3; #time(sec)
t2=0.5; #time(sec)
t3=1; #time(sec)
#Calculation
tow=L/R; #time(sec)
i0=E/R;
i1=i0*math.exp(-t1/tow); #current for t=0.3 sec(A)
i2=i0*math.exp(-t2/tow); #current for t=0.5 sec(A)
i3=i0*math.exp(-t3/tow); #current for t=1 sec(A)
#Result
print "current for t=0.3 sec is",round(i1,2),"A"
print "current for t=0.5 sec is",round(i2,2),"A"
print "current for t=1 sec is",round(i3,2),"A"
#importing modules
import math
from __future__ import division
#Variable declaration
E=5; #voltage(V)
C=2*10**-6; #capacitor(F)
R=1*10**6; #resistance(ohm)
t=1; #time(sec)
v=40/100; #decay value(%)
#Calculation
q=E*C*(1-math.exp(-t/(R*C))); #charge on plates(C)
Vc=q/C; #voltage drop across capacitor(V)
i0=E/R;
i=i0*math.exp(-t/(R*C)); #current in circuit(A)
V=i*R; #voltage drop across resistor(V)
E=(1/2)*C*(Vc**2); #energy stored by capacitor(J)
tow=R*C; #time constant(sec)
t=2*math.log(1/v); #time taken(sec)
#Result
print "voltage drop across capacitor is",round(Vc,2),"V"
print "current in circuit is",int(i*10**6),"micro A"
print "voltage drop across resistor is",int(V),"V"
print "energy stored by capacitor is",round(E*10**6,1),"*10**-6 J"
print "time constant is",tow,"sec"
print "time taken is",round(t,4),"sec"
#importing modules
import math
from __future__ import division
#Variable declaration
L=1*10**-3; #inductance(H)
C=0.1*10**-6; #capacitor(F)
R=1; #resistance(ohm)
#Calculation
a=1/(L*C);
b=(R**2)/(4*(L**2));
omega=math.sqrt(a-b); #angular frequency(per sec)
Q=omega*L/R; #Q-factor
#Result
print "angular frequency is",round(omega),"per sec"
print "answer varies due to rounding off errors"
print "Q-factor is",round(Q)
#importing modules
import math
from __future__ import division
#Variable declaration
#v=7sin(314+pi/6)
v=7;
R=100; #resistance(ohm)
#Calculation
Im=v/R; #maximum current(A)
Irms=Im/math.sqrt(2); #rms value of current(A)
Vrms=v/math.sqrt(2);
P=Vrms*Irms; #average power(W)
#Result
print "maximum current is",Im,"A"
print "rms value of current is",round(Irms,2),"A"
print "average power is",round(P,3),"W"
#importing modules
import math
from __future__ import division
#Variable declaration
#V=7sin(314t+pi/6)
v=7;
omega=314;
L=0.05; #inductance(H)
#Calculation
XL=omega*L;
betaL=1/XL; #susceptance(per ohm)
i=v*betaL; #current through inductor
Im=i;
Irms=Im/math.sqrt(2); #rms current(A)
P=0; #power loss
#Result
print "susceptance is",round(betaL,4),"per ohm"
print "current through inductor is",round(i,2),"sin(314t-math.pi/3)"
print "rms current is",round(Irms,2),"A"
print "power loss is",P
#importing modules
import math
from __future__ import division
#Variable declaration
#V=7sin(314t+pi/6)
v=7;
omega=314;
C=0.05*10**-6; #capacitance(F)
#Calculation
XC=1/(omega*C); #value of XC
i=v/XC; #current through capacitor
Im=i;
Irms=Im/math.sqrt(2); #rms current(A)
P=0; #power loss
#Result
print "value of XC is",round(XC/10**3,1),"K ohm"
print "current through capacitor is",i*10**3,"*10**-3 sin(314t+2*math.pi/3)"
print "rms current is",int(Irms*10**6),"micro A"
print "power loss is",P
#importing modules
import math
from __future__ import division
#Variable declaration
V1=110; #voltage(V)
P=40; #power(W)
V2=230; #voltage(V)
#Calculation
RB=V1**2/P; #resistance of bulb(ohm)
i=V1/RB; #electric current through bulb(A)
Z=V2/i; #series resistance(ohm)
R=Z-RB; #pure resistance(ohm)
XL=math.sqrt((Z**2)-(RB**2));
L=XL/314; #inductance(H)
#Result
print "pure resistance is",R,"ohm"
print "inductance is",round(L,3),"H"
#importing modules
import math
from __future__ import division
#Variable declaration
C=10**-6; #capacitance(F)
L=10*10**-3; #inductance(H)
R=1*10**3; #resistance(ohm)
#Calculation
fr=1/(2*math.pi*math.sqrt(L*C)); #resonant frequency(Hz)
Z=L/(C*R); #impedence(ohm)
#Result
print "resonant frequency is",round(fr/10**3,3),"KHz"
print "impedence is",Z,"ohm"
#importing modules
import math
from __future__ import division
#Variable declaration
C=5*10**-6; #capacitance(F)
R=10; #resistance(ohm)
new=50; #frequency(Hz)
#Calculation
omega=2*math.pi*new;
L=1/(C*(omega**2)); #self inductance(H)
#Result
print "self inductance is",round(L,3),"H"
#importing modules
import math
from __future__ import division
#Variable declaration
C=0.1*10**-6; #capacitance(F)
L=1*10**-3; #inductance(H)
R=10; #resistance(ohm)
#Calculation
omega0=1/math.sqrt(L*C); #resonant frequency(rad/sec)
d=R/L; #difference between two half power points
cosphi=R/R; #power factor at resonance
#Result
print "resonant frequency is",omega0/10**5,"*10**5 rad/sec"
print "power factor at resonance is",cosphi
#importing modules
import math
from __future__ import division
#Variable declaration
C=0.1*10**-6; #capacitance(F)
L=10*10**-3; #inductance(H)
R=10; #resistance(ohm)
#Calculation
Z=L/(C*R); #impedence at resonance(ohm)
#Result
print "impedence at resonance is",Z/10**4,"*10**4 ohm"
#importing modules
import math
from __future__ import division
#Variable declaration
C=5*10**-6; #capacitance(F)
L=10*10**-3; #inductance(H)
R=10*10**3; #resistance(ohm)
#Calculation
omegar=1/math.sqrt(L*C); #resonant frequency(Hz)
omegar=round(omegar/10**3,1);
delta_omega=1/(R*C); #bandwidth(Hz)
Q=omegar*10**3/delta_omega; #Q-factor
#Result
print "resonant frequency is",omegar,"*10**3 Hz"
print "bandwidth is",delta_omega,"Hz"
print "Q-factor is",Q