w = 0.8 #Coal to be burnt for every kWh of electric energy(kg)
C = 5000 #Calorific value of coal(kilo-calories/kg)
heat_energy = C*w/860 #Heat energy of combustion of given coal(kWh)
efficiency = 1/heat_energy #Overall efficiency
print('Overall efficiency of the plant = %.3f' %efficiency)
P = 250.0 #Power(MW)
C = 6100.0 #Calorific value(kcal/kg)
n_1 = 0.9 #Plant runs at full load
h_1 = 20.0 #Time for full load(hour)
n_2 = 0.75 #Plant runs at full load
h_2 = 4.0 #Time for full load(hour)
n_t = 0.3 #Thermal efficiency
n_g = 0.93 #Generator efficiency
E_T = (P*n_1*h_1+P*n_2*h_2)*1000 #Total electric energy produced by plant in a day(kWh)
efficiency = n_t * n_g #Overall efficiency of the plant
heat_energy = E_T*860/efficiency #Heat energy of combustion of coal(kcal)
coal_requ = heat_energy/C #Daily coal requirement(kg)
coal_requ_ton = coal_requ*10**-3 #Daily coal requirement(tonnes)
print('Daily coal requirement = %.2e kg = %.f tonnes' %(coal_requ,coal_requ_ton))
Q = 1.0 #Water discharge(m^3/sec)
h = 200.0 #Height(m)
n_h = 0.85 #Hydraulic efficiency
n_e = 0.95 #Electric efficiency
n = n_h*n_e #Overall efficiency
P = (736.0/75)*Q*h*n #Electrical power available(kW)
E = P*1.0 #Energy available in an hour(kWh)
print('Electrical power available = %.2f kW' %P)
print('Energy available in an hour = %.2f kWh' %E)
Ad = 6.0*10**6 #Reservoir capacity(m^3)
h = 150.0 #Head(m)
n = 0.78 #Overall efficiency
P = 25.0*10**6 #Power(Watt)
t = 4.0 #Supply time(hour)
AX = P*75*3600*t/(736*h*n*1000) #unit(m^3)
X_d = AX/Ad*100 #Fall in reservoir level(%)
print('Percentage fall in reservoir level = %.2f percent' %X_d)
X_s = 1.0 #Synchronous reactance of generator(p.u)
V_b = 1.0 #Terminal voltage of generator=voltage of infinite bus(p.u)
P_G = 0.5 #Real power output at unity pf(p.u)
import math
import cmath
I = P_G/V_b #Generator current(p.u)
E = complex(V_b,I*X_s) #Excitation emf of finite machine(p.u)
delta = cmath.phase(E)*180/math.pi #Power angle = angle b/w E & V_b(degree)
P_Gn = P_G/2 #Real power o/p when steam i/p is halved(p.u)
sin_delta_n = P_Gn*X_s/(abs(E)*V_b)
delta_n = math.asin(sin_delta_n) #New power angle(radian)
E_n = abs(E)*cmath.exp(1j*delta_n) #Excitation emf of finite machine with new angle(p.u)
I_n = (E_n-V_b)/complex(0,X_s) #Current when steam i/p is halved(p.u)
pf_n = math.cos(cmath.phase(I_n)) #Power factor when steam i/p is halved
P_po = abs(E)*V_b/X_s #Pull out power(p.u)
stiff_a = abs(E)*V_b/X_s*math.cos(cmath.phase(E)) #Electrical stiffness in case(a) (p.u/radian)
stiff_b = abs(E)*V_b/X_s*math.cos(cmath.phase(I_n)) #Electrical stiffness in case(b) (p.u/radian)
print('Case(a) :')
print('Excitation voltage of finite machine , E = %.2f∠%.2f° p.u' %(abs(E),delta))
print('Power angle = %.2f°' %delta)
print('\nCase(b) :')
print('Current if steam input is reduced to half , I_n = %.3f∠%.2f° p.u' %(abs(I_n),cmath.phase(I_n)*180/math.pi))
print('Power factor if steam input is reduced to half = %.2f lagging' %pf_n)
print('Power angle if steam input is reduced to half = %.2f°' %(delta_n*180/math.pi))
print('\nCase(c) :')
print('Pull out power = %.2f p.u' %P_po)
print('\nCase(d) :')
print('Electrical stiffness for case(a) = %.1f p.u/radian' %stiff_a)
print('Electrical stiffness for case(b) = %.3f p.u/radian' %stiff_b)
X_s = 1.1 #Synchronous reactance of generator(p.u)
V_b = 1.0 #Terminal voltage of generator=voltage of infinite bus(p.u)
E = 1.25 #Excitation emf of finite machine(p.u)
P_G = 0.3 #Active power output(p.u)
dec = 0.25 #Excitation is decreased
import math
import cmath
sin_delta = P_G*X_s/(E*V_b)
delta = math.asin(sin_delta) #Power angle(radian)
Q_G = V_b/X_s*(E*math.cos(delta)-V_b) #Reactive power output(p.u)
E_n = (1-dec)*E #New excitation emf of finite machine(p.u)
P_Gn = P_G #New active power output(p.u)
sin_delta_n = P_G*X_s/(E_n*V_b)
delta_n = math.asin(sin_delta_n) #New power angle(radian)
Q_Gn = V_b/X_s*(E_n*math.cos(delta_n)-V_b) #New reactive power output(p.u)
print('Case(a) :')
print('Power angle = %.2f°' %(delta*180/math.pi))
print('Reactive power output , Q_G = %.3f p.u' %Q_G)
print('\nCase(b) :')
print('Active power if excitation is decreased , P_Gn = %.1f p.u' %P_Gn)
print('Reactive power if excitation is decreased , Q_Gn = %.3f p.u' %Q_Gn)
print('Power angle if excitation is decreased = %.2f°' %(delta_n*180/math.pi))
X_s = 1.05 #Synchronous reactance of generator(p.u)
V_b = 0.95 #Terminal voltage of generator=voltage of infinite bus(p.u)
X_L = 0.1 #Reactance of link(p.u)
E = 1.2 #Excitation emf of finite machine(p.u)
P_G = 0.15 #Active power output(p.u)
inc = 1 #Turbine torque increased
import math
import cmath
sin_delta = P_G*(X_s+X_L)/(E*V_b)
delta = math.asin(sin_delta) #Power angle(radian)
Q_G = V_b/(X_s+X_L)*(E*math.cos(delta)-V_b) #Reactive power output(p.u)
P_Gn = (1+inc)*P_G #New active power output(p.u)
sin_delta_n = P_Gn*(X_s+X_L)/(E*V_b)
delta_n = math.asin(sin_delta_n) #Power angle(radian)
Q_Gn = V_b/(X_s+X_L)*(E*math.cos(delta_n)-V_b) #Reactive power output(p.u)
P_change = (P_Gn-P_G)/P_G*100 #Change in active power output(%)
Q_change = (Q_Gn-Q_G)/Q_G*100 #Change in reactive power output(%)
print('Change in active power supplied by generator = %.f percent' %P_change)
print('Change in reactive power supplied by generator = %.2f percent' %Q_change)
X_s = 6.0 #Synchronous reactance of alternator(ohms/phase)
pf = 0.8 #Lagging power factor
P_G = 5.0 #Power delivered(MW)
V = 11.0 #Voltage of infinite bus(kV)
import math
import cmath
delta = math.acos(pf)
I = P_G*1000/(3**0.5*V*pf)*(pf - complex(0,math.sin(delta))) #Alternator current(A)
V_b = V*10**3/3**0.5 #Voltage of infinite bus(V/phase)
E = complex(V_b,I*X_s) #Initial excitation voltage(V)
pf_n = 1.0 #New power factor
P_Gn = P_G #New power delivered(MW)
I_n = P_Gn*1000/(3**0.5*V*pf_n) #Alternator current(A)
E_n = complex(V_b,I_n*X_s) #New excitation voltage(V)
excitation_change = (abs(E)-abs(E_n))/abs(E)*100 #Percentage change in excitation(%)
print('Percentage change in excitation = %.2f percent' %excitation_change)