import math
#initialisation of variables
V_s=400.0 #V
V_o=100.0 #V
L=100.0 #uH
C=30.0 #uF
#Calculations
t_o=math.pi*math.sqrt(L*C)
print("conduction time of diode = %.2f us" %t_o)
#in book solution is t_o=54.77 us. The ans is incorrect as %pi is not muliplied in ans. Formulae mentioned in correct.
I_p=(V_s-V_o)*math.sqrt(C/L)
#Results
print("Peak current through diode=%.2f A" %I_p)
v_D=-V_s+V_o
print("Voltage across diode = %.2f V" %v_D)
import math
#initialisation of variables
R=10 #ohm
L=0.001 #H
C=5*10**-6 #F
V_s=230 #V
xi=R/(2*L)
#Calculations
w_o=1/math.sqrt(L*C)
w_r=math.sqrt((1/(L*C))-(R/(2*L))**2)
t=math.pi/w_r
#Results
print('Conduction time of diode=%.3f us'%(t*10**6))
t=0
di=V_s/L
print('Rate of change of current at t=0 is %.2f A/s' %di)
import math
#initialisation of variables
I_or=100 #A
R=1.0 #assumption
#Calculations
V_m=I_or*2*R
I_o=V_m/(math.pi*R)
q=200 #Ah
t=q/I_o
#Results
print("time required to deliver charge=%.02f hrs" %t)
import math
#initialisation of variables
V_s=230.0 #V
P=1000 #W
R=V_s**2/P
#Calculations
V_or=math.sqrt(2)*V_s/2
P_h=V_or**2/R
print("Power delivered to the heater = %.2f W" %P_h)
V_m=math.sqrt(2)*230
I_m=V_m/R
#Results
print("Peak value of diode current = %.2f A" %I_m)
pf=V_or/V_s
print("Input power factor=%.2f" %pf)
import math
#initialisation of variables
V_s=230 #V
V_m=V_s*math.sqrt(2)
E=150 #V
#Calculations
theta1=math.degrees(E/(math.sqrt(2)*V_s))
R=8 #ohm
f=50 #Hz
I_o=(1/(2*math.pi*R))*((2*math.sqrt(2)*V_s*math.cos(math.radians(theta1)))-E*(math.pi-2*theta1*math.pi/180))
#Results
print("avg value of charging current=%.2f A" %I_o)
P_d=E*I_o
print("\npower delivered to battery=%.2f W" %P_d)
I_or=math.sqrt((1/(2*math.pi*R**2))*((V_s**2+E**2)*(math.pi-2*theta1*math.pi/180)+V_s**2*math.sin(math.radians(2*theta1))-4*V_m*E*math.cos(math.radians(theta1))))
print("\nrms value of the load current=%.2f A" %I_or)
pf=(E*I_o+I_or**2*R)/(V_s*I_or)
print("\nsupply pf=%.3f" %pf)
P_dd=I_or**2*R
print("\npower dissipated in the resistor=%.2f W" %P_dd)
q=1000.00 #Wh
t=q/P_d
print("\ncharging time=%.2f hr" %t)
n=P_d*100/(P_d+P_dd)
print("rectifier efficiency =%.2f " %n)
PIV=math.sqrt(2)*V_s+E
print("PIV of diode=%.2f V" %PIV)
#solutions have small variations due to difference in rounding off of digits
import math
#initialisation of variables
V_s=230 #V
t_rr=40*10**-6 #s reverde recovery time
#Calculations
V_o=2*math.sqrt(2)*V_s/math.pi
V_m=math.sqrt(2)*V_s
f=50
V_r1=(V_m/math.pi)*(1-math.cos(math.radians(2*math.pi*f*t_rr*180/math.pi)))
v_avg1=V_r1*100/V_o*10**3
f=2500
V_r2=(V_m/math.pi)*(1-math.cos(math.radians(2*math.pi*f*t_rr*180/math.pi)))
v_avg2=V_r2*100/V_o
#Results
print("when f=50Hz")
print("Percentage reduction in avg o/p voltage=%.2f x 10^-3" %v_avg1)
print("when f=2500Hz")
print("Percentage reduction in avg o/p voltage = %.3f" %v_avg2)
import math
#initialisation of variables
V_s=230 #V
R=10.0 #ohm
#Calculations
V_m=math.sqrt(2)*V_s
V_o=2*V_m/math.pi
print("Avg value of o/p voltage = %.2f V" %V_o)
I_o=V_o/R
print("Avg value of o/p current = %.2f A" %I_o)
I_DA=I_o/2
print("Avg value of diode current=%.2f A" %I_DA)
I_Dr=I_o/math.sqrt(2)
#Results
print("rms value of diode current=%.2f A" %I_Dr)
print("rms value of o/p current = %.2f A" %I_o)
print("rms value of i/p current = %.2f A" %I_o)
pf=(V_o/V_s)
print("supply pf = %.2f" %pf)
import math
#initialisation of variables
V_s=230.0 #V
R=1000.0 #ohm
R_D=20.0 #ohm
#Calculations
V_m=math.sqrt(2)*V_s
I_om=V_m/(R+R_D)
#Results
print("Peak load current = %.2f A" %I_om)
I_o=I_om/math.pi
print("dc load current = %.2f A" %I_o)
V_D=I_o*R_D-V_m/math.pi
print("dc diode voltage = %.2f V" %V_D)
V_on=V_m/math.pi
print("at no load, load voltage = %.2f V" %V_on)
V_o1=I_o*R
print("at given load, load voltage = %.2f V" %V_o1)
vr=(V_on-V_o1)*100/V_on
print("Voltage regulation(in percent)=%.2f" %vr)
import math
#initialisation of variables
V_L=6.8 #V
V_smax=20*1.2 #V
V_smin=20*.8 #V
I_Lmax=30*1.5 #mA
I_Lmin=30*0.5 #mA
I_z=1 #mA
#Calculations
R_smax=(V_smax-V_L)/((I_Lmin+I_z)*10**-3)
print("max source resistance = %.2f ohm" %R_smax)
R_smin=(V_smin-V_L)/((I_Lmax+I_z)*10**-3)
print("Min source resistance = %.2f ohm" %R_smin) #in book solution, error is committed in putting the values in formulea(printing error) but solution is correct
R_Lmax=V_L*1000/I_Lmin
print("Max load resistance = %.2f ohm" %R_Lmax)
R_Lmin=V_L*1000/I_Lmax
V_d=0.6 #V
V_r=V_L-V_d
#Results
print("Min load resistance=%.2f ohm" %R_Lmin)
print("Voltage rating of zener diode=%.2f V" %V_r)
import math
#initialisation of variables
I2=200*10**-6 #A
V_z=20 #V
R_G=500.0 #hm
#Calculations
R2=(V_z/I2)-R_G
print("R2=%.2f kilo-ohm" %(R2/1000))
V_v=25 #V
I1=I2
R1=(V_v-V_z)/I1
#Results
print("R1=%.0f kilo-ohm"%(R1/1000))
import math
#initialisation of variables
V_s=2*230 #V
#Calculations
V_o=(math.sqrt(2)*V_s)/math.pi
R=60 #ohm
P_dc=(V_o)**2/R
TUF=0.2865
VA=P_dc/TUF
#RESULTS
print("kVA rating of the transformer = %.2f kVA" %(VA/1000));
import math
#initialisation of variables
tr=0.5 #turns ratio
I_o=10.0
V=230.0
V_s=V/tr
#Calculations
V_m=math.sqrt(2)*V_s
V_o=2*V_m/math.pi
phi1=0
#displacemnt angle=0 as fundamnetal component of i/p source current in phase with source voltage
DF=math.cos(math.radians(phi1))
I_s1=4*I_o/(math.sqrt(2)*math.pi)
I_s=math.sqrt(I_o**2*math.pi/math.pi)
CDF=I_s1/I_o
pf=CDF*DF
HF=math.sqrt((I_s/I_s1)**2-1)
CF=I_o/I_s
#Results
print("o/p voltage = %.2f V" %V_o)
print("distortion factor = %.2f" %DF)
print("i/p pf=%.2f" %pf)
print("Current displacent factor=%.2f" %CDF)
print("Harmonic factor = %.2f" %HF)
print("Creast factor = %.2f" %CF)
import math
#initialisation of variables
V_o=230.0
R=10.0
V_s=V_o*math.pi/(2*math.sqrt(2))
I_o=V_o/R
I_m=math.sqrt(2)*V_s/R
I_DAV=I_m/math.pi
#Calculations
#avg value of diode current
I_Dr=I_m/2
PIV=math.sqrt(2)*V_s
I_s=I_m/math.sqrt(2)
TF=V_s*I_s
#Results
print("peak diode current=%.2f A" %I_m)
print("I_DAV=%.2f A" %I_DAV)
print("I_Dr=%.2f A" %I_Dr) #rms value of diode current
print("PIV=%.1f V" %PIV)
print("Transformer rating = %.2f kVA" %(TF/1000))
import math
#initialisation of variables
tr=5
V=1100.0
R=10.0
#Calculations
print("In case of 3ph-3pulse type")
V_ph=V/tr
V_mp=math.sqrt(2)*V_ph
V_o=3*math.sqrt(3)*V_mp/(2*math.pi)
print("avg o/p voltage=%.1f V" %V_o)
I_mp=V_mp/R
I_D=(I_mp/math.pi)*math.sin(math.pi/3)
print("\navg value of diode current=%.3f A" %I_D)
I_Dr=I_mp*math.sqrt((1/(2*math.pi))*(math.pi/3+.5*math.sin(2*math.pi/3)))
print("\nrms value of diode current=%.2f A" %I_Dr)
V_or=V_mp*math.sqrt((3/(2*math.pi))*(math.pi/3+.5*math.sin(2*math.pi/3)))
P=(V_or**2)/R
print("\npower delivered=%.1f W" %P)
print("in case of 3ph-M6 type")
V_ph=V_ph/2
V_mp=math.sqrt(2)*V_ph
V_o=3*V_mp/(math.pi)
I_mp=V_mp/R
I_D=(I_mp/math.pi)*math.sin(math.pi/6)
I_Dr=I_mp*math.sqrt((1/(2*math.pi))*(math.pi/6+.5*math.sin(2*math.pi/6)))
V_or=V_mp*math.sqrt((6/(2*math.pi))*(math.pi/6+.5*math.sin(2*math.pi/6)))
P=(V_or**2)/R
#Results
print("avg o/p voltage=%.2f V" %V_o)
print("\navg value of diode current=%.2f A" %I_D)
print("\nrms value of diode current=%.2f A" %I_Dr)
print("\npower delivered=%.0f W" %P)
import math
#initialisation of variables
V_o=400
R=10
#Calculations
V_ml=V_o*math.pi/3
V_s=V_ml/(math.sqrt(2)*math.sqrt(3))
I_m=V_ml/R
I_s=.7804*I_m
tr=3*V_s*I_s
#Results
print("transformer rating=%.1f VA" %tr)
I_Dr=.5518*I_m
print("\nrms value of diode current=%.3f A" %I_Dr)
I_D=I_m/math.pi
print("\navg value of diode current=%.3f A" %I_D)
print("\npeak diode current=%.2f A" %I_m)
PIV=V_ml
print("\nPIV=%.2f V" %PIV)
import math
#initialisation of variables
V_l=230
E=240
R=8
#Calculations
V_ml=math.sqrt(2)*V_l
V_o=3*V_ml/math.pi
I_o=(V_o-E)/R
P_b=E*I_o
P_d=E*I_o+I_o**2*R
phi1=0
math.cos(math.radians(phi1))
I_s1=2*math.sqrt(3)*I_o/(math.sqrt(2)*math.pi)
I_s=math.sqrt(I_o**2*2*math.pi/(3*math.pi))
CDF=I_s1/I_s
pf=DF*CDF
HF=math.sqrt(CDF**-2-1)
tr=math.sqrt(3)*V_l*I_o*math.sqrt(2/3)
#Results
print("Power delivered to battery=%.1f W" %P_b)
print("Power delivered to load=%.2f W" %P_d)
print("Displacement factor=%.2f" %DF)
print("Current distortion factor=%.3f" %CDF)
print("i/p pf=%.3f"%pf)
print("Harmonic factor=%.2f" %HF)
print("Tranformer rating=%.2f VA" %tr)
#answers have small variations from the book due to difference in rounding off of digits
import math
#initialisation of variables
f=50 #Hz
V=230.0
#Calculations
V_m=math.sqrt(2)*V
R=400.0
RF=0.05
C=(1/(4*f*R))*(1+(1/(math.sqrt(2)*RF)))
#Results
print("capacitor value=%.2f uF" %(C/10**-6))
V_o=V_m*(1-1/(4*f*R*C))
print("o/p voltage with filter=%.2f V" %V_o)
V_o=2*V_m/math.pi
print("o/p voltage without filter=%.2f V" %V_o)
import math
#initialisation of variables
f=50
CRF=0.05
R=300
#Calculations
L=math.sqrt((CRF/(.4715*R))**-2-R**2)/(2*2*math.pi*f)
print("L=%.2f H" %L)
R=30
L=math.sqrt((CRF/(.4715*R))**-2-R**2)/(2*2*math.pi*f)
#Results
print("\nL=%.2f H" %L)
L=0
CRF=.4715*R/math.sqrt(R**2+(2*2*math.pi*f*L)**2)
print("\nCRF=%.2f" %CRF)
import math
#initialisation of variables
R=50
L_L=10*10**-3
f=50.0
w=2*math.pi*f
#Calculations
C=10/(2*w*math.sqrt(R**2+(2*w*L_L)**2))
#Results
print("C=%.2f uF" %(C*10**6))
VRF=0.1
L=(1/(4*w**2*C))*((math.sqrt(2)/(3*VRF))+1)
print("\nL=%.2f mH" %(L*10**3))