# Maximum output frequency
import math
#Variable declaration
R = 80.0 # serries inverter resistance
L = 8*10**-3 # serries inverter inductance
C = 1.2*10**-6 # serries inverter capacitance
#Calculations
X =(4*L)/C
f = math.sqrt((1/(L*C))-((R**2)/(4*L**2)))
f = math.ceil(f)
#Result
print("R^2 = %.0f\n4L/C = %.0f"%(R*R,X))
print("Since (R^2)<(4L/C), circuit is underdamped and it will work as a series inverter.")
print("\nMaximum frequency = %.4f*10^4 rad/sec or %.2f Hz"%(f/10000,f/(2*math.pi)))
# output frequency(refering example 4.1)
import math
#Variable declaration
R = 80.0 # serries inverter resistance
L = 8*10**-3 # serries inverter inductance
C = 1.2*10**-6 # serries inverter capacitance
t = 14*10**-6 # turn off time of thyristor
Fmax = 1416.16 # frequency as calculated in ex 4.1
#Calculation
T =1/Fmax
T = math.floor(T*10**6)/10**6
k = 1/0.000734
f =1/(T+2*t)
#Result
print("frequency = %.1f Hz"%f)
# circuit turn off time and max frequency
import math
#Variable declaration
L = 50.0*10**-6 # Inductance
C = 6.0*10**-6 # capacitance
R = 4.0 # Resistance
V = 200.0 # input voltage
f = 6000.0 # output frequency
t = 6.0*10**-6 # SCR turn off time
#calculations
x = 4*L/C
wr = math.sqrt((1/(L*C))-((R**2)/(4*L**2)))
wr = math.floor(wr*10)/10
fr = wr/(2*math.pi)
#(a)
x1 = math.pi/wr
x1= math.floor(x1*10**7)/10**7
toff = (math.pi/(2*math.pi*f))-(x1)
#(b)
fmax = 1/(2*((x1)+t))
#result
print("(a) Available circuit turn off time = %.2f micro-sec\n(b) fmax = %.1f Hz"%(toff*10**6,fmax))
# thyristor ratings
import math
#Variable declaration
V = 40.0 # input DC voltage
Vo = 230.0 # output voltage
f = 50.0 # output frequency
Il = 2.0 # peak load current
t = 50.0*10**-6 # turn off time
#calculations
Il_r = Vo*2/V
#after solving (i),(ii)
C=((t*3/math.pi)**2)*(((2*Vo)/(V**2))**2)
C = math.sqrt(C)
C = math.ceil(C*10**8)/10**8
L = ((t*3/math.pi)**2)/C
# OR
#L= C/(((2*Vo)/(V**2))**2)
#Result
print("L = %.2f *10^-6 H\nC = %.2f *10^-6 F"%(L*10**6,C*10**6))
print("\nFinal SCR rating is 100V,20A, turn off time 50 micro-sec")
#Single phase half bridge inverter
import math
# variable declaration
R = 3.0 # load resistance
V = 30.0 # input DC voltage
#Calculations
#(a) for n=1;
V1rms = 2*V/(math.sqrt(2)*math.pi)
#(b)
Vl = V/2
P = (Vl**2)/R
#(c)
Ip = Vl/R
#(d)
Iavg = Ip/2
#(e)
Vr = 2*Vl
#Result
print("(a) RMS value V1 = %.1f V\n(b) Output power = %.0f W\n(c) Peak current in each thyristor = %.0f A"%(V1rms,P,Ip))
print("(d)Each thyristor conducts for 50%% of time,\n Average current = %.1f A"%(Iavg))
print("(e) Peak reverse blocking voltage = %.0f V"%Vr)
# full bridge inverter
import math
# variable declaration
R = 3.0 # load resistance
V = 30.0 # input DC voltage
#Calculations
#(a) for n=1;
V1rms = 4*V/(math.sqrt(2)*math.pi)
#(b)
Vl = V
P = (Vl**2)/R
#(c)
Ip = Vl/R
#(d)
Iavg = Ip/2
#(e)
Vr = Vl
#Result
print("(a) RMS value V1 = %.1f V\n(b) Output power = %.0f W\n(c) Peak current in each thyristor = %.0f A"%(V1rms,P,Ip))
print("(d)Each thyristor conducts for 50%% of time,\n Average current = %.1f A"%(Iavg))
print("(e) Peak reverse blocking voltage = %.0f V"%Vr)
# Full bridge inverter circuit
import math
#Variable declaration
V = 200.0 # input voltage
R = 10.0 # resistance
L = 20.0*10**-3 # Inductance
C = 100.0*10**-6 # capacitance
f = 50.0 # inverter frequency
#(a)
Z1_r = R
Z1_i = (2*math.pi*f*L)-(1/(2*math.pi*f*C))
Z1_i = math.floor(Z1_i*100)/100
Z1_mag = math.sqrt((Z1_r**2) + (Z1_i**2))
Z1_angle =math.atan(Z1_i/Z1_r)*(180/math.pi)
Z1_angle = math.floor(Z1_angle*100)/100
Z3_r = R
Z3_i = (3*2*math.pi*f*L)-(1/(3*2*math.pi*f*C))
Z3_i = math.floor(Z3_i*100)/100
Z3_mag = math.sqrt((Z3_r**2) + (Z3_i**2))
Z3_angle =math.atan(Z3_i/Z3_r)*(180/math.pi)
Z3_angle = math.floor(Z3_angle*100)/100
Z5_r = R
Z5_i = (5*2*math.pi*f*L)-(1/(5*2*math.pi*f*C))
Z5_i = math.floor(Z5_i*100)/100
Z5_mag = math.sqrt((Z5_r**2) + (Z5_i**2))
Z5_angle =math.atan(Z5_i/Z5_r)*(180/math.pi)
#Z5_angle = math.floor(Z5_angle*100)/100
Z7_r = R
Z7_i = (7*2*math.pi*f*L)-(1/(7*2*math.pi*f*C))
Z7_i = math.floor(Z7_i*100)/100
Z7_mag = math.sqrt((Z7_r**2) + (Z7_i**2))
Z7_angle =math.atan(Z7_i/Z7_r)*(180/math.pi)
Z7_angle = math.floor(Z7_angle*100)/100
Z9_r = R
Z9_i = (9*2*math.pi*f*L)-(1/(9*2*math.pi*f*C))
Z9_i = math.floor(Z9_i*100)/100
Z9_mag = math.sqrt((Z9_r**2) + (Z9_i**2))
Z9_angle =math.atan(Z9_i/Z9_r)*(180/math.pi)
Z9_angle = math.floor(Z9_angle*100)/100
x = 4*V/(math.pi)
w = 2*math.pi*f
#(b)
I1 = math.floor(x*100/Z1_mag)/100
I3 = math.floor(x*100/(3*Z3_mag))/100
I5 = math.ceil(x*100/(5*Z5_mag))/100
I7 = math.ceil(x*1000/(7*Z7_mag))/1000
I9 = math.ceil(x*1000/(9*Z9_mag))/1000
If = I1/math.sqrt(2)
If = math.floor(If*100)/100
#(c)
Ip =math.sqrt(I1**2+I3**2+I5**2+I7**2+I9**2)
#(d)
Ihc = math.sqrt(Ip**2- I1**2)/math.sqrt(2)
Thd = math.sqrt(Ip**2- I1**2)/I1
#(e)
Ilrms = Ip/math.sqrt(2)
P = R*Ilrms**2
Pf = R*If**2
#(f)
Iavg = P/V
#Result
print("(a)\nZ1 = %.3f < %.2f°"%(Z1_mag,Z1_angle))
print("Z3 = %.2f < %.2f°"%(Z3_mag,Z3_angle))
print("Z5 = %.2f < %.2f°"%(Z5_mag,Z5_angle))
print("Z7 = %.2f < %.2f°"%(Z7_mag,Z7_angle))
print("Z9 = %.2f < %.2f°"%(Z9_mag,Z9_angle))
print("Vl = %.2fsin(%.2ft)+%.2fsin(3*%.2ft)+%.2fsin(5*%.2ft)+%.2fsin(7*%.2ft)+%.2fsin(9*%.2ft)"%(x,w,x/3,w,x/5,w,x/7,w,x/9,w))
print("Il = %.2fsin(%.2ft%.2f°)+%.2fsin(3*%.2ft-%.2f°)+%.2fsin(5*%.2ft-%.2f°)+%.3fsin(7*%.2ft-%.2f°)+%.3fsin(9*%.2ft-%.2f°)"%(I1,w,Z1_angle,I3,w,Z3_angle,I5,w,Z5_angle,I7,w,Z7_angle,I9,w,Z9_angle))
print("\n(b) RMS load current at fundamental frequency = %.2f A"%If)
print("\n(c) Peak value of load current = %.2f A"%Ip)
print("\n(d) RMS harmonic current = %.3f A\n Total harmonic distortion = %.3f or %.1f%%"%(Ihc,Thd,Thd*100))
print("\n(e) RMS value of load current = %.3f A\n Total output power = %.1f W\n Fundamental component of power = %.3f W"%(Ilrms,P,Pf))
print("\n(f) Average input current = %.4f A\n Peak thyristor current = %.2f A"%(Iavg,Ip))
#Some values are accurate only upto 1 or 2 decimal places
# Value of C for proper load communication
import math
#variable declaration
R = 2 # resistance
Xl = 10 # inductive reactance
f = 4*10**3 # operating frequency
T = 12*10**-6 # turn off time of thyristor
tol = 1.5 # 50% tolerance in circuit turn off time
#Calculations
T = T*tol
theta = 2*math.pi*f*T #radians
#theta = theta*180/math.pi
Xc = 2*math.tan(theta)+Xl
C = 1/(Xc*2*math.pi*f)
#Result
print("C = %.2f*10^-6 F"%(C*10**6))
# Full bridge inverter
import math
#variable declaratrion
R = 10 # resistance
L = 50*10**-3 # inductance
f = 50 # frequency
V = 100 # input voltage
#Calculation
#(a)
Z1_r = R
Z1_i = (2*math.pi*f*L)
Z1_i = math.floor(Z1_i*100)/100
Z1_mag = math.sqrt((Z1_r**2) + (Z1_i**2))
Z1_mag = math.ceil(Z1_mag*100)/100
Z1_angle =math.atan(Z1_i/Z1_r)*(180/math.pi)
Z1_angle = math.floor(Z1_angle*100)/100
Z3_r = R
Z3_i = (3*2*math.pi*f*L)
Z3_i = math.floor(Z3_i*100)/100
Z3_mag = math.sqrt((Z3_r**2) + (Z3_i**2))
Z3_angle =math.atan(Z3_i/Z3_r)*(180/math.pi)
Z3_angle = math.floor(Z3_angle*100)/100
Z5_r = R
Z5_i = (5*2*math.pi*f*L)
Z5_i = math.floor(Z5_i*100)/100
Z5_mag = math.sqrt((Z5_r**2) + (Z5_i**2))
Z5_mag = math.ceil(Z5_mag*100)/100
Z5_angle =math.atan(Z5_i/Z5_r)*(180/math.pi)
Z5_angle = math.ceil(Z5_angle*100)/100
Z7_r = R
Z7_i = (7*2*math.pi*f*L)
Z7_i = math.floor(Z7_i*100)/100
Z7_mag = math.sqrt((Z7_r**2) + (Z7_i**2))
Z7_mag = math.ceil(Z7_mag*100)/100
Z7_angle =math.atan(Z7_i/Z7_r)*(180/math.pi)
Z7_angle = math.floor(Z7_angle*100)/100
x = 4*V/(math.pi)
w = 2*math.pi*f
#(b)
I1 = math.ceil(x*100/Z1_mag)/100
I3 = math.floor(x*1000/(3*Z3_mag))/1000
I5 = math.floor(x*100/(5*Z5_mag))/100
I7 = math.ceil(x*1000/(7*Z7_mag))/1000
Ip =math.sqrt(I1**2+I3**2+I5**2+I7**2)
#Result
print("Vl = %.2fsin(%.2ft)+%.2fsin(%.2ft)+%.2fsin(%.2ft)+%.2fsin(%.2ft)"%(x,w,x/3,3*w,x/5,5*w,x/7,7*w))
print("\nLoad impedances for various harmonics are:")
print("Z1 = %.2f < %.1f°"%(Z1_mag,Z1_angle))
print("Z3 = %.2f < %.0f°"%(Z3_mag,Z3_angle))
print("Z5 = %.2f < %.2f°"%(Z5_mag,Z5_angle))
print("Z7 = %.2f < %.2f°"%(Z7_mag,Z7_angle))
print("\nIl = %.2fsin(%.2ft-%.1f°)+%.3fsin(%.2ft-%.0f°)+%.2fsin(%.2ft-%.2f°)+%.3fsin(%.2ft-%.1f°)"%(I1,w,Z1_angle,I3,3*w,Z3_angle,I5,5*w,Z5_angle,I7,7*w,Z7_angle))
print("\nPeak load current = %.2f A"%Ip)
# single phase Full bridge inverter
import math
#variable declaratrion
R = 20 # resistance
L = 10*10**-3 # inductance
f = 50.0 # frequency
V = 100 # input voltage
#Calculation
#(a)
Vrms = V
#(b)
Z1_r = R
Z1_i = (2*math.pi*f*L)
Z1_i = math.floor(Z1_i*100)/100
Z1_mag = math.sqrt((Z1_r**2) + (Z1_i**2))
Z1_mag = math.floor(Z1_mag*100)/100
Z1_angle =math.atan(Z1_i/Z1_r)*(180/math.pi)
Z1_angle = math.floor(Z1_angle*100)/100
Z3_r = R
Z3_i = (3*2*math.pi*f*L)
Z3_i = math.floor(Z3_i*100)/100
Z3_mag = math.sqrt((Z3_r**2) + (Z3_i**2))
Z3_angle =math.atan(Z3_i/Z3_r)*(180/math.pi)
Z3_angle = math.floor(Z3_angle*100)/100
Z5_r = R
Z5_i = (5*2*math.pi*f*L)
Z5_i = math.floor(Z5_i*100)/100
Z5_mag = math.sqrt((Z5_r**2) + (Z5_i**2))
Z5_mag = math.ceil(Z5_mag*100)/100
Z5_angle =math.atan(Z5_i/Z5_r)*(180/math.pi)
Z5_angle = math.floor(Z5_angle*100)/100
Z7_r = R
Z7_i = (7*2*math.pi*f*L)
Z7_i = math.floor(Z7_i*100)/100
Z7_mag = math.sqrt((Z7_r**2) + (Z7_i**2))
Z7_mag = math.floor(Z7_mag*100)/100
Z7_angle =math.atan(Z7_i/Z7_r)*(180/math.pi)
Z7_angle = math.floor(Z7_angle*100)/100
x = 4*V/(math.pi)
w = 2*math.pi*f
I1 = math.floor(x*100/Z1_mag)/100
I3 = math.floor(x*1000/(3*Z3_mag))/1000
I5 = math.floor(x*1000/(5*Z5_mag))/1000
I7 = math.floor(x*1000/(7*Z7_mag))/1000
#(c)
Ip =math.sqrt(I1**2+I3**2+I5**2+I7**2)
#Result
print("(a) RMS load voltage %d V"%Vrms)
print("\n(b)\n\nVl = %.2fsin(%.2ft)+%.2fsin(%.2ft)+%.2fsin(%.2ft)+%.2fsin(%.2ft)"%(x,w,x/3,3*w,x/5,5*w,x/7,7*w))
print("\nLoad impedances for various harmonics are:")
print("Z1 = %.2f < %.2f°"%(Z1_mag,Z1_angle))
print("Z3 = %.1f < %.2f°"%(Z3_mag,Z3_angle))
print("Z5 = %.2f < %.2f°"%(Z5_mag,Z5_angle))
print("Z7 = %.2f < %.2f°"%(Z7_mag,Z7_angle))
print("\nIl = %.2fsin(%.2ft-%.2f°)+%.2fsin(%.2ft-%.2f°)+%.3fsin(%.2ft-%.2f°)+%.3fsin(%.2ft-%.2f°)"%(I1,w,Z1_angle,I3,3*w,Z3_angle,I5,5*w,Z5_angle,I7,7*w,Z7_angle))
print("\nRMS value of fundamental component of load current = %.3f A"%(I1/math.sqrt(2)))
print("\n(c) Peak load current = %.2f A"%Ip)
# 3-phase bridge inverter with 120° mode of operation
import math
#Variable declaration
V = 400.0 # supply voltage
R = 10.0 # per phase resistor
#Calculations
Ip = V/(2*R)
Irms = math.sqrt(((2*R)**2)*(2.0/3.0))
P = Irms**2*R*3
Iavg = 2*R/3
Itrms = math.sqrt((2*R)**2/3)
#Result
print("Peak value of load current = %d A\nRMS load current = %.2f A\nPower output = %.0f W"%(Ip,Irms,P))
print("Average thyristor current = %.2f A\nRMS value of thyristor current = %.2f A"%(Iavg,Itrms))
# 3-phase bridge inverter with 180° mode of operation
import math
#variable declaration
V = 400.0 # supply voltage
R = 10.0 # per phase resistor
#Calculations
Rl = 1.5*R
i1 = V/Rl
Irms = math.sqrt((1/(2*math.pi))*(((i1**2*(2*math.pi/3)))+((i1/2)**2*((2*math.pi)-(2*math.pi/3)))))
P =Irms**2*R*3
Iavg = ((i1*math.pi/3)+(i1*math.pi/3))/(2*math.pi)
Itrms = math.sqrt(((i1**2*math.pi/3)+((i1/2)**2*2*math.pi/3))/(2*math.pi))
#Result
print("RMS load current = %.3f A\nPower output = %.2f A\nPeak thyristor current = %.2f A"%(Irms,P,i1))
print("Average current of thyristor = %.2f A\nRMS current of thyristor = %.2f A"%(Iavg,Itrms))
# RMS value of load current and RMS value of thyristor current
import math
#variaable declaration
V = 450.0 # supply voltage
R = 10.0 # per phase load resistance
mode = 180 # conduction mode
#calculation
Rl = 1.5*R
i1 = V/Rl
#(a)
Irms = math.sqrt((1/(2*math.pi))*(((i1**2*(2*math.pi/3)))+((i1/2)**2*((2*math.pi)-(2*math.pi/3)))))
Ip = i1
Itrms = math.sqrt((1/(2*math.pi))*(((i1**2*(math.pi/3)))+((i1/2)**2*((math.pi)-(math.pi/3)))))
#Result
print("(a) RMS load current = %.2f A\n(b) Peak current of thyristor = %.0f A\n(c) RMS current of thyristor = %.0f A"%(Irms,Ip,Itrms))
# Single phase full bridge inverter
import math
#variable declaration
V = 200.0 # input voltage
w = 30.0 # width of each pulse
n = 5.0 # no of pulses each cycle
i =1.1 # factor by whic input is to be increased
w1= 33.0 # maximum width of pulse
#Calculations
#(a)
Vl = V*math.sqrt(n*w/180.0)
Vl = math.floor(Vl*100)/100
Vl1 = 182.52 #value used in the book for calculations
#(b)
Vi = V*i
sig=(180*(Vl1/Vi)**2)/n
#(c)
V = Vl1/math.sqrt(n*w1/180.0)
#Result
print("(a) Vl = %.2f V\n(b) Pulse-width = %.2f°\n(c) V = %.2f V"%(Vl,sig,V))
# Single phase full bridge inverter
import math
#variable declaration
V = 200.0 #input voltage
w = 120.0 # width of signal
#Calculations
Vl = V*math.sqrt(w/180)
#Result
print("Vl = %.1f V"%Vl)
# Inverter controlled by sinusoidal pulse-width modulation
import math
# variable declaration
V = 150.0 # input DC voltage
w1 = 20.0 # reference signal is more than control signal from 20° to 40°
w2 = 60.0 # reference signal is more than control signal from 60° to 120°
w3 = 20.0 # reference signal is more than control signal from 140° to 160°
#Calculations
Vl = V*math.sqrt((w1/180)+(w2/180)+(w3/180))
#Result
print("Vl = %.1f V"%Vl)