In [27]:

```
from __future__ import division
%matplotlib inline
from matplotlib.pyplot import plot, title, xlabel, ylabel, show
#Input data
C=30#Capacity in MW
M=70#Loads are taken above 70 MW
t1=[0,6]#Time range in hours
t2=[6,10]#Time range in hours
t3=[10,12]#Time range in hours
t4=[12,16]#Time range in hours
t5=[16,20]#Time range in hours
t6=[20,22]#Time range in hours
t7=[22,24]#Time range in hours
L=[30,70,90,60,100,80,60]#Load in MW
#Calculations
E=((L[0]*(t1[1]-t1[0]))+(L[1]*(t2[1]-t2[0]))+(L[2]*(t3[1]-t3[0]))+(L[3]*(t4[1]-t4[0]))+(L[4]*(t5[1]-t5[0]))+(L[5]*(t6[1]-t6[0]))+(L[6]*(t7[1]-t7[0])))#Energy generated in MWh
AL=(E/24)#Average load in MW
PL=max(L[0],L[1],L[2],L[3],L[4],L[5],L[6])#Peak load in MW
LF=(AL/PL)#Load factor of the plant
E1=((L[2]-M)*(t3[1]-t3[0]))+((L[4]-M)*(t5[1]-t5[0]))+((L[5]-M)*(t6[1]-t6[0]))#Energy generated if the load above 70 MW is supplied by a standby unit of 30 MW capacity in MWh
T=(t3[1]-t3[0])+(t5[1]-t5[0])+(t6[1]-t6[0])#Time during which the standby unit remains in operation in h
AL1=(E1/T)#Average load in MW
LF1=(AL1/C)#Load factor
U=(E1/(C*T))#Use factor
#Output
t=[0,0,6,6,10,10,12,12,16,16,20,20,22,22,24,24]#Time for plotting load curve in hours
l=[0,30,30,70,70,90,90,60,60,100,100,80,80,60,60,0]#Load for plotting load curve in MW
plot(t,l)#Load curve taking Time in hours on X-axis and Load in MW on Y- axis
title('Load Curve')
xlabel('Time hours')
ylabel('Load MW')
print "(a)Load factor of the plant is %3.2f\n(b)Load factor of a standby equipment of %3.0f capacity if it takes up all the loads above %3.0f MW is %3.2f\n(c)Use factor is %3.2f"%(LF,C,M,LF1,U)
```

In [9]:

```
from __future__ import division
#Input data
P=60#Peak load on power plant in MW
L=[30,20,10,14]#Loads having maximum demands in MW
C=80#Capacity of the power plant in MW
A=0.5#Annual load factor
Y=8760#Number of hours in a year of 365 days
#Calculations
AL=(P*A)#Average load in MW
E=(AL*1000*Y)/10**6#Energy supplied per year in kWh*10**6
DF=(P/(L[0]+L[1]+L[2]+L[3]))#Demand factor
DIF=((L[0]+L[1]+L[2]+L[3])/P)#Diversity factor
#Output
print "(a) The average load on the power plant is %3.0f MW \n(b) The energy supplied per year is %3.1f *10**6 kWh \n(c) Demand factor is %3.3f \n(d) Diversity factor is %3.3f"%(AL,E,DF,DIF)
```

In [10]:

```
#Input data
C=210#Capacity of thermal power plant in MW
P=160#Maximum load in MW
L=0.6#Annual load factor
m=1#Coal consumption per kWh of energy generated
Rs=450#Cost of coal in Rs per tonne
Y=8760#Number of hours in a year of 365 days
#Calculations
AL=(L*P)#Average load in MW
E=(AL*Y)#Energy generated per year in MWh
CL=(E*1000)#Coal required per year in kg
CY=(E*Rs)#Cost of coal per year
CE=CL#Cost of energy sold in Rs
RY=(CE-CY)/10**7#Revenue earned by the power plant per year in Rs crore
CF=(AL/C)#Capacity factor
#Output
print "(a) The annual revenue earned by the power plant is Rs %3.2f crore \n(b) Capacity factor is %3.3f"%(RY,CF)
```

In [11]:

