import math
from math import sqrt,pi
#given
Ka=0.09 #motor voltage constant in V/rpm
N=1000 #in rpm
Ia=30 #armature current
Ra=0.4 #armature resistance
V=120 # supply voltage
RevEa=-90 # back emf
#calculations
Ea=Ka*N
Vo=Ea+(Ia*Ra)
a=Vo*pi
b=2*sqrt(2)*V
c=a/b
angle=math.acos(c)*180/pi
P=Vo*Ia
S=V*Ia
Pf=P/S
Vo1=RevEa+(Ia*Ra)
a=Vo1*pi
b=2*sqrt(2)*V
c=a/b
Angle=math.acos(c)*180/pi
Pdc=Ea*Ia #power from dc machine
Pr=Ia**2*Ra #power lost in Ra
Ps=Pdc-Pr
Angle=round(Angle,2)
print 'Firing angle=',Angle,'degrees'
print 'Power fed back to the ac suppy =',Ps,'W'
import math
from math import sqrt,pi
#given
Vp=120.0 #phase-voltage
Angle=60.0
#calculations
Vo=((3*sqrt(6))/(2*pi))*120*math.cos(pi*Angle/180)
Vo=round(Vo,1)
print ' Average Output Voltage=',Vo,'V'
import math
from math import sqrt,pi
#given
V=480.0 #voltage supplied
Ka=0.3 #motor constant
N=1500.0 #motor speed in rpm
Ia=130.0 #armature current in Amp
Ra=0.1 #armature resistance in ohms
No=1000.0
Vp=V/sqrt(3) #phase-voltage
Ea=Ka*N
Vo=Ea+(Ia*Ra)
a=Vo*pi
b=3*sqrt(6)*Vp
c=a/b
Angle=math.acos(c)*180/pi
IA=sqrt(0.6666)*Ia
S=3*Vp*IA
Ps=Vo*Ia
Pf=Ps/S
Ea1=Ka*No
Vo1=-300+(Ia*Ra)
a=Vo1*pi
b=3*sqrt(6)*Vp
c=a/b
Angle1=math.acos(c)*180/pi
Pdc=Ea1*Ia #power from the dc machine
Pr=Ia**2*Ra #power lost in Ra
Ps=Pdc-Pr #power to source
Pf1=Ps/S
Angle=round(Angle,1)
Angle1=round(Angle1,1)
Pf=round(Pf,2)
Pf1=round(Pf1,2)
print 'Firing Angle for rectifier operation=',Angle,'degrees'
print 'supply power factor for rectifier operation=',Pf
print 'Firing Angle for inverter operation=',Angle1,'degrees'
print 'supply power factor for inverter operation=',Pf1
import math
from math import sqrt,pi
#given
OutP=100.0*0.746 #ouput power
Eff=0.8 #effeciency
Pf=0.85 #power factor
V=460.0 #voltage
S=OutP/(Eff*Pf) #Input kVA at full load
Il=S/(sqrt(3)*V) #Input line current
Ip=Il/sqrt(3) #Motor phase current
Is=Ip/sqrt(2) #Thyristor rums current
Vs=sqrt(2)*V
Angle=math.acos(Pf)*180/pi
Angle=round(Angle,1)
Vs=round(Vs,1)
print 'peak-voltage across a thyristor=',Vs,'V'
print 'firing angle =',Angle,'degrees'
print 'control range is',Angle,'<Alpha<''180'
from math import sqrt,pi
#given
Ka=0.1 #motor-constant in V/rpm
Ra=0.2 #motor armature resistance
N=400 #speed in rpm
Ia=100 #armature current
V=120 #supply voltage
N1=350
Io=-100
#calcullations
Ea=Ka*N
Ea1=Ka*N1
Vo=Ea+(Ia*Ra)
Pmotor=Ea*Ia #power developed in the motor
Pr=Ia**2*Ra #power absorbed by Ra
Ps=V*Ia*0.5 #power from the source
Vo=Ea1+(Ia*Ra)
Vo=Ea1+(Io*Ra)
Pmotor1=Ea1*Io #power developed in the motor
Pr1=Ia**2*Ra #power absorbed by Ra
Ps1=V*Io*1/8 #power from source
print 'For n=400 rpm and I=100A:'
print 'power developed =',Pmotor,'W'
print 'power absorbed=',Pr,'W'
print 'power to the source=',Ps,'W'
print '\nFor n=350 rpm and I=-100A:'
print 'power developed =',Pmotor1,'W'
print 'power absorbed=',Pr1,'W'
print 'power to the source=',Ps1,'W'
from math import sqrt,pi
#given
V=300.0 #voltage
Io=540.0 #current in amperes
Angle=45 #in degrees
Is=242.89 #average current calculated in Amperes
Ps=V*Io #Ohm's law
Vo1=(4*V)/(pi*sqrt(2))
Pout=Vo1*Io/sqrt(2)*math.cos(pi*Angle/180)*10**-3
Pout=round(Pout,2)
print 'Output power=',Pout,'kW'
from math import sqrt
#given
V=600 #voltage
Phase=3
Vl=sqrt(0.666)*V
Vp=V*sqrt(2)/Phase
Vl=round(Vl,1)
Vp=round(Vp,2)
print 'Phase voltage=',Vl,'V'
print 'Load Phase voltage=',Vp,'V'
from math import sqrt
#given
V=120.0 #supply voltage
Vo=50.0 #rms output voltage
Vo1=100.0
#calculations
Angleshift1=(Vo**2/V**2)*180
Angleshift2=(Vo1**2/V**2)*180
print 'angle shift=',Angleshift1,'degrees'
print 'angle shift=',Angleshift2,'degrees'
from math import sqrt
#given
I=100 #dc link current
PulseScr=0.57735026919
PulseOut=0.816496581
a=PulseScr
msScr=a*I
b=PulseOut
RmsOut=b*I
msScr=round(msScr,2)
RmsOut=round(RmsOut,2)
print 'Thyristor current is',msScr,'A'
print 'Output RMS current is',RmsOut,'A'