from __future__ import division
totpow=110*10**3 #(kW)
uc1=18000; fcr1=0.1; cf1=0.55; fuelcons1=0.7; fuelcost1=1500/1000; om1=0.2; utilizationf1=1
uc2=30000 ;fcr2=0.1; cf2=0.60 ;fuelcons2=0.65 ;fuelcost2=1500/1000 ;om2=0.15 ;utilizationf2=1
#given uck=unit capital cost k fcrk= fixed charge rate of kth unit cfk=capacity factor at k th unit omk=annual cost of operating labour totpow=total power rating of units
afc1=fcr1*uc1*totpow; afc2=fcr2*uc2*totpow
e1=8760*cf1*totpow; e2=8760*cf2*totpow
annualfuel1=e1*fuelcons1 ;annualfuel2=e2*fuelcons2
fc1=annualfuel1*fuelcost1 ;fc2=annualfuel2*fuelcost2
om11=om1*fc1; om22=om2*fc2
aoc1=fc1+om1 ;aoc2=fc2+om22
apc1=aoc1+afc1; apc2=aoc2+afc2
gc1=apc1/fc1 ;gc2=apc2/fc2
print " solution for (a)"
print " afc1=Rs.%0.2e\n e1=%0.4e kWh\n annualfual1=%0.5e kg \n fc1=Rs.%0.5e \n om1=Rs.%0.6e \n aoc1=Rs.%0.6e \n apc1=Rs.%0.5e \n gc1=%0.4f kWh\n"%(afc1,e1,annualfuel1,fc1,om11,aoc1,apc1,gc1)
print " solution for (b)"
print " afc2=Rs.%0.2e \n e2=%0.4e kWh\n annualfual2=%0.5e kg \n fc2=Rs.%d \n om22=Rs.%d \n aoc2=Rs.%.f \n apc2=Rs.%.f \n gc2=%.fkWh\n"%(afc2,e2,annualfuel2,fc2,om22,aoc2,apc2,gc1)
ogc=(apc1+apc2)/(e1+e2)
print " solution of (c)\n ogc=Rs.%0.3f/kWh"%(ogc)
# Ans in the textbook are not accurate.
c=2*10**8 #cost
s=0.15 #salvage value
ul=25 #/useful value
i=0.08 #life of plant
print "solution for (a)"
print "annual straight line depreciation reserve =Rs. %.1e per year\n"%(c*(1-s)/ul)
print "solution for (b)"
it=(i+1)**25-1
iit=i/it
asdr=c*(1-s)*iit*100
print "annual sinking fund depreciation reserve is =Rs. %.3e per year"%(asdr)
cost=2*10**8
sal=0.15
use=25
t=(1-(sal**(1/use)))
print "rate of depretion by fixed percentage method = %0.1f %%"%(t*100)
rd=cost*(1-t)**10
print "remaining depreciation at the end of 10th year = Rs.%0.3e"%(rd)
print "accumulated depreciation at the end of 10 year is Rs.%0.3e"%(cost-rd)
from __future__ import division
import numpy as np
%matplotlib inline
from matplotlib.pyplot import plot,show
p=100 #ratring of steam station
fc=3000 #fixed cost of plant per year
rg=0.9 #90 paise per kv generation
uf=1 #utilization factor 1
lf=np.arange(20,101,20) #let load factor be 5 discreate units
lm=uf*lf #lwt load MW is as same as lf as utilisation factor is 1
n=len(lm)
fc=[fc*1e5]*n
op=[rg*100]*n
negp = range(0,n)
fcgp = range(0,n)
tgc = range(0,n)
for i in range(0,n):
negp[i]=lm[i]*8760 * 1e3 # kW-hrs/year
fcgp[i]=fc[i]*10000/negp[i]* 1e2 # Paisa/unit
tgc[i]=fcgp[i]+op[i]
print "negp : ",tgc
plot(lf,tgc)
show()
print "load factor"
print lf
print "load MW\n"
#fcgp=fcgp/100 ;op=op/100; tgc=tgc/100
print "%dMW\t%dMW\t%dMW\t%dMW\t%dMW"%(lm[0],lm[1],lm[2],lm[3],lm[4])
print "fixed cost"
print "Rs%d\tRS%d\tRs%d\tRs%d\tRs%d"%(fc[0],fc[1],fc[2],fc[3],fc[4])
print "number of KW hrs of energy generated in paise per unit of energy"
print "%dkWh\t%dkWh\t%dkWh\t%dkWh\t%dkWh"%(negp[0],negp[1],negp[2],negp[3],negp[4])
print "fixed cost in paise per unit of energy"
print "Rs%.3f\tRS%.3f\tRs%.3f\tRs%.3f\tRs%.3f"%(fcgp[0],fcgp[1],fcgp[2],fcgp[3],fcgp[4])
print "operating cost in paise per unit of energy"
print "Rs%.3f\tRS%.3f\tRs%.3f\tRs%.3f\tRs%.3f"%(op[0],op[1],op[2],op[3],op[4])
print "total generation cost in paise per unit of energy"
print "Rs%.3f\tRS%.3f\tRs%.3f\tRs%.3f\tRs%.3f"%(tgc[0],tgc[1],tgc[2],tgc[3],tgc[4])
ic=120 #installed capacity
ccppkw=40000 #/capital cost of plant
iand=0.15 #interest and depreciation
fco=0.64 #fuel consumption
fc=1.5#fuel cost
oc=50*10**6 #operating cost
pl=100#peak load
lf=0.6 #load factor
al=lf*pl#avarrage load
print "average load %dMW"%(al)
eg=al*8760*10**3#energy generated
print "energy generated =%ekWhr"%(eg)
ti=ic*ccppkw #total investiment
print "total investement Rs.%e"%(ti)
ind=ti*iand*10**3#interest and depreciation
print "investement amd depression is Rs.%e"%(ind)
fcons=eg*fco #fual consumption
print "fuel consumtion is %ekgper year"%(fcons)
fcost=fcons*fc#fuel cost
aco=ti+fcost+ind+oc#annual cost
print "fuel cost Rs.%eper year \nannual plant cost Rs%eper year \ngeneration cost Rs%fper year"%(fcost,aco,aco/eg)
md=50*10**3 #maximum demand in kW
ecy=0
pst=600*md+2.5*ecy#public supply tariff equation
lfr=0.5 #load factor
rc=20*10**3 #reserve capacity
cik=30000 #capital investiment
inad=0.15 #/interest and depreciation
fuc=0.6 ;fuco=1.4; oct=0.8#fuel consumption#fuel cost#other cost
avl=md*lfr #average load
ecy=avl*8760 #energy cosumption per year
print "solution of (a)"
print " average load = %dkW \n energy consumton =%dkWh\n annual expenditure is Rs%dperyear\n"%(avl,ecy,pst)
print "(b) private steam plant"
ict=md+rc #installed capacity
caint=cik*ict #capital investiment
iande=inad*caint #interest and depreciation
fuelcon=ecy*fuc #fuel consumption
fucost=fuelcon*fuco #fuel cost
opwe=oct*ecy #other expenditure
totex=iande+fucost+opwe#total expenditure
print " installed capacity is Rs%d \n capital investiment is Rs%d \n interest and depreciation is Rs.%d \n fuel consumption is Rs.%f \n fuel cost is Rs.%f per year \n wage,repair and other expenses are Rs%f per year \n total expenditure is Rs%e per year"%(ict,caint,iande,fuelcon,fucost,opwe,totex)
md=500 #given maximum demand
lf=0.5 #load factor
hp=7200 ;he=0.36#operating cost of hydro plant
tp=3600; te=1.56 #operating cost of thermal plant
teg=md*1000*lf*8760 #total energy generated
print "total energy generated per year %2.2eW"%(teg)
t=(hp-tp)/(te-he) #time of operating useing (de/dp)
ph=md*(1-t/8760) #from triangle adf
pt=md-ph
et=pt*t*1000/2
eh=teg-et
co=hp*ph*1000+he*eh+tp*pt*1000+te*et
ogc=co/teg
print "capacity of hydro plant is %dMW \n capacity of thermal plant %dMW\n energy generatede by hydro plant %dkWh\n energy generated by thermal plant %dkWh\n over all generation cost is %.3f/kWh"%(ph,pt,eh,et,ogc)
pu=500*10**3 ; pc=2*pu #plant unit,plant capacity
land=11.865*10**9
cicost=30.135*10**9
ccost=land+cicost #capital cost =land cost+civil cost
plife=25 #plant life
ir=0.16 #interest rate
ond=1.5*10**-2 # o and mof capital cost
gr=0.5*10**-2 #grneral reserve of capital cost
calv=4158 #calorific value kj per kg
coalcost=990 #caol cost per ton
heat=2500#heat rate kcal/kWh
retur=0.08 #return
salvage=0
plf=0.69 ;auxcons=0.075 #auxiliary consumption
print "cost calculation "
print "using sinking fund depreciation"
ande=(ir/((ir+1)**(plife)-1))*100
afixcost=ccost*(ir+ond+retur+gr+(ande/100))
afcppc=afixcost/pc
print "annual depretion reserve is %fpersent \n annual fixed cost Rs%f \n annual fixed cost per Rs%dkWh"%(ande,afixcost,afcppc)
fo=(heat*coalcost)/(calv*1000)
engepc=24*365*plf
enavil=engepc*(1-auxcons)
gencost=(afcppc/enavil)+fo
print "fuel cost Rs.%f/kWh \nenergy generated per kW of plant capacity Rs.%fkWh \nenergy available bus bar %fkWh \n generation cost Rs%f perkWh"%(fo,engepc,enavil,gencost)
pco=120*10**3 #3 units of 40MW
caco=68*10**8 #6 year of consumption
inr=0.16 #intrest rate
de=2.5*10**-2 #depreciation
oanm=1.5*10**-2#OandM
ger=0.5*10**-2#general reserve
pllf=0.6 #plant load facot
aucon=0.5*10**-2 #auxiliary consumption
tac=caco*(inr+de+oanm+aucon) #/total cost
engpy=pco*pllf*24*365 #energy generatedper year
eabb=engpy*(1-ger) #energy available at bus bar
geco=tac/eabb #generation cost
print " total annual costs is Rs%e per year \n energy generated per year =%ekWh/year \n energy available at bus bar %ekWh/year \n generation cost is Rs.%fper kWh"%(tac,engpy,eabb,geco)