from math import pi, sqrt
#Given data:
R=80 #ohm
L=8 #/mH
C=1.2 # micro F
#Solution :
if R**2<4*(L*10**-3)/(C*10**-6):
print "As R**2<4*L/C, Circuit will work as a series inverter."
else:
print "As R**2>4*L/C, Circuit will not work as a series inverter."
omega_m=sqrt(1/(L*10**-3*C*10**-6)-R**2/4/(L*10**-3)**2) #rad/s
fm=omega_m/2/pi #Hz
print "Maximum frequency = %0.2f Hz" %fm
from math import pi, sqrt
#Given data:
R=80 #ohm
L=8 #/mH
C=1.2 # micro F
Toff=14 #micro sec
#Solution :
omega_m=sqrt(1/(L*10**-3*C*10**-6)-R**2/4/(L*10**-3)**2) #rad/s
fm=omega_m/2/pi #Hz
T=1/fm #sec
f=1/(T+2*Toff*10**-6) #Hz
print "Frequency of output = %0.1f Hz" %f
from __future__ import division
from math import pi, sqrt
#Given data:
RL=3 #in ohm
V=30 #in V
#Solution :
Vpeak=2*V/pi #V
Vrms=Vpeak/sqrt(2) #V
print "(a) RMS value of output voltage = %0.1f " %Vrms
#VL=sqrt(2/T*integrate('(V/2)**2','t',0,T/2)) #V
VL=V/2 #V
Pout=VL**2/RL #W
print "(b) Output power = %0.f W " %Pout
Ipeak=VL/RL #A
print "(c) Peak current in thyristor = %0.f A " %Ipeak
Iavg=Ipeak*50/100 #A
print "(d) Average current of each thyristor = %0.1f A" %Iavg
Vprb=2*VL #V
print "(e) Peak reverse braking voltage = %0.f V " %Vprb
from math import pi, sqrt
#Given data:
RL=3 #in ohm
V=30 #in V
#Solution :
Vpeak=4*V/pi #V
Vrms=Vpeak/sqrt(2) #V
print "(a) RMS value of output voltage = %0.f V" %Vrms
#VL=sqrt(2/T*integrate('V**2','t',0,T/2)) #V
VL=V #V
Pout=VL**2/RL #W
print "(b) Output power = %0.f W " %Pout
Ipeak=VL/RL #A
print "(c) Peak current in thyristor = %0.f A " %Ipeak
Iavg=Ipeak*50/100 #A
print "(d) Average current of each thyristor = %0.f A" %Iavg
Vprb=VL #V
print "(e) Peak reverse braking voltage = %0.f V " %Vprb
from math import pi, sqrt
#Given data:
V=200 #V
R=10 #in ohm
L=20 #mH
C=100 #pF
f=50 #Hz
#Solution :
Z1=R+1J*(2*pi*f*L*10**-3-1/(2*pi*f*C*10**-6)) #ohm
Z3=R+1J*(3*2*pi*f*L*10**-3-1/(3*2*pi*f*C*10**-6)) #ohm
Z5=R+1J*(5*2*pi*f*L*10**-3-1/(5*2*pi*f*C*10**-6)) #ohm
Z7=R+1J*(7*2*pi*f*L*10**-3-1/(7*2*pi*f*C*10**-6)) #ohm
Z9=R+1J*(9*2*pi*f*L*10**-3-1/(9*2*pi*f*C*10**-6)) #ohm
I=4*V/pi/abs(Z1) #A
Irms=I/sqrt(2) #A
print"RMS load current = %0.2f A" % Irms
Ip=sqrt((4*V/pi/abs(Z1))**2+(4*V/3/pi/abs(Z3))**2+(4*V/5/pi/abs(Z5))**2+(4*V/7/pi/abs(Z7))**2+(4*V/9/pi/abs(Z9))**2) #A
print "Peak value of load current = %0.2f A " %Ip
Ih=sqrt(Ip**2-I**2)/sqrt(2) #A
print "RMS harmonic current = %0.3f A " %Ih
hd=sqrt(Ip**2-I**2)/I #harmonic distortion
print "Harmonic distortion = %0.1f %%" %(hd*100)
Irms_load=Ip/sqrt(2) #A
Pout=Irms_load**2*R #W
print "Total output power = %0.1f W " %Pout
Pout_com=Irms**2*R #W(fundamental component)
print "Fundamental component of power = %0.2f W " %Pout_com
Iavg_in=Pout/V #A
print "Average input current = %0.4f A " %Iavg_in
Ip_thy=Ip #A
print "Peak thyristor current = %0.2f A " %Ip_thy
from math import pi, sqrt, tan
#Given data:
R=2 #in ohm
XL=10 #ohm
f=4 #kHz
Toff=12 #micro sec
#Solution :
Toff_time=Toff*1.5 #micro sec
theta=2*pi*f*10**3*Toff_time*10**-6 #radians
Xc=tan(theta)*R+XL #ohm
C=1/(2*pi*f*1000*Xc) #F
print "Value of Capacitance = %0.2e F" %C
from math import sqrt
#Given data:
V=400 #V
R=10 #in ohm/phase
#Solution :
Ipeak=V/2/R #A
Irms=sqrt(Ipeak**2*2/3) #A
print "RMS load current = %0.2f A" %Irms
Pout=Irms**2*R*3 #W
print "Power output = %0.f W " %Pout
Iavg=Ipeak/3 #A
print "Average thyristor current = %0.2f A " %Iavg
Irms_thyristor=sqrt(Ipeak**2/3) #A
print "RMS value of thyristor current = %0.2f A " %Irms_thyristor
from __future__ import division
from math import sqrt, pi
from sympy.mpmath import quad
#Given data:
V=400 #V
R=10 #in ohm/phase
#Solution :
RL=R+R/2 #ohm
i1=V/RL #A
i2=V/RL #A
i3=V/RL #A
Irms_load=sqrt(1/2/pi*(quad(lambda theta:i1**2,[0,2*pi/3])+quad(lambda theta:(i1/2)**2,[2*pi/3,2*pi]))) #A
print "RMS load current = %0.3f A" %Irms_load
Pout=Irms_load**2*R*3 #W
print "Power output = %0.1f W " %Pout
Ipeak=i1 #A
Iavg=1/2/pi*(Ipeak*pi/3+Ipeak/2*2*pi/3) #A
print "Average thyristor current = %0.2f A " %Iavg
Irms_thyristor=sqrt(1/2/pi*(Ipeak**2*pi/3+(Ipeak/2)**2*2*pi/3)) #A
print "RMS value of thyristor current = %0.2f A " %Irms_thyristor