```
#Input data
L=0.75#Load factor
C=0.60#Capacity factor
U=0.65#Use factor
M=60#Maximum power demand in MW
Y=8760#Number of hours in a year of 365 days
#Calculations
A=(L*M)#Average load in MW
P=((A*1000)*Y)/10**6#Annual energy production in kWh *10**6
PC=(A/C)#Plant capacity in MW
R=(PC-M)#Reserve capacity in MW
HIO=(P*1000/(U*PC))#Hours in operation in hrs
NH=(Y-HIO)#Hours not in service in a year in hrs
#Output
print "(a) Annual energy production is %3.1f * 10**6 kWh \n(b) Reserve capacity over and above the peak load is %3.0f MW \n(c) The hours during which the plant is not in service per year is %3.0f hrs"%(P,R,NH)
```

In [12]:

```
from __future__ import division
#Input data
Dd=500#Maximum demand in MW
L=0.7#Load factor
#1)Steam power plant 2)Hydroelectric power plant 3)Nuclear power plant
CC=[0,3,4,5]#Capital cost per MW installed in Rs. crore
I=[0,6,5,5]#Interest in percent
D=[0,6,4,5]#Depreciation in percent
OP=[0,30,5,15]#Operating cost (including fuel) per kWh
TD=[0,2,3,2]#Transmission and distribution cost per kWh
Y=8760#Number of hours in a year of 365 days
#Calculations
#1)Steam power plant
CCX=(CC[(1)]*Dd*10**7)#Capital cost in Rs
IX=((I[(1)]/100)*CCX)#Interest in Rs
DX=((D[(1)]/100)*CCX)#Depreciation in Rs
AFCX=IX+DX#Annual fixed cost in Rs
EX=(L*Dd*1000*Y)#Energy generated per year in kWh
RX=(OP[(1)]+TD[(1)])#Running cost/kWh in paise
OX=((AFCX/EX)+(RX/100))*100#Overall cost/kWh in paise
#2)Hydroelectric Power plant
CCY=(CC[(2)]*Dd*10**7)#Capital cost in Rs
IY=((I[(2)]/100)*CCY)#Interest in Rs
DY=((D[(2)]/100)*CCY)#Depreciation in Rs
AFCY=IY+DY#Annual fixed cost in Rs
EY=(L*Dd*1000*Y)#Energy generated per year in kWh
RY=(OP[(2)]+TD[(2)])#Running cost/kWh in paise
OY=((AFCY/EY)+(RY/100))*100#Overall cost/kWh in paise
#3)Nuclear power plant
CCZ=(CC[(3)]*Dd*10**7)#Capital cost in Rs
IZ=((I[(3)]/100)*CCZ)#Interest in Rs
DZ=((D[(3)]/100)*CCZ)#Depreciation in Rs
AFCZ=IZ+DZ#Annual fixed cost in Rs
EZ=(L*Dd*1000*Y)#Energy generated per year in kWh
RZ=(OP[(3)]+TD[(3)])#Running cost/kWh in paise
OZ=((AFCZ/EZ)+(RZ/100))*100#Overall cost/kWh in paise
#Output
print "(i)Overall cost per kWh in Steam power plant is %3.0f paise \n(ii)Overall cost per kWh in Hydroelectric power plant is %3.0f paise \n(iii)Overall cost per kWh in Nuclear power plant is %3.0f paise"%(OX,OY,OZ)
```

In [13]:

```
from __future__ import division
#Input data
C=210#Capacity in MW
ID=12#Interest and depreciation in percent
CC=18000#Capital cost/kW installed in Rs
L=0.6#Annual load factor
AC=0.54#Annual capacity factor
RC=(200*10**6)#Annual running charges in Rs
E=6#Energy consumed by power plant auxiliaries in percent
Y=8760#Number of hours in a year of 365 days
#Calculations
MD=(C/L)*AC#Maximum demand in MW
RSC=(C-MD)#Reserve Capacity in MW
AL=(L*MD)#Average load in MW
EP=(AL*1000*Y)#Energy produced per year in kWh
NE=((100-E)/100)*EP#Net energy delivered in kWh
AID=((ID/100)*CC*C*1000)#Annual interest and depreciation in Rs
T=(AID+RC)#Total annual cost in Rs
CP=(T/NE)*100#Cost of power generation in paise
#Output
print "(a) The cost of power generation per kWh is %3.0f paise \n(b) The reserve capacity is %3.0f MW"%(CP,RSC)
```

In [14]:

