# average voltage
import math
#Variable declaration
Vm=200.0 #in V
theta=30.0 #firing angle in degree
#Calculations
vdc=((Vm/math.pi)*(1+math.cos(theta*math.pi/180)))
#Result
print("average value of voltage is ,(V)= %.f"%(round(vdc)))
# dc load current rms load current amd power dissipiated
import math
#Variable declaration
Va=300.0 # in V
Vm=300.0*math.sqrt(2) # in V
Rl=50.0 #in ohm
theta1=90.0 #firing angle in degree
#Calculations
idc=((Vm/(2*math.pi*Rl))*(1+math.cos(theta1*math.pi/180)))
irms=Va/(2*Rl)
P=irms**2*Rl
#Result
print("(i) The dc load current is ,(A) = %.2f"%idc)
print("(ii) The rms load current is ,(A) = %.f"%(round(irms)))
print("(iii) The power dissipated by the load is ,(W)= %.f"%(round(P)))
# firing angle conducting angle and average current
import math
#Variable declaration
Ih=0.0 #in A
Vi=100.0 #in V
Vm=200.0 #in V
Rl=100.0 #in ohm
#Calculations
theta1=(180/math.pi)*math.asin(Vi/Vm) #firing angle in degree
ca=180-theta1 #conducting angle in dehree
av=((Vm/(2*math.pi))*(1+math.cos(theta1*math.pi/180)))
ac=av/Rl
#Result
print("(i) firing angle is ,(degree) = %.f°"%(theta1))
print("(ii) conducting angle is ,(degree) = %.f°"%ca)
print("(iii) average current is ,(A) = %.4f"%ac)
#average current is wrong in the textbook