from sympy import symbols, solve
kVA=4000 #kVA#rating
f1_nl=50 #Hz(No load frequency of machine1)
f1_fl=47.5 #Hz(No load frequency of machine1)
f2_nl=50 #Hz(No load frequency of machine2)
f2_fl=48 #Hz(No load frequency of machine2)
L=6000 #kW(Load)
L1=symbols('L1') #Load of machine1
#f1_nl-(f1_nl-f1_fl)*L1/kVA=f1_nl-(f2_nl-f2_fl)*L2/kVA where L2=L-L1
L1=(f2_nl-f2_fl)*L/((f1_nl-f1_fl)+(f2_nl-f2_fl)) #kW
L2=L-L1 #kW
print "Part(a)"
print "Load supplied by first machine = %0.2f kW"%L1
print "Load supplied by second machine = %0.2f kW "%L2
print "Part(b)"
L2=4000 #kW#Machine2 is supplying 4000kW
fdrop1=f1_nl-f1_fl #Hz(frequency drop of machine 1)
fdrop2=f2_nl-f2_fl #Hz(frequency drop of machine 2)
L1=L2*fdrop2/fdrop1 #kW#Load supplied by machine 1
L=L1+L2 #kW#Total Load
print "Total load supplied without getting over loaded = %0.2f kW"%L
from math import degrees, acos, asin, atan, sqrt, cos, sin
Lt=3000 #kW#Total Load
pf=0.8 #Power factor Lagging
I=150 #A
ZA=0.4+1J*12 #ohm#synchronous impedence
ZB=0.5+1J*10 #ohm#synchronous impedence
Vt=6.6 #kV#Terminal Voltage
L=Lt/2 #kW#Load supplied by each machine
LA=L #kW
LB=L #kW
#LB=sqrt(3)*Vt*IB*cosd(theta_B)
theta_B=acos(LB/sqrt(3)/Vt/I) #radian
IB=I*(cos(theta_B)-1J*sin(theta_B)) #A
I_total=Lt/sqrt(3)/Vt/pf #A#Total Current
IA_plus_IB=I_total*(0.8-1J*0.6) #A
IA=IA_plus_IB-IB #A
cos_thetaA=(IA).real/abs(IA) #lagging power factor
EA=Vt/sqrt(3)+IA*ZA/1000 #kV per phase
del_A=atan((EA).imag/(EA).real) #radian#Load Angle
emf_A=abs(EA) #kV per phase#Induced emf of machine A
EB=Vt/sqrt(3)+IB*ZB/1000 #kV per phase
del_B=atan((EB).imag/(EB).real) #radian#Load Angle
emf_B=abs(EB) #kV per phase#Induced emf of machine A
IA=abs(IA) #A
print "Current on machine A = %0.2f A "%IA
pfA=cos_thetaA #power factor
print "Lagging power factor of machine A = %0.4f"%pfA
print "Induced emf of machine A = %0.2f kV per phase "%emf_A,
print "Load angle of machine A = %0.2f degree "%degrees(del_A)
print "Load angle of machine B = %0.2f degree "%degrees(del_B)
print "Induced emf of machine B = %0.2f kV per phase"%emf_B
#Answer in the textbook is not accurate.
from __future__ import division
from math import pi, cos, sin
P=5 #MVA
V=1000 #V
speed=1500 #rpm#speed
ns=speed/60 #rps
f=50 #Hz
pf=0.8 #Power factor Lagging
Xs=20 #%#synchronous reluctance
Xs=Xs/100 #/p.u.
print "Part(a)"
V=1 #p.u.#on no load
E=1 #p.u.#on no load
Ps=V*E/Xs #p.u.
Ps=Ps*P #MW per elect. radian
Ps=Ps*1000 #kW per elect. radian
#1 mech. radian=pi/90 elect. radian
Ps=Ps*pi/90 #kW per mech. degree
print "Synchronising power per mech. degree = %0.2f kW"%Ps
d=0.5 #degree##displacement
Ts=Ps*1000*d/2/pi/ns #N-m
print "Synchronising torque = %0.2f N-m"%Ts
print "Part(b)"
theta=acos(pf) #radian
E=V+(cos(theta)-1J*sin(theta))*1J*Xs #p.u.
Ps=V*E/Xs #p.u.
Ps=Ps*P #MW per elect. radian
Ps=Ps*1000 #kW per elect. radian
#1 mech. radian=pi/90 elect. radian
Ps=Ps*pi/90 #kW per mech. degree
Ps=abs(Ps) #kW per mech. degree
print "Synchronising power per mech. degree = %0.2f kW "%Ps
d=0.5 #degree##displacement
Ts=abs(Ps)*1000*d/2/pi/ns #N-m
print "Synchronising torque = %0.2f N-m "%Ts
#Answer in the textbook is not accurate.
from math import cos, sin, sqrt, pi
P=2 #MVA
V=6000 #V
speed=750 #rpm#speed
ns=speed/60 #rps
Zs=6 #ohm/phase
f=50 #Hz
pf=0.8 #Power factor Lagging
#Calculation
I=P*10**6/sqrt(3)/V #A#Current
theta=acos(pf) #radian
E=V/sqrt(3)+I*(cos(theta)-1J*sin(theta))*1J*Zs #V
Ps=V*sqrt(3)*E/Zs/1000 #kw per elect. radian
Ps=Ps*4*pi/180 #kW per mech. degree
Ps=abs(Ps) #kW per mech. degree
print "Synchronising power per mech. degree = %0.2f kW "%Ps
Ts=abs(Ps)*1000/2/pi/ns #N-m
print "Synchronising torque = %0.2f N-m" %Ts
#Answer in the textbook is not accurate.
from math import acos,cos,atan,degrees, sin, sqrt, pi
I=100 #A#/Current
V=11 #kV
Xs=4 #ohm/phase
f=50 #Hz
pf=0.8 #Power factor Lagging
#Calculation
theta=acos(pf) #radian
print "Part(a)"
E=V*1000/sqrt(3)+I*(cos(theta)-1J*sin(theta))*1J*Xs #V
Del=atan((E).imag/(E).real) #radian
E=abs(E) #V/phase
print "Open circuit phase emf %0.2f V/phase "%E
print "Angle delta = %0.2f degree"%degrees(Del)
print "Part(b)"
del_dash=10+degrees(Del) #degree
P_by_V=E*sin(del_dash*pi/180)/Xs #per phase
#P=V*I*cos_fi
I_cos_fi=P_by_V
#V*1000/sqrt(3)+I*(cos_fi-%i*sin_fi)*%i*Xs=E
I_sin_fi=(sqrt(E**2-(4*I_cos_fi**2))-V*1000/sqrt(3))/4
tan_fi=I_sin_fi/I_cos_fi
fi=degrees(atan(tan_fi)) #degree
I=I_cos_fi/cos(fi*pi/180) #A
print "New load current = %0.2f A "%I
pf=cos(fi*pi/180) #lagging power factor
print "Its power factor = %0.4f lagging " %pf
print "Part(c)"
pf1=0.8 #/original power factor
Idash=I*pf/pf1 #Current
print "New value of load current = %0.2f A "%Idash
#Answer is slightly differ because of accuracy in calculations.
G=200 #MVA
H=6 #MJ/MVA#/Inertia Constant
V=11 #kV
f=50 #Hz
L1=120 #MW
L2=160 #MW
#Calculation
print "Part(a)"
Es=G*H #MJ##Stored Energy
print "Stored energy = %0.2f MJ "%Es
print "Part(b)"
Pa=L1-L2 #MW
M=G*H/180/f #MJ-sec/elect.deg.
alfa=-Pa/M #elect.deg./sec**2#/Retardation
print "Motor retardation = %0.2f elect.deg.sec**2" %alfa
print "Part(c)"
n=5 #cycles
t=n/f #sec
del_change=1/2*-alfa*t**2 #elect.deg.
print "Change in power angle = %0.2f elect.deg. "%del_change
alfa=alfa*60/(180*4) #rpm/sec
ns=1500 #rpm
nr=ns+(-alfa)*t #rpm #/rotor speed
print "Rotor speed at the end of 5 cycle = %0.2f rpm "%nr
print "Part(d)"
H2=4 #MJ/MVA
G2=150 #MVA
Gb=100 #MVA
Heb=H*G/Gb+H2*G2/Gb #MJ/MVA
print "Inertia constant for the equivalent generator = %0.2f MJ/MVA "%Heb