```
from numpy import mat
#Input data
L=200#The total load supplied by the plants in MW
#The incremental fuel costs for generating units a and b of power plant are given by
#dFa/dPa=0.065Pa+25
#dFb/dPb=0.08Pa+20
#Calculations
#Solving two equations
#Pa+Pb=200
#0.065Pa+25=0.08Pb+20
A=mat([[1, 1],[0.065, -0.08]])#Coefficient matrix
B=mat([[L],[(20-25)]])#Constant matrix
X=(A**-1)*B#Variable matrix
P=100#If load is shared equally then Pa=Pb=100MW
a=(((0.065*P**2)/2)+(25*P))-(((0.065*X[0]**2)/2)+(25*X[0]))#increase in fuel cost for unit a in Rs. per hour
b=(((0.08*P**2)/2)+(20*P))-(((0.08*X[1]**2)/2)+(20*X[1]))#increase in fuel cost for unit a in Rs. per hour
x=a+b#Net increase in fuel cost due to departure from economic distribution of load in Rs. per hour
#Output
print "(a)The economic loading of two units when the total load supplied by the power plants is 200 MW are %3.2f MW and %3.2f MW\n(b)The loss in fuel cost per hour if the load is equally shared by both units is Rs.%3.2f per hour"%(X[0],X[1],x)
```

In [16]:

```
from math import ceil
#Input data
C=200#Installed capacity of the plant in MW
CC=400#Capital cost in Rs crores
ID=12#Rate of interest and depreciation in percent
AC=5#Annual cost of fuel, salaries and taxation in Rs. crores
L=0.5#Load factor
AL2=0.6#Raised Annual load
Y=8760#Number of hours in a year of 365 days
#Calculations
AvL=(C*L)#Average Load in MW
E=(AvL*1000*Y)#Energy generated per year in kWh
IDC=((ID/100)*CC*10**7)#Interest and depreciation (fixed cost) in Rs
T=(IDC+(AC*10**7))#Total annual cost in Rs
CP1=(T/E)*100#Cost per kWh in paise
AvL2=(C*AL2)#Average Load in MW
E2=(AvL2*1000*Y)#Energy generated per year in kWh
CP2=(T/E2)*100#Cost per kWh in paise
S=((CP1)-(CP2))#Saving in cost per kWh in paise
S1=ceil(S)#Rounding off to next higher integer
#Output
print " Cost of generation per kWh is %3.0f paise \n Saving in cost per kWh if the annual load factor is raised to 60 percent is %3.0f paise"%(CP1,S1)
```

In [17]:

```
#Input data
C=300#Capacity of power plant in MW
MXD=240#Maximum demand in MW in a year
MND=180#Minimum demand in MW in a year
#Assuming the load duration curve shown in Figure E1.9 on page no 30 to be straight line
Y=8760#Number of hours in a year of 365 days
#Calculations
E=((MND*Y)+0.5*(MXD-MND)*Y)*1000#Energy supplied per year in kWh
AL=(E/Y)#Average load in kW
L=((AL/1000)/MXD)#Load factor
CF=((AL/1000)*Y)/(C*Y)#Capacity factor
#Output
print "(a) Load factor is %3.3f \n(b) Capacity factor is %3.2f"%(L,CF)
```

In [21]:

```
#Input data
C=60#Capacity of power plant in MW
MXD=50#Maximum demand in MW in a year
L=60/100#Load factor
cc = 1 # kg/unit (Coal consumption)
c_cost = 600 # Rs/Tonne
e_cost = 2 # Rs/kWh
Y=8760#Number of hours in a year of 365 days
#Calculations
AL=(MXD*L)#Average load in MW
E=AL*10**3*Y #Energy generated per year in kWh
Coal = E*cc/10**3 # Tonnes (Coal required per year)
CC = Coal*c_cost # rupees (Coal cost / year)
CE = E*e_cost # Rs (Cost of energy sold)
Rev = CE-CC
#Output
print "Revenue earned by the power plant = %0.3e Rs./year"%(Rev)
```

In [18]:

