#finding inductance,load impedence
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=220.0;#line voltage
f=50.0;#hertz
R=80.0;#load resistance
K=50.0;#di/dt
#calculation
L=V*2**.5/K;
Z=2*pi*f*L;
#result
print "inductance is",round(L,2),"microH"
print "load impedence at angle 90 degree is",round(Z*1e-6,5), "ohm"
#finding capacitor,current
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=220.0;#line voltage
f=50.0;#hertz
R=80.0;#load resistance
K=75.0;#dv/dt
Vd=400.0;#DRM voltage
#calculation
C=Vd/R/K;
C1=.1;
Z=1/(2*pi*f*C1);
Iload=V/1000/(-Z*cos(180*pi/180)+R*round(cos(90*pi/180)));
Vload=Iload/1000*R;
P=Vload*Iload;
#result
print "minimum value of capacitor is",round(C,3), "micfoF"
print('\nchoose C=.1 micoF')
print "capacitor impedence at angle -90degree is",round(Z*1000,2), "ohm"
print "Load current in mA at an angle 90 degrees is",round(Iload,2)
print "Potential drop in V at an angle 90 degrees is",round(Vload,2)
print "Power dissipated is",int(P), "mW"
#finding snubbing resistance
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=220;#line voltage
f=50;#hertz
R=80;#load resistance
I=46;#TSM current
#calculation
Rs=V*2**.5/(I-V*2**.5/R);
#result
print "snubbing resistnce is",round(Rs,2), "ohm"
#finding voltage , power and cycles
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
R=10.0;#load
V=120.0;#rms voltage
f=60.0;#hertz
T=83.3;#ms
t1=15;#ms
t2=55;#ms
#calculation
Tl=1/f;
Th=Tl/2;
C=round(T/Th/100)*100;
D1=.2;
V1=round(V*D1**.5);
P1=V1**2/R;
D2=.7;
V2=round(V*D2**.5);
P2=V2**2/R;
#result
print "line period is",round(Tl*1000,2), "ms"
print "half-cycle time is",round(Th*1000,3), "ms"
print "no. of cycles is",C/1000
print "voltage for t1 is",round(V1,3), "V"
print "power for t1 is",round(P1,3), "W"
print "voltage for t2 is",round(V2,3), "V"
print "voltage for t2 is",round(P2,3), "W"
#finding dc volatge,average voltage,rms voltage
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=120.0;#line voltage
A=60.0;#degree
D=0.35;
#calculation
Va=D*V;
Vd=V*2**.5*(cos(A*pi/180)+1)/2/pi;
Vr=.9*V;
Vrms=V*(2**.5)*(.5*(pi-1.047)+.25*sin(2*A*pi/180))**.5/pi**.5;
#result
print "average voltage is",round(Va,3), "V"
print "dc voltage is",round(Vd), "V"
print('\nthe markers indicae Vp=163V Vave=41')
print "full-wave rms voltage is",round(Vr), "V"
print "rms voltage is",round(Vrms), "V"
print('\nthe markers indicate Vp=169V ;Vave=106V')
#finding rms voltage and double checked rms voltage
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
V=220.0;#line voltage
P=1.3;#kW
R=15.0;#ohm
#calculation
Vr=round((P*1000*R)**.5);
D=Vr/V;
Vr=V*2**.5*(.5*(pi-1.710)+sin(196*pi/180)/4)**.5/pi**.5;
#result
print "rms voltage is",round(Vr,2), "V"
print "double checked value of rms voltage is",round(Vr,2), "V"