import math
#initialisation of variables
V_s=230.0
V_m=math.sqrt(2)*V_s
a=45.0
#Calculations
V_or=(V_m/2)*math.sqrt(1/math.pi*((2*math.pi-a*math.pi/180)+math.sin(math.radians(2*a))/2))
R=20
I_or=V_or/R
P_o=I_or**2*R
I_s=I_or
VA=V_s*I_s
pf=P_o/VA
V_o=math.sqrt(2)*V_s/(2*math.pi)*(math.cos(math.radians(a))-1)
I_ON=V_o/R
#Results
print("rms value of o/p voltage=%.3f V" %V_or)
print("load power=%.1f W" %P_o)
print("i/p pf=%.4f" %pf)
print("avg i/p current=%.4f A" %I_ON)
import math
#initialisation of variables
V_s=230.0
V_m=math.sqrt(2)*V_s
a=45.0
#Calculations
V_or=(V_s)*math.sqrt(1/math.pi*((math.pi-a*math.pi/180)+math.sin(math.radians(2*a))/2))
R=20
I_or=V_or/R
P_o=I_or**2*R
I_s=I_or
VA=V_s*I_s
pf=P_o/VA
I_TA=math.sqrt(2)*V_s/(2*math.pi*R)*(math.cos(math.radians(a))+1)
I_Tr=math.sqrt(2)*V_s/(2*R)*math.sqrt(1/math.pi*((math.pi-a*math.pi/180)+math.sin(math.radians(2*a))/2))
#Results
print("rms value of o/p voltage=%.3f V" %V_or)
print("load power=%.2f W" %P_o)
print("i/p pf=%.2f" %pf)
print("avg thyristor current=%.2f A" %I_TA)
print("rms value of thyristor current=%.2f A" %I_Tr)
import math
#initialisation of variables
V_s=230.0
n=6.0 #on cycles
m=4.0 #off cycles
#Calculations
k=n/(n+m)
V_or=V_s*math.sqrt(k)
pf=math.sqrt(k)
R=15
I_m=V_s*math.sqrt(2)/R
I_TA=k*I_m/math.pi
I_TR=I_m*math.sqrt(k)/2
#Results
print("rms value of o/ voltage=%.2f V" %V_or)
print("i/p pf=%.2f" %pf)
print("avg thyristor current=%.2f A" %I_TA)
print("rms value of thyristor current=%.2f A" %I_TR)
import math
#initialisation of variables
V_s=230.0
V_m=math.sqrt(2)*V_s
R=3.0
#Calculations
I_TAM1=2*V_m/(2*math.pi*R)
I_TRM2=V_m/(2*R)
f=50
w=2*math.pi*f
t_c=math.pi/w
#Results
print("max value of avg thyristor current=%.3f A" %I_TAM1)
print("max value of avg thyristor current=%.3f A" %I_TRM2)
print("ckt turn off time=%.0f ms" %(t_c*1000))
import math
#initialisation of variables
R=3.0
X_L=4.0
#Calculations
phi=math.degrees(math.atan(X_L/R))
V_s=230
Z=math.sqrt(R**2+X_L**2)
I_or=V_s/Z
P=I_or**2*R
I_s=I_or
pf=P/(V_s*I_s)
I_TAM=math.sqrt(2)*V_s/(math.pi*Z)
I_Tm=math.sqrt(2)*V_s/(2*Z)
f=50
w=2*math.pi*f
di=math.sqrt(2)*V_s*w/Z
#Results
print("min firing angle=%.2f deg" %phi)
print("\nmax firing angle=%.0f deg" %180)
print("i/p pf=%.1f" %pf)
print("max value of rms load current=%.0f A" %I_or)
print("max power=%.0f W" %P)
print("max value of avg thyristor current=%.3f A" %I_TAM)
print("max value of rms thyristor current=%.3f A" %I_Tm)
print("di/dt=%.0f A/s" %di)
import math
#initialisation of variables
V=230.0
R=3.0 #ohm
X_L=5.0 #ohm
a=120.0 #firing angle delay
#Calculations
phi=math.degrees(math.atan(X_L/R))
b=0
i=1
while (i>0) :
LHS=math.sin(math.radians(b-a))
RHS=math.sin(math.radians(a-phi))*math.exp(-(R/X_L)*(b-a)*math.pi/180)
if math.fabs(LHS-RHS)<= 0.01 :
B=b
i=2
break
b=b+.1
V_or=math.sqrt(2)*V*math.sqrt((1/(2*math.pi))*((B-a)*math.pi/180+(math.sin(math.radians(2*a))-math.sin(math.radians(2*B)))/2))
#Results
print("Extinction angle=%.1f deg" %B) #answer in the book is wrong as formulae for RHS is wrongly employed
print("rms value of output voltage=%.2f V" %V_or) #answer do not match due to wrong B in book
import math
#initialisation of variables
V_s=230.0
V_m=math.sqrt(2)*V_s
a=60.0
R=20.0
#Calculations
V_or=math.sqrt((V_m**2/(2*math.pi))*(a*math.pi/180-math.sin(math.radians(2*a))/2)+(2*V_m**2/(math.pi))*(math.pi-a*math.pi/180+math.sin(math.radians(2*a))/2))
I_T1r=(V_m/R)*math.sqrt(1/math.pi*((math.pi-a*math.pi/180)+math.sin(math.radians(2*a))/2))
I_T3r=(V_m/(2*R))*math.sqrt(1/math.pi*((a*math.pi/180)-math.sin(math.radians(2*a))/2))
I1=math.sqrt(2)*I_T1r
I3=math.sqrt((math.sqrt(2)*I_T1r)**2+(math.sqrt(2)*I_T3r)**2)
r=V_s*(I1+I3)
P_o=V_or**2/R
pf=P_o/r
#Results
print("rms value of o/p voltage=%.2f V" %V_or)
print("rms value of current for upper thyristors=%.2f A" %I_T1r)
print("rms value of current for lower thyristors=%.2f A" %I_T3r)
print("t/f VA rating=%.2f VA" %r)
print("i/p pf=%.2f" %pf)