```
%matplotlib inline
from matplotlib.pyplot import plot,subplot,title,xlabel,ylabel,show
#Input data
t1x=[0,6]#Time range in hours
t2x=[6,12]#Time range in hours
t3=[12,14]#Time range in hours
t4=[14,18]#Time range in hours
t5=[18,24]#Time range in hours
L=[30,90,60,100,50]#Load in MW
#Calculations
t1=[0,6,6,12,12,14,14,18,18,24,24]#Time in hours for Load curve
L1=[30,30,90,90,60,60,100,100,50,50,0]#Load in MW for Load curve
t2=[0,4,4,10,10,12,12,18,18,24,24]#Time in hours for Load duration curve
L2=[100,100,90,90,60,60,50,50,30,30,24]#Load in MW for Load duration curve
E=((L[0]*(t1x[1]-t1x[0]))+(L[1]*(t2x[1]-t2x[0]))+(L[2]*(t3[1]-t3[0]))+(L[3]*(t4[1]-t4[0]))+(L[4]*(t5[1]-t5[0])))#Energy generated in MWh
AL=E/24#Average load in MW
MD=max(L[0],L[1],L[2],L[3],L[4])#Maximum demand in MW
LF=(AL/MD)#Load factor
Lx=[30,10]#Loads for selecting suitable generating units in MW
tx=[24,18,10,4]#Time for selecting suitable generating units in hrs
PC=(Lx[0]*tx[3]+Lx[1]*1)#Plant capacity in MW
CF=(E/(PC*24))#Capacity factor
#Output
plot(t1,L1)#Load curve taking Time in hrs on X- axis and Load in MW on Y- axis
title('Load curve')
xlabel('Time hrs')
ylabel('Load MW')
show()
plot(t2,L2)#Load duration curve taking Time in hrs on X- axis and Load in MW on Y- axis
title('Load duration curve')
xlabel('Time hrs')
ylabel('Load MW')
show()
print "(c)Suitable generating units to supply the load are\ni)One unit of %3.0f MW will run for %3.0f hours\nii)One unit of %3.0f MW will run for %3.0f hours\niii)One unit of %3.0f MW will run for %3.0f hours\niv)One unit of %3.0f MW will run for %3.0f hours\n\n(d)Load factor is %3.2f\n\n(e)Capacity of the plant is %3.0f MW and Capacity factor is %3.3f"%(Lx[0],tx[0],Lx[0],tx[1],Lx[0],tx[2],Lx[1],tx[3],LF,PC,CF)
```

In [7]:

```
#Input data
C=10#Capacity of generating unit in MW
MD=[6,3.6,0.4]#Maximum demand for domestic consumers, industrial consumers and street-lighting load respectively in MW
L=[0.2,0.5,0.3]#Load factor for domestic consumers, industrial consumers and street-lighting load respectively
CC=10000#Capital cost of the plant per kW in Rs
RC=3600000#Total rumming cost per year in Rs
AID=10#Annual interest and depreciation on capital cost in percent
Y=8760#Number of hours in a year of 365 days
#Calculations
E=((MD[0]*L[0])+(MD[1]*L[1])+(MD[2]*L[2]))*Y*1000#Energy supplied per year to all three consumers in kWh
OC=(RC/E)#Operating charges per kWh in Rs
CCP=(C*1000*CC)#capital cost of the plant in Rs
FCY=((AID/100)*CCP)#Fixed charges per year in Rs
FCkW=(FCY/CC)#Fixed charges per kW in Rs
#a) For domestic consumers
TC1=((FCkW*MD[0]*1000)+(OC*MD[0]*L[0]*Y*1000))#Total chrges in Rs
OC1=(TC1/(MD[0]*L[0]*Y*1000))*100#Overall cost per kWh in paise
#b)For industrial consumers
TC2=((FCkW*MD[1]*1000)+(OC*MD[1])*L[1]*Y*1000)#Total chrges in Rs
OC2=(TC2/(MD[1]*L[1]*Y*1000))*100#Overall cost per kWh in paise
#c) For street-lighting load
TC3=((FCkW*MD[2]*1000)+(OC*MD[2])*L[2]*Y*1000)#Total chrges in Rs
OC3=(TC3/(MD[2]*L[2]*Y*1000))*100#Overall cost per kWh in paise
#Output
print "Overall cost of energy per kWh for:\n(a)Domestic consumers is %3.0f paise\n(b)Industrial consumers is %3.0f paise\n(c)Street-lighting load is %3.0f paise"%(OC1,OC2,OC3)
```

In [20]:

```
#Input data
CC=(80*10**6)#Capital cost in Rs
L=30#Useful life in years
S=5#Salvage value of the capital cost in percent
i=0.06#Yearly rate of compound interest
#Calculations
A=((100-S)/100)*CC#Difference of capital cost and salvage value in Rs
P=((A*i)/((1+i)**L-1))#The amount of money to be saved annually in Rs
#Output
print "The amount of money to be saved annually is Rs.%3.0f/-"%(P)
```

