import math
# Given Data;
slots = 18.;
p = 2.; #nmber of poles
ph = 3.; #three phase winding
# Calculations and Results
SA = (360/slots); #slot angle
m = slots/(p*ph); #m = nmber of slots per pole per phase
print "number of slots per pole per phase, m = %d"%(m);
print "emfs of the oils of each phase will have a time-phase difference of %d degree mechanical "%(SA);
k_d = math.sin(math.radians((m*SA)/2))/(m*math.sin(math.radians(SA/2)));
print "distribution factor = %f"%(k_d);
import math
# Given Data
slots = 36.; #number of slots
poles = 4.; #number of poles
ph = 3.; #math.single layer three phase winding
# Calculations and Results
SP = slots/ph; #number of slots per phase
print "number of slots per phase = %d"%(SP);
m = SP/poles; #munber of slots per pole per phase
print "number of slots per pole per phase, m = %d"%(m)
SA_m = 360/slots; #slot angle mechanical
SA_e = (poles/2)*SA_m #slot angle electrical
print "slot angle = %d degree electrical"%(SA_e)
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d)
import math
# Given Data;
slots = 48.; #number of slots
poles = 4.; #4-pole machine
ph = 3.; #3-phase machine
# Calculations and Results
SA = 360/slots; #slot angle
print "total number of slots = %d"%(slots);
print "slot angle = %f degree mechanical"%(SA);
#coil span is 11 slot pitches
#12 slots subtend 180degress, short pitched by 1 slot
Bta = 1*180./12;
k_p = math.cos(math.radians(Bta/2));
print "pitch factor = %f"%(k_p)
import math
# Given Data;
slots = 72.; #number of slots
P = 8.; #number of poles
ph = 3.; #3-phase machine
N = 750.; #speed of machine in rpm
#winding is made with 36 coils having 10 turns
Fp = 0.15; #flux per pole
fre = (P*N)/120;
NCp = 36./ph; #nmber of coils per phase
T = NCp*10; #number of turns per phase
k_p = 1; #math.since full pitched pitch factor is 1
# Calculations and Results
print "flux per pole = %fWb"%(Fp)
print "number of turns per phase = %d"%(T);
print "pitch factor = %f"%(k_p);
m = slots/(P*ph); #slots per pole per phase
SA_m = 360/slots; #slot angle mechanical
SA_e = (P/2)*SA_m;
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d);
E = 4.44*Fp*fre*T*k_d*k_p;
print "RMS vale of emf induced per phase = %fV"%(E)
import math
# Given Data;
print ("E(line to line) = 440V");
E_l = 440.; #line-to-line voltage
E_p = E_l/(math.sqrt(3));
N = 750.; #speed in rpm
fre = 50.; #frequency
# Calculations and Results
P = (120*fre)/N;
print "P = %d"%(P);
print "Eper phase) = %dV"%(E_p);
ph = 3; #3-phase machine
m = 2; #number of slots per pole per phase
slots = m*P*ph; #total number of stator slots
SA_m = 360/slots; #slot angle mechanical
SA_e = (P/2)*SA_m; #slot angle electrical
k_p = 1; #assuming full pitch
print "slot angle = %d degree electrical"%(SA_e);
print "pitch factor = %f"%(k_p);
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d);
#2 slots per pole per phase
NSp = 2*P; #number of slots per phase
NTc = 4; #number of turns per coil
T = 8*NTc; #number of turns per phase
Fp = E_p/(4.44*fre*T*k_d*k_p);
print "flux per pole = %fWb"%(Fp);
import math
#chapter 5
#example 5.6
#page 428
# Given Data;
slots = 144.; #number of slots
ph = 3.; #3-phase machine
P = 16.; #number of poles
Cp = 10.; #number of conducters per slot
Fp = 0.03; #flux per pole
Ns = 375.; #synchronous speed
# Calculations and Results
fre = (Ns*P)/120; #frequency
print "frequency = %d"%(fre);
m = slots/(P*ph); #number of slots per pole per phase
print "number of slots per pole per phase, m = %d"%(m);
SA_m = 360/slots; #slot angle mechanical
SA_e = (P/2)*SA_m; #slot angle electrical
k_p = 1 #no short pitching
print "short pitch = %d"%(k_p);
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d);
T = (slots*10)/(2*ph);
print "number of turns per phase, T = %d"%(T);
E = 4.44*Fp*fre*T*k_d*k_p;
print "RMS value of induced emf per phase, E = %fV"%(E);
print "induced emf across the linesis %fV "%(math.sqrt(3)*E);
import math
# Given Data;
slots = 90.; #number of slots
P = 10.; #number of poles
ph = 3.; #3-phase machine
fre = 50.; #frequency
Fp = 0.16; #flux per pole
E_l = 11000.; #line voltage
SA_m = 360/slots; #machanical slot angle
# Calculations and Results
SA_e = (P/2)*SA_m; #electrical slot angle
m = slots/(ph*P);
print "slot angle = %d degree elecrical"%(SA_e)
print "number of slots per pole per phase, m = %d"%(m);
k_p = 1; #assuming full pitch
print "pitch factor = %d"%(k_p);
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d);
E_p = E_l/math.sqrt(3);
T = E_p/(4.44*Fp*fre*k_p*k_d);
print "total number of armature conductors, Z = %d"%(2*T);
import math
# Given Data;
print ("P = 6 , f = 50");
P = 6.;
f = 50.;
Sp = 12.; #slots per pole
Cs = 4.; #conductors per slot
Fp = 1.5;
# Calculations and Results
TS = Sp*P
print "total number of slots = %d"%(TS);
print "total number of slots per phase = %d"%( TS/3);
print "total number of conductors per phase = %d"%(( TS*Cs)/3);
T = ((TS*Cs)/3)/2;
print "total number of turns per phase = %d"%(T)
m = (TS/(P*3));
print "number of slots per pole per phase, m = %d"%(m);
SA_m = 360/TS; #slot angle mechanical
SA_e = (P/2)*SA_m;
k_d = math.sin(math.radians((m*SA_e)/2))/(m*math.sin(math.radians(SA_e/2)));
print "distribution factor = %f"%(k_d);
print ("coil pitch is 5/6 of full-pitch");
bheta = 180-(5./6)*180; #short pitch angle
print "short pitch angle = %d degrees"%(bheta)
k_p = math.cos(math.radians(bheta/2));
print "pitch factor = %f "%(k_p);
E = 4.44*Fp*f*T*k_d*k_p;
print "induced per phase = %fV"%(E)
import math
# Given Data;
OP = 500000.; #output power
V_l = 3300.; #line voltage
# Calculations and Results
I_l = OP/(math.sqrt(3)*V_l); #line current
print "line current = %fA"%(I_l);
#for star connected alternater, line current is equal to phase current
I_a = I_l;
pf = 0.8; #power factor
phi = math.degrees(math.acos(pf));
R_a = 0.3; #synchronous resistance
X_s = 4; #synchronous reactance
V_p = V_l/math.sqrt(3);
print "phase voltage = %fV"%(V_p)
E = math.sqrt((V_p*math.cos(math.radians(phi))+I_a*R_a)**2+(V_p*math.sin(math.radians(phi))+I_a*X_s)**2);
print "induced emf = %f V/Phase"%(E )
PR = ((E-V_p)*100)/V_p;
print "percentage regulation = %f percent"%(PR);
import math
# Given Data
V = 2000.;
V_oc = 500.; #open circuit voltage
I_sc = 100.; #short circuit current
I_a = 100.;
R_s = 0.8; #armature resistance
# Calculations and Results
Z_s = V_oc/I_sc; #synchronous impedence
print "Z_s = %d ohm"%(Z_s);
X_s = math.sqrt(Z_s**2-R_s**2);
print "X_s = %f ohm"%(X_s);
pf = 1;
phi = math.degrees(math.acos(pf));
print ("At unity power factor");
print "";
E = math.sqrt((V*math.cos(math.radians(phi))+I_a*R_s)**2+(V*math.sin(math.radians(phi))+I_a*X_s)**2);
print "induced emf = %fV"%(E);
R = ((E-V)*100)/V;
print "regulation = %f percent"%(R);
pf = 0.71;
phi = math.degrees(math.acos(pf));
print ("At 0.71 lagging power factor");
print "";
E = math.sqrt((V*math.cos(math.radians(phi))+I_a*R_s)**2+(V*math.sin(math.radians(phi))+I_a*X_s)**2);
print "induced emf = %fV"%(E);
R = ((E-V)*100)/V;
print "regulation = %fpercent"%(R);
pf = 0.8;
phi = math.degrees(math.acos(pf));
print ("At 0.8 leading power factor");
print "";
E = math.sqrt((V*math.cos(math.radians(phi))+I_a*R_s)**2+(V*math.sin(math.radians(phi))-I_a*X_s)**2);
print "induced emf = %fV"%(E);
R = ((E-V)*100)/V;
print "regulation = %fpercent"%(R);
# Given Data;
print ("field exitation current = 10A");
V_oc = 900.; #induced emf on open circuit
I_sc = 150.; #short circuit current
# Calculations and Results
Z_s = V_oc/I_sc; #synchronous impedence
print "synchronous impedence, Z_s = %d ohm"%(Z_s);
I_a = 60;
print "internal voltage drop when the load current is 60amp = %d V"%(I_a*Z_s);
import math
# Given Data;
KVA = 2000.;
V = 6600.; #rating
V_p = 6600./math.sqrt(3);
I_a = (KVA*1000)/(math.sqrt(3)*V);
R_a = 0.4; #armature resistance
X_s = 4.5 #synchronous reactance
pf = 0.8;
# Calculations and Results
phi = math.degrees(math.acos(pf));
print "V/phase = %dV "%(V_p)
E = math.sqrt((V_p*math.cos(math.radians(phi))+I_a*R_a)**2+(V_p*math.sin(math.radians(phi))+I_a*X_s)**2)
print "E = %f V per phase"%(E);
R = ((E-V_p)*100)/V_p;
print "percentage change in terminal voltage = %f percent"%(R);
import math
# Given Data;
KVA = 1200.; #output power
print "output power = %d"%(KVA)
V_l = 3300.; #line voltage
R_a = 0.25; #armature resistance
# Calculations and Results
I_l = (KVA*1000)/(math.sqrt(3)*V_l); #line current
#for star connected I_l = I_a
I_a = I_l;
V_p = V_l/math.sqrt(3);
print "V per phase = %dV"%(V_p)
#field current of 40A produces short circuit current of 200A and open circuit emf 1100
v_l = 1100;
i_s = 200;
Z_s = v_l/(math.sqrt(3)*i_s); #synchronous impedence
print "Synchronous impedance, Zs = %f ohm"%(Z_s)
X_s = math.sqrt(Z_s**2-R_a**2); #synchronous reactance
print ("(a)for 0.8 lagging power facor");
pf = 0.8;
phi = math.degrees(math.acos(pf));
E = math.sqrt((V_p*math.cos(math.radians(phi))+I_a*R_a)**2+(V_p*math.sin(math.radians(phi))+I_a*X_s)**2)
print "induced emf, E = %f V"%(E);
R = ((E-V_p)*100)/V_p;
print "regulation = %f percent"%(R);
pf = 0.8;
phi = math.degrees(math.acos(pf));
print ("(b)For leading power factor load")
E = math.sqrt((V_p*math.cos(math.radians(phi))+I_a*R_a)**2+(V_p*math.sin(math.radians(phi))-I_a*X_s)**2)
print "induced emf, E = %f V"%(E);
R = ((E-V_p)*100)/V_p;
print "regulation = %f percent"%(R);
import math
# Given Data;
print ("star connected alternator")
KVA = 1500.; #rating
ph = 3.; #3-phase
V_l = 6600.; #voltage
Ra = 0.4 #armature resistance
Xs = 6.; #reactance
# Calculations and Results
Ia = (KVA*1000)/(math.sqrt(3)*V_l);
print "Full-load current = %d A"%(Ia);
V = V_l/math.sqrt(3);
print "Voltage per phase = %d V"%(V);
print ("for 0.8 lagging power facor");
pf = 0.8; #power factor
phi = math.degrees(math.acos(pf));
E = math.sqrt((V*math.cos(math.radians(phi))+Ia*Ra)**2+(V*math.sin(math.radians(phi))+Ia*Xs)**2)
print "induced emf = %f V"%(E);
print ("then at 0.8 leading power factor");
Vt = 4743; #solved manually
print "termial Voltage, line-to-line = %d V"%(math.sqrt(3)*Vt)
import math
#chapter 5
#example 5.15
#page 450
# Given Data;
L = 8000.; #load
La = 5000.;
pf = 0.8;
# Calculations and Results
phi = math.degrees(math.acos(pf));
print "math.tan phi = %f"%(math.degrees(math.atan(phi)));
print ("FOR ALTERNATOR A");
pf_a = 0.9;
phi_a = math.degrees(math.acos(pf_a));
print "math.tan phi_a = %f"%(math.degrees(math.atan(phi_a)));
print ("reactive load = active load*math.tan phi");
print ("Active load = 8000kW");
print "reactive load = %d KVAr"%(8000*math.degrees(math.atan(phi_a)));
print ("Active Load A = 5000kW");
print "Reactive load A = %dkVAr"%(5000*math.degrees(math.atan(phi_a)));
print "Active load of B = %dkW"%(L-La);
a = ((8000*math.degrees(math.atan(phi)))-(5000*math.degrees(math.atan(phi_a))))
print "Reactive load of B = %dkVAr"%(a);
B = a/(L-La);
phi_b = math.degrees(math.atan(B));
print "phi_b = %f"%(phi_b)
print "Power Factor of B = %f"%(math.cos(math.radians(phi_b)));
import math
# Given Data
V = 6600.;
ph = 3.; #3-phase alternators
power = 10000.; #total load
# Calculations and Results
print ("Two alternators in parallel connection");
pf = 0.8;
Ia = 438; #armature current
Il = (power*1000)/(math.sqrt(3)*V*pf); #load current
print "load current = %fA"%(Il);
phi = math.degrees(math.acos(pf));
Ac = (Il*math.cos(math.radians(phi)));
Rc = (Il*math.sin(math.radians(phi)));
print "Active component of current = %fA"%(Ac);
print "Reactive component of current = %fA"%(Rc);
print "Current supplied by each alternator = %fA"%(Il/2);
print "Active component of current supplied by each alternator = %fA"%(Ac/2);
print "Reactive component of current supplied by each alternator = %fA"%(Rc/2);
print ("Since steam supply is same,the active component remain the same ");
RIl = math.sqrt(Ia**2-(Ac/2)**2);
print "Reactive component of Il = %dA"%(RIl);
RI2 = (Rc-RIl);
print "reactive component of I2 = %fA"%(RI2);
I2 = math.sqrt((Ac/2)**2+(RI2)**2);
print " I2 = %fA"%(I2);
phi_2 = math.degrees(math.atan(RI2/(Ac/2)));
print "phi 2 = %f degrees"%(phi_2);
print "math.cos phi 2 = %f"%(math.cos(math.radians(phi_2)));
import math
# Given Data;
print ("power factor of existing load is 0.8 lagging");
pf = 0.8; #power factor
# Calculations and Results
phi = math.degrees(math.acos(pf));
print "phi = %d degree"%(phi);
L = 800.; #load
kVAr1 = (L*math.degrees(math.atan(phi)));
print "kVAr1 = %d "%(kVAr1);
print ("output for the synchronous motor is 200kW");
output = 200.;
efficiency = 0.9;
kW = (output/efficiency);
print "Input to the synchronous motor = %fkW"%(kW);
TL = (L+kW); # total load
print "Total load on the system = %fkW"%(TL);
print ("overall power factor of the load is to be raised to 0.92 lagging");
pf = 0.92;
phi = math.degrees(math.acos(pf));
kVAr2 = (TL*math.degrees(math.atan(phi)))
print "kVAr2 = %f"%(kVAr2);
kVAr = kVAr1-kVAr2;
print "lagging kVAr of synchronous codenser = %f"%(kVAr);
print "leading kVAr supplied by the motor = %f"%(kVAr);
phi = math.degrees(math.atan(kVAr/kW));
print "phi = %d degree"%(phi);
print "Power factor of the synchronos motor = %f leading "%(math.cos(math.radians(phi)));
print "KVA rating of the synchronous motor = %f"%(kW/math.cos(math.radians(phi)));