import math
from math import sqrt
I5=0.2 #amplitude of 5th harmonic current in Kilo Amperes
Vp= 11/(sqrt(3)) #Input supply phase voltage in Kilo Volts
P=5 #supply power per phase of filter in MVAR
Pc=P+((Vp**2*I5**2)/(5*P)) #AC Converter power per phase in MVAR
Pc=round(Pc,2)
print 'value of AC converter power=Pc=',Pc,'MVAR'
C=(Pc*10**3*3) /(11**2*314) #capacitance of the ShuntFilter in milliFarad
C=round(C,2)
print 'value of the capacitance of shunt filter=C =',C,'millifarads'
L=(106*10**6)/(400*4*25*250*3.14**2) #inductance of filter in mHenry
L=round(L,2)
print 'Inductance of filter=L=',L,'milliHenry'
Q=50 #value of Q
W5=2*3.14*5*50 #angular frequency of 5th harmonic
R=(W5*L)/Q #Resistance of filter in milliOhms
R=round(R,2)
print 'Resistance of filter=R=',R,'milliOhms'
import math
print 'For six pulse converter most effective harmonic is 6th and for worst case a=90 degree'
Wv=24.1 #voltage ripple in percentage
print 'voltage ripple=Wv=',Wv,'percent'
Id=200.0
I6=(5*Id)/100 #Harmonic current for 6th harmonic in amp
I6=round(I6,1)
print 'Harmonic current for 6th harmonic=I6=',I6,'amp'
Edc=460.0 #dc voltage in volts
W=2*3.14*50
La=1.0 #inductance already present in the circuit in milliHenry
L=((Wv*Edc*10)/(I6*6*W))-La #additional inductance required in milliHenry
L=5.93-1.0
L=round(L,2)
print 'additional inductance required=L=',L,'milliHenry'
import math
from math import sqrt,pi
Id=200 #rated dc current in amperes
I2=0.817*Id #AC line current in amperes
print 'AC line current of the thyristor=I2=',I2,'amperes'
E2=415 #AC line voltage in volts
Edc=400 #dc terminal voltage in volts
Xt=0.04*E2/I2 #effective reactance of the thyristor in ohms
Xt=round(Xt,2)
print 'effective reactance of the thyristor=Xt=',Xt,'ohms'
C=1-((Id*Xt)/(E2*sqrt(3))) #cosine value of the commutational angle
C=round(C,2)
print 'cosine value of the commutational angle=C=',C
CA=math.acos(C)*180/pi
CA=round(CA,2)
print 'commutation angle=CA=',CA,'degrees'
F=Edc/(1.35*E2*(1+C)/2) #cosine value of the firing angle
F=round(F,2)
print 'cosine value of the firing value=F=',F
FA=math.acos(F)*180/pi
FA=round(FA,2)
print 'firing angle=FA=',FA,'degrees'
I2=0.817*Id #AC line current in amps
print 'AC line current=I2=',I2,'amps'
Ied=0.58*Id #current through each device in amps
print 'Current through each device=Ied=',Ied,'amps'
PF=F*(1+C)/2 #power factor
PF=round(PF,2)
print 'power factor=PF=',PF
AP=sqrt(3)*E2*I2*PF #active power drawn from the mains in Watts
AP=round(AP,2)
print 'active power drawn from the mains=AP=',AP,'Watts'
RP=sqrt(3)*E2*I2*sqrt(1-PF**2) #reactive power in VAR
RP=round(RP,2)
print 'Reactive power drawn=RP=',RP,'VAR'
import math
from math import pi,sqrt
Id=100 #rated dc current in amperes
I2=0.817*Id #AC line current in amperes
I2=round(I2,2)
print 'AC line current of the thyristor=I2=',I2,'amperes'
E2=230 #AC line voltage in volts
Edc=200 #dc terminal voltage in volts
PF=math.cos(pi/4)*(1+math.cos(pi/10))/2 #power factor
PF=round(PF,2)
print 'power factor=PF=',PF
RP=sqrt(3)*E2*I2*sqrt(1-PF**2) #reactive power to be supplied by shunt compensator in VAR
RP=round(RP,2)
print 'Reactive power to be supplied by shunt compensator=RP=',RP,'VAR'
import math
from math import sqrt
I11=400/11 #amplitude of 11th harmonic current in Amperes
V1= 11/(sqrt(3)) #Input supply phase voltage in Kilo Volts
P=7 #supply power per phase of f i l t e r in MVAR/
Pc=P+((V1**2*I11**2*10**-3)/(11*P)) #AC Converter MVAR rating of the capacitor
Pc=round(Pc,2)
print 'value of MVAR rating of the capacitor=Pc=',Pc,'MVAR'
W=2*3.14*50
C=(Pc*10**6)/(V1**2*W) #capacitance of the ShuntFilter in microFarad
C=round(C,2)
print 'value of the capacitance of shunt filter=C =',C,'microfarads'
W11=11*W
L=10**8/(C*W11**2) #inductance of filter in mHenry
L=round(L,2)
print 'Inductance of filter=L=',L,'milliHenry'
Q=35 #value of Q
R=(W11*L)/Q #Resistance of filter in milliOhms
R=round(R,2)
print 'Resistance of filter=R=',R,'milliOhms'
import math
print 'For six pulse converter most effective harmonic is 6th and for worst case a=90 degree'
h=6.0
Wv=24.1 #voltage ripple in percentage
print 'voltage ripple=Wv=',Wv,'percent'
Edc=460.0 #dc voltage in volts
W=2*3.14*50
Ldc=6.0 #total dc circuit inductance in milliHenry
I6=Wv*Edc*10/(Ldc*h*W) #Harmonic current for 6th harmonic in amp
I6=round(I6,2)
print 'Harmonic current for 6th harmonic=I6=',I6,'amp'
Id=300.0
Wi=100*I6/Id #maximum value of current ripple in percentage
Wi=round(Wi,2)
print 'max. value of current ripple=Wi=',Wi,'percent'
import math
from math import pi,sqrt
#given
A=pi/4
h=6
#calculations
Wv=sqrt(2)*sqrt(h**2-math.cos(A)**2*(h**2-1))*100/(h**2-1)
Wv=round(Wv,2)
print 'voltage ripple of the 6th harmonic=Wv=',Wv,'percent'
print 'For six pulse converter most effective harmonic is 6th and for worst case A=90degrees'
A=pi/2
Wv6=sqrt(2)*sqrt(h**2-math.cos(A)**2*(h**2-1))*100/(h**2-1) #maximum voltage ripple in percentage
Wv6=round(Wv6,2)
print 'maximum voltage ripple=Wv6=',Wv6,'percent'
A=pi/4
h=12
Wv=sqrt(2)*sqrt(h**2-math.cos(A)**2*(h**2-1))*100/(h**2-1)
Wv=round(Wv,2)
print 'voltage ripple of the 12th harmonic=Wv=',Wv,'percent'
A=pi/2
Wv12=sqrt(2)*sqrt(h**2-math.cos(A)**2*(h**2-1))*100/(h**2-1) #maximum voltage ripple in percentage
Wv12=round(Wv12,2)
print 'maximum voltage ripple=Wv12=',Wv12,'percent'
PR=(Wv6-Wv12)*100/Wv6 #percentage reduction in max. voltage ripple
PR=round(PR,2)
print 'percentage reduction in max. voltage ripple=PR=',PR,'percent'
import math
from math import sqrt
#givem
Wv=18.6
h=6
#calculations
C=sqrt(14.68/35) #cosine of triggering angle
C=round(C,2)
print 'cosine of triggering angle=C=',C
A=math.acos(C)*180/pi
A=round(A,2)
print 'triggering angle of the device=A=',A,'degrees'
import math
from math import pi,sqrt
E2=415 #AC line voltage in volts
Edc=380 #dc terminal voltage in volts
C=1.1*Edc/(1.35*E2)
C=round(C,2)
print 'cosine of the triggering angle=C=',C
A=math.acos(C)*180/pi
A=round(A,2)
print 'triggering angle of the device=A=',A,'degrees'
PF=C*(1+math.cos(pi/12))/2 #power factor
PF=round(PF,2)
print 'power factor=PF=',PF
Id=200
I2=0.817*Id
RP=sqrt(3)*E2*I2*sqrt(1-PF**2)/1000 #reactive power to be supplied by shunt compensator in KVAR
RP=round(RP,2)
print 'Reactive power to be supplied by shuntcompensator=RP=',RP,'KVAR'