In [22]:

```
#Input data
i=4000#Initial investment in Rs crore
Y=4#Period in years
A=1200#Amount added in Rs crore
B=400#Amount paid from 5th year onwards to the 12th year in Rs crore
a=5#5th year
b=12#12th year
y=30#Period in years
C=600#Salvage value in Rs crore
I=0.1#Interest rate
#Calculations
X=(1/(1+I))#X value for calculations
PW=(i+(A*X**Y)+((B/I)*X**b*((I+1)**b-1))-((B/I)*X**a*((I+1)**a-1))-(C*X**y))#Present worth of the payments at the time of commissioning in Rs. crores
#Output
print "Present worth of the payments at the time of commissioning is Rs.%3.2f crores"%(PW)
```

In [25]:

```
#Input data
O=1000#Combined output of two units in MW
#Two coal generating units P and Q have the incremental heat rate defined by
#(IR)P=0.4818*10**-7.LP**4 - 0.9089*10**-4.LP**3 + 0.6842*10**-1.LP**2 - 0.2106*10.LP + 9860
#(IR)R=0.9592*10**-7.LQ**4 - 0.7811*10**-4.LQ**3 + 0.2625*10**-1.LQ**2 - 0.2189*10.LQ + 9003
#Calculations
#LP+LQ=1000
#By making (IR)P=(IR)Q and solving the above three equations by a numerical methos such as Newton-Raphson algorithm, we get
LP=732.5#Heat rate in MW
LQ=(O-LP)#Heat rate in MW
IR=0.4818*10**-7*LP**4 - 0.9089*10**-4*LP**3 + 0.6842*10**-1*LP**2 - 0.2106*100*LP + 9860
IR1=0.9592*10**-7*LQ**4 - 0.7811*10**-4*LQ**3 + 0.2625*10**-1*LQ**2 - 0.2189*10*LQ + 9003
#Output
print "Incremental heat transfer rate at which the combined output of the two units is %3.0f MW is IR = (IR)P = (IR)Q = %d kJ/kWh"%(O,IR)
```

In [26]:

```
#Input data
F=2700#Fixed cost of the thermal station per kW of installed capacity per year in Rs,
FO=40#Fuel and operating costs per kWh generated in paise
L=[100,75,50,25]#Load factors
Y=8760#Number of hours in a year of 365 days
#Calculations
FC=(F/Y)*100#Fixed costs per kW per hour in paise
E1=(L[0]/100)#Energy produced in 1 hr with 1 kW plant in kWh
FOC1=(E1*FO)#Fuel and operating cost in paise
TC1=(FC+FOC1)#Total cost per hr in paise
C1=(TC1/E1)#Cost per kWh in paise
E2=(L[1]/100)#Energy produced in 1 hr with 1 kW plant in kWh
FOC2=(E2*FO)#Fuel and operating cost in paise
TC2=(FC+FOC2)#Total cost per hr in paise
C2=(TC2/E2)#Cost per kWh in paise
E3=(L[2]/100)#Energy produced in 1 hr with 1 kW plant in kWh
FOC3=(E3*FO)#Fuel and operating cost in paise
TC3=(FC+FOC3)#Total cost per hr in paise
C3=(TC3/E3)#Cost per kWh in paise
E4=(L[3]/100)#Energy produced in 1 hr with 1 kW plant in kWh
FOC4=(E4*FO)#Fuel and operating cost in paise
TC4=(FC+FOC4)#Total cost per hr in paise
C4=(TC4/E4)#Cost per kWh in paise
#Output
print "==============================================================================\nLoad Energy produced Fixed cost Fuel and Total cost Cost per\nfactor in 1hr with per hr operating cost per hr kWh\n(percent) 1kW plant(kWh) (paise) (paise) (paise) (paise)\n==============================================================================\n%3.0f %3.0f %3.0f %3.0f %3.0f %3.0f\n%3.0f %3.2f %3.0f %3.0f %3.0f %3.0f\n%3.0f %3.2f %3.0f %3.0f %3.0f %3.0f\n%3.0f %3.2f %3.0f %3.0f %3.0f %3.0f\n=============================================================================="%(L[0],E1,FC,FOC1,TC1,C1,L[1],E2,FC,FOC2,TC2,C2,L[2],E3,FC,FOC3,TC3,C3,L[3],E4,FC,FOC4,TC4,C4)
```