import math
#variable declaration
s1=36.0
p1=4.0
span1=8.0
s2=72.0
p2=6.0
span2=10.0
s3=96.0
p3=6.0
span3=12.0
#calculations
alpha1=2*p1*180/s1
alpha2=3*p2*180/s2
alpha3=5*p3*180/s3
kc1=math.cos(math.radians(alpha1/2))
kc2=math.cos(math.radians(alpha2/2))
kc3=math.cos(math.radians(alpha3/2))
#result
print "a)kc=",kc1
print "b)kc=",kc2
print "c)kc=",kc3
#variable declaration
s=36.0
p=4.0
#calculations
n=s/p
beta=180/n
m=s/(p*3)
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
#result
print "distribution factor=",kd
#variable declaration
v=10.0#V
beta=30.0#degrees
m=6.0
#calculations
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
arith_sum=6*v
vector_sum=kd*arith_sum
#calculation
print "emf of six coils in series=",vector_sum,"V"
#variable declaration
beta=180/9
ratio=2.0/3.0
m1=9
m2=6
m3=3
#calculation
kd1=math.sin(m1*math.radians(beta/2))/(m1*math.sin(math.radians(beta/2)))
kd2=math.sin(m2*math.radians(beta/2))/(m2*math.sin(math.radians(beta/2)))
kd3=math.sin(m3*math.radians(beta/2))/(m3*math.sin(math.radians(beta/2)))
#result
print "i) kd=",kd1
print "ii)kd=",kd2
print "iii)kd=",kd3
#variable declaration
slot=18.0
s=16.0
m1=3.0
m2=5.0
m3=7.0
#calculations
span=(s-1)
alpha=180*3/slot
kc1=math.cos(math.radians(alpha/2))
kc3=math.cos(math.radians(m1*alpha/2))
kc5=math.cos(math.radians(m2*alpha/2))
kc7=math.cos(math.radians(m3*alpha/2))
#result
print "kc1=",kc1
print "kc3=",kc3
print "kc5=",kc5
print "kc7=",kc7
#variable declaration
p=16.0
s=144.0
z=10.0
phi=0.03#Wb
n=375.0#rpm
#calculation
f=p*n/120
n=s/p
beta=180/9
m=s/(p*3)
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
t=s*z/(3*2)
eph=4.44*1*0.96*f*phi*t
el=3**0.5*eph
#result
print "frequency=",f,"Hz"
print "phase emf=",eph,"V"
print "line emf=",el,"V"
#variable declaration
p=6
s=54
phi=0.1#Wb
n=1200#rpm
t=8
#calculations
beta=180/9
kc=math.cos(beta/2)
f=p*n/120
n=s/p
m=s/(p*3)
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
z=s*8/3
t=z/2
eph=4.44*0.98*0.96*f*phi*t
el=3**0.*eph
#result
print "eph=",eph,"V"
#variable declaration
p=16.0
slots=144.0
z=4.0
n=375.0
airgap=5*0.01
theta=150.0
#calculation
kf=1.11
alpha=(180-theta)
kc=math.cos(math.radians(alpha/2))
beta=180/9
m=slots/(p*3)
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
f=p*n/120
s=slots/3
eph=4*kf*kc*kd*f*airgap*s*4/2
#result
print "emf per phase=",eph,"V"
#variable declaration
p=10
f=50#Hz
n=600#rpm
slots=180
s=15
d=1.2#m
l=0.4#m
m=6
beta=180/18
#calculations
area=(1.2*3.14/p)*l
phi1=area*0.637
vr=1.1*2*f*phi1
vp=2**0.5*vr
v3=0.4*vp
v5=0.2*vp
vf=6*vp*0.966
vf3=6*v3*0.707
vf5=6*v5*0.259
kd1=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
kd2=math.sin(math.radians(3*m*beta/2))/(6*math.sin(3*math.radians(beta/2)))
kd3=math.sin(math.radians(5*m*beta/2))/(6*math.sin(5*math.radians(beta/2)))
vph=vf*2**0.5*60*kd1
vph3=vf3*2**0.5*60*kd2
vph5=vf5*2**0.5*60*kd3
rmsv=(vph**2+vph3**2+vph5**2)**0.5
rmsvl=3**0.5*(vph**2+vph5**2)**0.5
#result
print "i)e=",vp,"sin theta+",v3,"sin 3theta+",v5,"sin 5theta"
print "ii)e=",vf,"sin theta+",vf3,"sin 3theta+",vf5,"sin 5theta"
print "iii)rms value of phase voltage=",rmsv,"V"
import math
#variable declaration
p=4
f=50.0#Hz
slot=60.0
z=4.0
s=3.0
theta=60.0
phi=0.943#Wb
#calculation
m=slot/(p*s)
beta=slot/5
kd=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
alpha=(s/15)*180
kc=math.cos(math.radians(alpha/2))
z=slot*z/s
t=z/2
kf=1.11
eph=z*kf*kc*kd*f*phi*t/2
el=3**0.5*eph*0.1
#result
print "line voltage=",el,"V"
#variable declaration
p=4.0
f=50.0#Hz
slot=15.0
z=10.0
kd=0.95
e=1825#v
kc=1
kf=1.11
#calculations
slots=p*slot
slotsp=slots/3
turnp=20*z/2
phi=e/(3**0.5*p*kc*kf*kd*f*turnp)
z=slots*z
n=120*f/p
eg=(phi*0.001*z*n)/slots
#result
print "emf=",eg*1000,"V"
#variable declaration
v=360#V
f=60.0#Hz
i=3.6#A
f2=40#Hz
i2=2.4#A
#calculations
e2=v*i2*f2/(f*i)
#result
print "e2=",e2,"V"
#variable declaration
p=0
f=50.0#Hz
slot=2
z=4
theta=150#degrees
phi=0.12#Wb
per=20#%
#calculations
alpha=180-theta
slotp=6
m=2
beta=180/slotp
kd1=math.sin(m*math.radians(beta/2))/(m*math.sin(math.radians(beta/2)))
z=10*slot*z
t=z/2
e1=4.44*kd1*kd1*f*0.12*t
kc3=math.cos(3*math.radians(alpha/2))
f2=f*3
phi3=(1.0/3)*per*0.12
e3=4.44*kd3*kd3*theta*0.008*40
e=(e1**2+e3**2)**0.5
#result
print "e=",e,"V"
#variable declaration
v=230.0#V
per=10.0#%
per2=6.0#%
f=50.0#Hz
r=10.0#ohm
#calculation
#star connection
e5=per*v/100
e=(v**2+e5**2)**0.5
eph=3**0.5*e
#delta
e3=10*v/100
f3=10*3
i=e3/f3
#result
print "line voltage for star=",eph,"V"
print "line voltage for delta=",e3,"V"
print "current=",i,"A"
#variable declaration
p=10.0
p1=24.0
f=25#Hz
p3=6.0
s=0.05
#calculation
n=120*f/p
f1=p1*n/120
n2=120*f1/6
n3=(1-s)*n2
f2=s*f1p
#result
print "frequency=",f1,"Hz"
print "speed=",n3,"rpm"
#variable declaration
p=4
phi=0.12#Wb
slotsp=4
cp=4
theta=150#degrees
#calculation
slots=slotsp*3*p
c=cp*slots
turns=32
kb=math.sin(math.radians(60/2))/(p*math.sin(math.radians(7.5)))
kp=math.cos(math.radians(15))
eph=4.44*50*0.12*kb*0.966*turns
el=eph*3**0.5
#result
print "line voltage",el,"V"
#variable declaration
load=10#MW
pf=0.85
v=11#kV
r=0.1#ohm
x=0.66#ohm
#calculation
i=load*10**6/(3**0.5*v*1000*pf)
iradrop=i*r
ixsdrop=i*x
vp=v*1000/3**0.5
phi=math.acos(pf)
sinphi=math.sin(phi)
e0=((vp*pf+i*r)**2+(vp*sinphi+i*x)**2)**0.5
el=3**0.5*e0
#result
print "linevalue of emf=",el,"V"
#variable declaration
v=2200.0#V
f=50.0#Hz
load=440.0#KVA
r=0.5#ohm
i=40.0#A
il=200.0#A
vf=1160.0#V
#calculations
zs=vf/200
xs=(zs**2-r**2)**0.5
#result
print "synchronous impedence=",zs,"ohm"
print "synchronous reactance=",xs,"ohm"
#variable declaration
load=60.0#kVA
v=220.0#V
f=50.0#Hz
r=0.016#ohm
x=0.07#ohm
pf=0.7
#calculations
i=load*1000/v
ira=i*r
ixl=i*x
#unity pf
e=((v+ira)**2+(ixl)**2)**0.5
#pf of 0.7 lag
e2=((v*pf+ira)**2+(v*pf+ixl)**2)**0.5
#pf of 0.7 lead
e3=((v*pf+ira)**2+(v*pf-ixl)**2)**0.5
#result
print "voltage with pf=1",e,"V"
print "voltage with pf=0.7 lag",e2,"V"
print "voltage with pf=0.7 lead",e3,"V"
#variable declaration
load=50.0#KVA
v1=440.0#V
f=50.0#Hz
r=0.25#ohm
x=3.2#ohm
xl=0.5#ohm
#calculation
v=v1/3**0.5
i=load*1000/(3**0.5*v1)
rd=i*r
ixl=i*xl
ea=((v+rd)**2+(ixl)**2)**0.5
el=3**0.5*ea
e0=((v+rd)**2+(i*x)**2)**0.5
e0l=e0*3**0.5
per=(e0-v)/v
xa=x-xl
#result
print "internal emf Ea=",el,"V"
print "no load emf=",e0l,"V"
print "percentage regulation=",per*100,"%"
print "valueof synchronous reactance=",xa,"ohm"
#variable declaration
i=200.0#A
v=50.0#V
r=0.1#ohm
il=100.0#A
pf=0.8
vt=200.0#V
#calculation
zs=v/vt
xs=(zs**2-r**2)**0.5
ira=il*r
ixs=il*xs
sinphi=math.sin(math.acos(pf))
e0=((vt*pf+ira)**2+(vt*sinphi+ixs)**2)**0.5
#result
print "induced voltage=",e0,"V"
#variable declaration
v=2000.0#V
i=100.0#A
pf=0.8
pf2=0.71
i2=2.5#A
v2=500.0#V
r=0.8#ohm
#calculations
sinphi1=math.sin(math.acos(pf))
sinphi2=math.sin(math.acos(pf2))
zs=v2/i
xs=(zs**2-r**2)**.5
#unity pf
e01=((v+r*i)**2+(i*xs)**2)**0.5
reg1=(e01-v)*100/v
#at pf=0.8
e02=((v*pf+r*i)**2+(v*sinphi1-i*xs)**2)**0.5
reg2=(e02-v)*100/v
#at pf=0.71
e03=((v*pf2+r*i)**2+(v*sinphi2+i*xs)**2)**0.5
reg3=(e03-v)*100/v
#result
print "voltage regulation unity pf=",reg1,"%"
print "voltage regulation 0.8 lag pf=",reg2,"%"
print "voltage regulation 0.71 lead pf=",reg3,"%"
#variable declaration
v=3000.0#V
load=100.0#kVA
f=50.0#Hz
r=0.2
i1=40.0#A
i2=200.0#A
v2=1040.0#V
pf=0.8
v1=v/3**0.5
#calculations
sinphi1=math.sin(math.acos(pf))
zs=v2/(3**0.5*i2)
xs=(zs**2-r**2)**.5
i=load*1000/(3**0.5*v)
#at pf=0.8 lag
e01=((v1*pf+r*i)**2+(v1*sinphi1+i*xs)**2)**0.5
reg1=(e01-v1)*100/v1
#at pf=0.8 lead
e02=((v1*pf+r*i)**2+(v1*sinphi1-i*xs)**2)**0.5
reg2=(e02-v1)*100/v1
#result
print "voltage regulation 0.8 lag pf=",reg1,"%"
print "voltage regulation 0.8 lag pf=",reg2,"%"
#variable declaration
load=1600.0#kVA
v=13500.0#V
r=1.5#ohm
x=30.0#ohm
load1=1280.0#kW
pf=0.8
#calculation
sinphi1=math.sin(math.acos(pf))
i=load1*1000/(3**0.5*v*pf)
ira=i*r
ixs=i*x
vp=v/3**0.5
e0=((vp*pf+ira)**2+(vp*sinphi1-ixs)**2)**0.5
regn=(e0-vp)*100/vp
#result
print "percentage regulation=",regn,"%"
#variable declaration
load=10.0#kVA
v=400.0#V
f=50.0#Hz
pf=0.8
r=0.5#ohm
x=10.0#ohm
#calculations
i=load*1000/(3**0.5*v)
ira=i*r
ixs=i*x
vp=v/3**0.5
sinphi=math.sin(math.acos(pf))
e0=((vp*pf+ira)**2+(vp*sinphi+ixs)**2)**0.5
regn=(e0-vp)/vp
thetadel=math.atan((vp*sinphi+ixs)/(vp*pf+ira))
delta=math.degrees(thetadel)-math.degrees(math.acos(pf))
#result
print "voltage regulation=",regn*100,"%"
print "power angle=",delta,"degrees"
#variable declaration
load=6000.0#KVA
v=6600.0#V
p=2.0
f=50.0#Hz
i2=125.0#A
v1=8000.0#V
i3=800.0#A
d=0.03
pf=0.8
#calculations
sinphi=math.sin(math.acos(pf))
zs=v1/(3**0.5*i3)
vp=v/3**0.5
rd=d*vp
il=load*1000/(3**0.5*v)
ira=rd
ra=ira/il
xs=(zs**2-ra**2)**0.5
e0=((vp*pf+ira)**2+(vp*sinphi+il*xs)**2)**0.5
reg=(e0-vp)/vp
#result
print "percentage regulation=",reg*100,"%"
#variable declaration
f=50.0#Hz
load=2000#KVA
v=2300#V
i=600#A
v2=900#V
r=0.12#ohm
pf=0.8
#calculation
sinphi=math.sin(math.acos(pf))
zs=v2/(3**0.5*i)
rp=r/2
re=rp*1.5
xs=(zs**2-re**2)**0.5
il=load*1000/(3**0.5*v)
ira=il*rp
ixs=il*xs
vp=v/3**0.5
e0=((vp+ira)**2+(ixs)**2)**0.5
reg1=(e0-vp)/vp
e0=((vp*pf+ira)**2+(vp*sinphi+ixs)**2)**0.5
reg2=(e0-vp)/vp
#result
print "regulation at pf=1",reg1*100,"%"
print "regulation at pf=0.8",reg2*100,"%"
import math
from sympy.solvers import solve
from sympy import Symbol
#variable declaration
v=Symbol('v')
load=2000#KVA
load1=11#KV
r=0.3#ohm
x=5#ohm
pf=0.8
#calculation
sinphi=math.sin(math.acos(pf))
i=load*1000/(3**0.5*load1*1000)
vt=load1*1000/3**0.5
ira=i*r
ixs=i*x
e0=((vt*pf+ira)**2+(vt*sinphi+ixs)**2)**0.5
v=solve(((pf*v+ira)**2+(sinphi*v-ixs)**2)**0.5-e0,v)
#result
print "terminal voltage=",v[1],"V"
#variable declaration
load=1200#KVA
load1=3.3#KV
f=50#Hz
r=0.25#ohm
i=35#A
i2=200#A
v=1.1#kV
pf=0.8
#calculation
zs=v*1000/(3**0.5*i2)
xs=(zs**2-r**2)**0.5
v=load1*1000/3**0.5
theta=math.atan(xs/r)
ia=load*1000/(3**0.5*load1*1000)
e=v+ia*zs
change=(e-v)/v
#result
print "per unit change=",change
#variable declaration
f=50#Hz
v1=11#kV
load=3#MVA
i=100#A
v2=12370#V
vt=11000#V
pf=0.8
r=0.4#ohm
#calculation
E0=v1*1000/3**0.5
v=v2/3**0.5
pf=0
sinphi=1
xs=(v-(E0**2-(i*r)**2)**0.5)/i
il=load*10**6/(3**0.5*v1*1000)
ira=il*r
ixs=il*xs
e0=((E0*pf+ira)**2+(E0*sinphi+ixs)**2)**0.5
regn=(e0-E0)*100/E0
#result
print "regulation=",regn,"%"
#variable declaration
pf=0.8
vt=3500#v
load=2280#KW
v1=3300#V
r=8#ohm
x=6#ohm
#calculation
vl=vt/3**0.5
vp=v1/3**0.5
il=load*1000/(3**0.5*v1*pf)
drop=vl-vp
z=(r**2+x**2)**0.5
x=vl/(z+drop/il)
vtp=vl-x*drop/il
vtpl=vtp*3**0.5
#result
print "terminal voltage=",vtpl,"V"
import math
#variable declaration
load=3.5#MVA
v=4160#V
f=50#Hz
i=200#A
pf=0.8
#calculation
il=load*10**6/(3**0.5*v)
zs=4750/(3**0.5*il)
ra=0
ixs=il*zs
vp=v/3**0.5
sinphi=math.sin(math.acos(pf))
e0=((vp*pf)**2+(vp*sinphi+ixs)**2)**0.5
regn=(e0-vp)*100/vp
#result
print "regulation=",round(regn,1),"%"
import math
#variable declaration
i_f1=20#A
i_f=37.5#A
pf=0.8
v=6600#V
eo=7600#V
#calculations
ob=math.sqrt(i_f**2+i*math.cos(math.radians(53.8)))
reg=(eo-v)*100/v
i=100*i_f/i_f1
zs=100*100/i
Eo=math.sqrt((100+zs*0.6)**2+(zs*pf)**2)
reg2=(Eo-100)*100/100
#result
print "regulation:"
print "by ampere turn method=",reg,"%"
print "by synchronous impedence method=",reg2,"%"
import math
#variable declaration
r=0.2#ohm
p=1000000#VA
v=2000#V
pf=0.8
#calculation
vp=v*math.sqrt(3)
i=p/(math.sqrt(3)*v)
V=v/math.sqrt(3)+(i*r**pf)
reg=(1555-(v/math.sqrt(3)))*100/(v/math.sqrt(3))
reg2=(1080-(v/math.sqrt(3)))*100/(v/math.sqrt(3))
#result
print "regulation when pf=0.8 lagging:",round(reg,1),"%"
print "regulation when pf=0.8 leading:",round(reg2,1),"%"
import math
#variable declaration
x_drop=0.1
r_drop=0.02
pf=0.8
v=3300#V
p=800000#VA
#calculations
vp=v/math.sqrt(3)
ir_drop=r_drop*vp
leakage=x_drop*vp
E=math.sqrt((vp*pf+ir_drop)**2+(vp*0.6+leakage)**2)
i=p/(math.sqrt(3)*v)
#result
print "I=",round(i),"A"
import math
#variable declaration
i_f1=17#A
p=2000000.0#VA
i_f2=42.5#A
v=6000.0/math.sqrt(3)#V
pf=0.8
#calculations
e=math.sqrt((v*pf)**2+(v*0.6+450)**2)
#corresponding i=26.5 A
#field amperes required for balancing armature reaction=14.5A
i_f=math.sqrt(26.5**2+14.5**2+2*26.5*14.4*math.cos(math.radians(53.8)))
#result
print "resulting field current=",round(i_f,1),"A"
import math
#variable declaration
v=11000#V
p=1000000#VA
r=2#ohm
pf=0.8
#calculations
i=p/(math.sqrt(3)*v)
vp=v/math.sqrt(3)
e=math.sqrt((vp*pf+i*2)**2+(vp*0.6+p/1000)**2)
i1=math.sqrt(108**2+30**2+2*108*30*math.cos(math.radians(53.8)))
#corresponding emf=7700V
reg=(7700-vp)*100/vp
#result
print "Voltage regulation=",round(reg,1),"%"
import math
#variable declarations
p=275000.0#W
v=6600.0#V
stator_i=35.0#A
exciting_i=50.0#A
x=0.08
pf=0.8
#calculations
x_drop=v*x/math.sqrt(3)
vp=v/math.sqrt(3)
i=p/(math.sqrt(3)*v*pf)
ia=i*exciting_i/stator_i
ob=math.sqrt(vp**2+x_drop**2)
oc=59.8#field current corresponding tothe voltage
i_fl=p/(math.sqrt(3)*v)
ia2=exciting_i*i_fl/stator_i
ei=math.sqrt(ia2**2+oc**2)
#result
print "Exciting current=",round(ei),"A"
import math
#variable declaration
p=600000.0#VA
v=3300.0#V
pf=0.8
l_drop=7
#calculations
i=p/(math.sqrt(3)*v)
amp_turns=1.06*i*200.0/8
vp=v/math.sqrt(3)
x_drop=vp*l_drop/100
oa=1910.0#V
reg=(2242.0-oa)*100/oa
#result
print "regulation=",round(reg,1),"%"
import math
#variable declaration
p=15000000#VA
v=11000#V
pf=0.8
v1=8400
#calculations
i=p/(math.sqrt(3)*v)
xl=640/i
zs=(v1/math.sqrt(3))/i
vp=v/math.sqrt(3)
eo=7540
reg=(eo-vp)*100/vp
#result
print "regulation=",round(reg,1),"%"
#variable declaration
xd=0.7
xq=0.4
pf=0.8
#calculations
v=1
sinphi=math.sin(math.acos(pf))
ia=1
tandelta=ia*xq*pf/(v+xq*sinphi)
delta=math.atan(tandelta)
i_d=ia*math.sin(math.radians(36.9)+delta)
e0=v*math.cos(delta)+i_d*xd
#result
print "load angle=",math.degrees(delta),"degrees"
print "no load voltage=",e0,"V"
#variable declaration
f=50.0#Hz
xd=0.6
xq=0.45
ra=0.015
pf=0.8
ia=1
v=1
sinphi=math.sin(math.acos(pf))
#calculation
tanpsi=(v*sinphi+ia*xq)/(v*pf+ia*ra)
psi=math.atan(tanpsi)
delta=psi-math.acos(pf)
i_d=ia*math.sin(psi)
iq=ia*math.cos(psi)
e0=v*math.cos(delta)+iq*ra+i_d*xd
regn=(e0-v)*100/v
#result
print "open circuit voltage=",e0,"V"
print "regulation=",regn,"%"
#variable declaration
ia=10#A
phi=math.radians(20)
v=400#V
xd=10#ohm
xq=6.5#ohm
#calculations
pf=math.cos(phi)
sinphi=math.sin(phi)
tandelta=ia*xq*pf/(v+ia*xq*sinphi)
delta=math.atan(tandelta)
i_d=ia*math.sin(phi+delta)
iq=ia*math.cos(phi+delta)
e0=v*math.cos(delta)+i_d*xd
regn=(e0-v)/v
#result
print "load angle=",math.degrees(delta),"degrees"
print "id=",i_d,"A"
print "iq=",iq,"A"
#variable declaration
e1=220#V
f1=60#Hz
e2=222#V
f2=59#Hz
#calculation
emax=(e1+e2)/2
emin=(e2-e1)/2
f=(f1-f2)
epeak=emax/0.707
pulse=(f1-f2)*60
#result
print "max voltage=",emax,"V"
print "min voltage=",emin,"V"
print "frequency=",f,"Hz"
print "peak value of voltage=",epeak,"V"
print "number of maximum light pulsations/minute=",pulse
#variable declaration
power=1500#kVA
v=6.6#kV
r=0.4#ohm
x=6#ohm
pf=0.8
#calculations
i=power*1000/(3**0.5*v*1000)
ira=i*r
ixs=i*x
vp=v*1000/3**0.5
phi=math.acos(pf)
tanphialpha=(vp*math.sin(phi)+ixs)/(vp*pf+ira)
phialpha=math.atan(tanphialpha)
alpha=phialpha-phi
#result
print "power angle=",math.degrees(alpha)
#variable declaration
load=3000#KVA
p=6
n=1000#rpm
v=3300#v
x=0.25
#calculation
vp=v/3**0.5
i=load*1000/(3**0.5*v)
ixs=x*vp
xs=x*vp/i
alpha=1*p/2
psy=3*3.14*vp**2/(60*xs*n)
tsy=9.55*psy/n
#result
print "synchronizing power=",psy,"kW"
print "torque=",tsy*1000,"N-m"
#variable declaration
load=3#MVA
n=1000#rpm
v1=3.3#kV
r=0.25
pf=0.8
#calculations
vp=v1*1000/3**0.5
i=load*1000000/(3**0.5*v1*1000)
ixs=complex(0,r*vp)
xs=ixs/i
v=vp*complex(pf,math.sin(math.acos(pf)))
e0=v+ixs
alpha=math.atan(e0.imag/e0.real)-math.acos(pf)
p=6/2
psy=abs(e0)*vp*math.cos(alpha)*math.sin(math.radians(3))/xs
tsy=9.55*3*psy*100/n
#result
print "synchronous power=",-psy*3/1000,"kW"
print "toque=",-tsy/100,"N-m"
#variable declaration
load=750#KVA
v=11#kV
p=4
r=1#%
x=15#%
pf=0.8
#calculation
i=load*1000/(3**0.5*v*1000)
vph=v*1000/3**0.5
ira=r*vph/1000
ra=ira/i
xs=x*vph/(100*i)
zs=(ra**2+xs**2)**0.5
#no load
alpha=p/2
psy=math.radians(alpha)*vph**2/xs
#fl 0.8 pf
e=((vph*pf+i*ra)**2+(vph*math.sin(math.acos(pf)+i*xs))**2)**0.5
psy2=math.radians(alpha)*e*vph/xs
#result
print "Synchronous power at:"
print "no load=",psy,"W"
print "at pf of 0.8=",psy2,"w"
#variable declaration
load=2000#KVA
p=8
n=750#rpm
v1=6000#V
pf=0.8
r=6#ohm
#calculations
alpha=math.radians(4)
v=v1/3**0.5
i=load*1000/(3**0.5*v1)
e0=((v*pf)**2+(v*math.sin(math.acos(pf))+i*r)**2)**0.5
psy=alpha*e0*v*3/r
tsy=9.55*psy/n
#result
print "synchronous power=",psy,"W"
print "synchronous torque=",tsy,"N-m"
#variable declaration
load=5000#KVA
v=10000#V
n=1500#rpm
f=50#Hz
r=20#%
pf=0.8
phi=0.5
#calculations
vp=v/3**0.5
i=load*1000/(3**0.5*v)
xs=r*vp/(1000*i)
p=120*f/n
alpha=math.radians(2)
#no load
psy=3*alpha*vp**2/(p*1000)
tsy=9.55*psy*1000/(n*2)
#pf=0.8
v2=vp*complex(pf,math.sin(math.acos(pf)))
ixs=complex(0,i*4)
e0=v+ixs
psy2=abs(e0)*vp*math.cos(math.radians(8.1))*math.sin(math.radians(2))*3/4
tsy2=9.55*psy2/(n*20)
#result
print "synchronous power:"
print "atno load=",psy,"w"
print "at 0.8 pf=",psy2,"w"
print "torque:"
print "at no load=",tsy,"N-m"
print "at pf=0.8=",tsy2,"N-m"
#variable declaration
load=6.6#kW
load1=3000#kW
pf=0.8
xa=complex(0.5,10)
xb=complex(0.4,12)
i0=150#A
#calculation
v=complex(load*1000/3**0.5,0)
cosphi1=1500*1000/(load*1000*i0*3**0.5)
phi1=math.acos(cosphi1)
sinphi1=math.sin(phi1)
i=328*complex(pf,-math.sin(math.acos(pf)))
i1=i0*complex(cosphi1,-sinphi1)
i2=i-i1
coshi2=i2.real/181
ea=v+i1*xa
eal=3**0.5*abs(ea)
eb=v+i2*xb
ebl=3**0.5*abs(eb)
alpha1=(ea.imag/ea.real)
alpha2=(eb.imag/eb.real)
#result
print "Ea=",ea,"V"
print "Eb=",eb,"V"
print "alpha1=",math.degrees(alpha1),"degrees"
print "alpha2=",math.degrees(alpha2),"degrees"
#variable declration
e1=complex(230,0)
e2=230*complex(0.985,0.174)
z1=complex(0,2)
z2=complex(0,3)
z=6
i1=((e1-e2)*z+e1*z2)/(z*(z1+z2)+z1*z2)
i2=((e2-e1)*z+e2*z1)/(z*(z1+z2)+z1*z2)
i=i1+i2
v=i*z
p1=abs(v)*abs(i1)*math.cos(math.atan(i1.imag/i1.real))
p2=abs(v)*abs(i2)*math.cos(math.atan(i2.imag/i2.real))
#result
print "terminal voltage=",v,"V"
print "current",i,"A"
print "power 1=",p1,"W"
print "power 2=",p2,"W"
#variable declaration
load=1500#kW
v=11#KV
pf=0.867
x=50#ohm
r=4#ohm
i=50#A
#calculations
il=load*1000/(3**0.5*v*1000*pf)
phi=math.acos(pf)
sinphi=math.sin(phi)
iwatt=il*pf
iwattless=il*sinphi
i1=il/2
i2=iwatt/2
iw1=(i**2-i1**2)**0.5
iw2=i2-iw1
ia=(i2**2+iw2**2)**0.5
vt=v*1000/3**0.5
ir=i*r
ix=x*i
cosphi=i2/i
sinphi=math.sin(math.acos(cosphi))
e=((vt*cosphi+ir)**2+(vt*sinphi+ix)**2)**0.5
el=3**0.5*e
#result
print "armature current=",ia,"A"
print "line voltage=",el,"V"
#variable declaration
load=10#MW
pf=0.8
output=6000#kW
pfa=0.92
#calculations
phi=math.acos(pf)
phia=math.acos(pfa)
tanphi=math.tan(phi)
tanphia=math.tan(phia)
loadkvar=load*1000*tanphi
akvar=output*tanphia
kwb=(load*1000-output)
kvarb=loadkvar-akvar
kvab=complex(kwb,kvarb)
pfb=math.cos(math.atan(kvab.imag/kvab.real))
kvarb=kwb*pfb
kvara=-loadkvar-kvarb
kvaa=complex(output,kvara)
pfa=math.cos(math.atan(kvaa.imag/kvaa.real))
#result
print "new pfb=",pfb
print "new pfa=",pfa
#variable declaration
v=6600#V
load=1000#KVA
x=20#%
pf=0.8
#calculation
i=87.5
x=8.7
vp=3810
e0=4311
ir=70
ix=52.5
IX=762
vb1=(e0**2-vp**2)**0.5
i1x=vb1
i1=i1x/x
output=3**0.5*v*i1/1000
b2v=(vp**2+e0**2)**0.5
i2z=b2v
i2=b2v/x
i2rx=e0
i2r=i2rx/x
i2x=vp/x
tanphi2=i2x/i2r
phi2=math.atan(tanphi2)
cosphi2=math.cos(phi2)
output1=3**0.5*v*i2*cosphi2/1000
#result
print "power output at unity pf=",output,"kW"
print "max power output=",output1,"kW"
#variable declaration
x=10.0#ohm
i=220.0#A
load=11.0#kV
per=25.0#%
#calculations
oa1=load*1000/3**0.5
a1c1=i*x
e0=(oa1**2+a1c1**2)**0.5
emf=(1+per/100)*e0
a1a2=(emf**2-a1c1**2)**0.5-oa1
ix=a1a2/x
i1=(i**2+ix**2)**0.5
pf=i/i1
bv=(oa1**2+emf**2)**0.5
imax=bv/x
ir=emf/x
ix=oa1/x
pfmax=ir/imax
output=3**0.5*load*1000*imax*pfmax*0.001
#result
print "new current=",i1,"A"
print "new power factor=",pf
print "max power output=",output,"kW"
#variable declaration
load=20.0#MVA
load1=35.0#MVA
pf=0.8
output=25.0#MVA
cosphi1=0.9
#calculations
loadmw=load1*pf
loadmvar=load1*0.6
sinphi=math.sin(math.acos(cosphi))
mva1=25
mw1=mva1*cosphi1
mvar1=25*sinphi1
mw2=loadmw-mw1
mvar2=loadmvar-mvar1
mva2=(mw2**2+mvar2**2)**0.5
cosphi2=mw2/mva2
#result
print "output=",mva2
print "pf=",cosphi2
#variable declarations
load=600#KW
loadm=707#kW
pf=0.707
output=900#kW
pf1=0.9
#calculation
kva=1000
kvar=kva*(1-pf1**2)**0.5
active_p=1307-output
reactive_p=loadm-kvar
#result
print "active power shared by second machine=",active_p,"kW"
print "reactive power shared by second machine=",reactive_p,"kVAR"
#variable declaration
l1=500#kW
l2=1000#kW
pf1=0.9
l3=800#kW
pf2=0.8
l4=500#kW
pf3=0.9
output=1500#kW
pf=0.95
#calculation
kw1=l1
kw2=l2
kw3=l3
kw4=500
kvar2=kw2*0.436/pf1
kvar3=kw3*0.6/pf2
kvar4=kw4*0.436/pf3
kvar=output/pf
kw=kw1+kw2+kw3+kw4-output
kvar=kvar2+kvar3+kvar4-kvar
cosphi=math.cos(math.atan(kvar/kw))
#result
print "kW output=",kw
print "pf=",cosphi
#variable declaration
z=complex(0.2,2)
ze=complex(3,4)
emf1=complex(2000,0)
emf2=complex(22000,100)
#calculations
i1=complex(68.2,-102.5)
i2=complex(127,-196.4)
i=i1+i2
v=i*ze
pva1=v*i1
kw1=pva1.real*3
a11=math.atan(-i1.imag/i1.real)
a12=math.atan(-v.imag/v.real)
pf1=math.cos(a11-a12)
pva2=v*i2
kw2=pva2.real*3
a21=math.atan(-i2.imag/i2.real)
a22=math.atan(-v.imag/v.real)
pf2=math.cos(a21-a22)
#result
print "kw output 1=",kw1/1000
print "pf 1=",pf1
print "kw output 2=",kw2/1000
print "pf 2=",pf2
#variable declaration
load=5000#KVA
v=10000#V
f=50#Hz
ns=1500#rpm
j=1.5*10**4#khm2
ratio=5
#calculation
t=0.0083*ns*(j/(load*ratio*f))**0.5
#result
print "natural time period of oscillation=",round(t,3),"s"
#variable declaration
load=10000#KVA
p=4
v=6600#V
f=50#Hz
xs=25#%
pf=1.5
#calculations
ratio=100/xs
ns=120*f/p
j=(pf/(0.0083*ns))**2*load*ratio*f
#result
print "moment of inertia=",j/1000,"x10^4 kg-m2"
#variable declaration
load=10.0#MVA
v=10.0#kV
f=50.0#Hz
ns=1500.0#rpm
j=2.0*10**5#kgm2
x=40.0
#calculation
ratio=100.0/x
t=0.0083*ns*(j/(load*1000*ratio*f))**0.5
#result
print "frequency of oscillation of the rotor=",round(1/t,1),"Hz"
#variable declaration
v=11#kV
z=complex(1,10)
emf=14#kV
#calculations
e=emf*1000/3**0.5
v=v*1000/3**0.5
costheta=z.real/abs(z)
pmax=e*v*3/(z.imag*1000)
pmax_per_phase=(v/abs(z))*(e-(v/abs(z)))*3
#result
print "max output =",pmax_per_phase/1000,"kW"
#variable declaration
load=11#kVA
load1=10#MW
z=complex(0.8,8.0)
v=14#kV
#calculations
pmax=(load*1000/3**0.5)*(v*1000/3**0.5)*3/z.imag
imax=((v*1000/3**0.5)**2+(load*1000/3**0.5)**2)**0.5/z.imag
pf=(v/3**0.5)*1000/((v*1000/3**0.5)**2+(load*1000/3**0.5)**2)**0.5
#result
print "maximum output=",pmax/1000000,"MW"
print "current=",imax,"A"
print "pf=",pf