#initialisation of variables
t1=523.3 #temparature under p1=40 bar in k
t2=314.5 #temparature under p2=0.80 bar in k
s4=2.797 #entropy under p1=40 bar
s1=6.070 #entropy under p1=40 bar
sf3=0.593 #entropy under p2=0.08 bar
sfg3=7.634 #entropy under p2=0.08 bar
h4=1087 #kj/kg
h1=2801 #kj/kg
hf3=174 #kj/kg under p2=0.08bar
hfg3=2402 #kj/kg under p2=0.08bar
#CALCULATIONS
eff=(t1-t2)/t1
x3=(s4-sf3)/sfg3
x2=(s1-sf3)/sfg3
h3=hf3+(x3*hfg3)
h2=hf3+(x2*hfg3)
wt=h1-h2
cw=h4-h3
wr=(wt-cw)/wt
#RESULTS
print '(a)efficiency of carnot cycle is %0.3f'%(eff)
print '\n(b)quality is %0.4f'%(x3)
print '\n(c)gross work of expansion is %0.1f'%(wt)
print '\n(d)work ratio is %0.3f'%(wr)
#initialisation of variables
v=0.1008*10**-2
p1=40 #pressure in bar
p2=0.08 #pressure in bar
wt=903.8 #kj/kg
wp=4.02 #kj/kg
h1=2801 #kj/kg
h3=174 #kj/kg
#CALCULATIONS
pw=v*(p1-p2)
wn=wt-wp
qs=h1-(h3+wp)
reff=wn/qs
wr=wn/wt
#RESULTS
print '\nrankine efficiency and work ratio is %0.3f and %0.3f'%(reff,wr)
#initialisation of variables
h3=174 #kj/kg
h4=178.02 #kj/kg
ieff=0.50 #isentropic efficiency of compression
wt=903.8 #kj/kg
feff=0.75 #furnace efficiency
ieeff=0.85#isentropic expansion efficiency
wp=4.02 #kj/kg
h1=2801 #kj/kg
#CALCULATIONS
hx=((h4-h3)/0.5)+174
wr=wp/ieff
atu=ieeff*wt
hs=h1-hx
nwo=atu-wr
eff=nwo/hs
oeff=eff*feff
wrt=nwo/atu
ssc=3600/nwo
hr=3600/oeff
#RESULTS
print 'steam and heat rates are %0.2fkg/kwh and %0.1fkj/kwh'%(ssc,hr)
#initialisation of variables
h1=3221.6 #kj/kg
s1=7.399 #kj/kgk
sf2=0.521 #kj/kgk
sfg2=7.808 #kj/kgk
hf2=152 #kj/kg
hfg2=2415 #kj/kg
t1=653 #temp in k
t2=309.2 #temp in k
v=0.1006*10**-2
p1=10 #pressure in bar
p2=0.06 #pressure in bar
h3=152 #kj/kg
x=110
y=639.7
z=610
a=2015
#CALCULATIONS
x2=(s1-sf2)/sfg2
h2=hf2+(x2*hfg2)
wo=h1-h2
hs=h1-h3
theff=wo/hs
sr1=3600/wo
ceff=(t1-t2)/t1
wp=v*(p1-p2)
h4=h3+wp
reff=(x+y)/(z+a)
sr2=3600/(x+y)
hr=3600/reff
print 'steam rate and carnot efficiency are %0.2fkg/kwh and %00.3f'%(sr1,ceff)
print '\nsteam rate and heat rate are %0.2fkg/kwh and %0.f kJ/kWh'%(sr2,hr)
#initialisation of variables
h1=3157 #kj/kg
h2=2725 #kj/kg
h3=3299 #kj/kg
h4=2257.9 #kj/kg
h5=1940.3 #kj/kg
h6=152 #kj/kg
x4=0.872
x5=0.7405
v=0.1006*10**-2 #volume
p1=100 #pressure in bar
p2=0.06 #pressure in bar
#CALCULATIONS
wp=v*(p1-p2)*100
h7=h6+wp
wt1=h1-h5
wn1=wt1-wp
qs1=h1-h7
wr1=wn1/wt1
reff=wn1/qs1
#reheat cycle
wt2=(h1-h2)+(h3-h4)
wn2=wt2-wp
wr2=wn2/wt2
qs2=h1-h7+h3-h2
teff=wn2/qs2
pd=wn2/3600
pdi=(pd-0.3352)/0.3352
df=1-pdi
#RESULTS
print 'work ratio and rakine efficiency of rankine cycle is %0.4f and %0.3f'%(wr1,reff)
print 'dryness fraction of steam is 0.872'
print '\nheat supplied is %0.2f'%(qs1)
print '\npower developed is %0.2f'%(pd)
print '\npower developed per kg of steam is %0.4f'%(pdi)
#initialisation of variables
h1=2979 #kj/kg
h2=2504.3 #kj/kg
h3=1987.4 #kj/kg
h4=152 #kj/kg
h6=561 #kj/kg
#CALCULATIONS
m=(h6-h4)/(h2-h4)
wo=(h1-h2)+(1-m)*(h2-h3)
qs=h1-h6
teff=wo/qs
ssc=3600/wo
#RESULTS
print 'work output is %0.1f kJ/kg'%(wo)
print '\nheat supplied is %0.f kJ/kg'%(qs)
print '\nthermal efficiency is %0.3f'%(teff)
print '\nspecific steam consumption is %0.2fkg/kwh'%(ssc)
#initialisation of variables
h1=3222.5 #kj/kg
h2=3127.5 #kj/kg
h3=2692.5 #kj/kg
h4=2406.7 #kj/kg
h5=360 #kj/kg
h6=360 #kj/kg
h7=584 #kj/kg
h8=962 #kj/kg
#CALCULATIONS
m1=(h8-h7)/(h2-h7)
m2=((1-m1)*(h7-h5))/(h3-h5)
wo=(h1-h2)+(1-m1)*(h2-h3)+(1-m1-m2)*(h3-h4)
qs=h1-h8
teff=wo/qs
sr=3600/wo
#RESULTS
print 'work output is %0.1f kJ/kg'%(wo)
print '\nheat supplied is %0.1f kJ/kg'%(qs)
print '\nthermal efficiency is %0.4f'%(teff)
print '\nsteam rate is %0.2f kg/kwh'%(sr)
from __future__ import division
#initialisation of variables
h1=2990 #kj/kg
h2=2710 #kj/kg
h3=2325 #kj/kg
h4=152 #kj/kg
h5=152 #kj/kg
h7=505 #kj/kg
wo=612 #kj/kg
qs=2485 #kj/kg
#CALCULATIONS
m=(h7-h4)/(h2-h4)
mph=m*30000
ip=((h1-h2)+(1-m)*(h2-h3))*(30000/3600)
teff=wo/qs
#when there is no feeding
eff=(h1-h3)/(h1-h4)
sc=(3600/(h1-h3))*ip
#RESULTS
print 'internal powers is %0.f kW'%(ip)
print '\nthermal efficiency when feeding is there is %0.4f'%(teff)
print '\nwhen there is no feed heating,thermal efficiency is %0.4f'%(eff)
print '\nsteam consumption is %0.f kg/h'%(sc)
#initialisation of variables
#for the mercury cycle
ha=360.025 #kj/kg
sa=0.50625 #kj/kgk
sfb=0.0961 #kj/kgk
sfgb=0.5334 #kj/kgk
hfb=38.05 #kj/kg
hfgb=294.02 #kj/kg
#for the steam cycle
h5=2801 #kj/kg
h3=163 #kj/kg
hb=264.2 #kj/kg
h1=2963 #kj/kg
s1=6.364 #kj/kgk
sf2=0.559 #kj/kgk
sfg2=7.715 #kj/kgk
qs=3916.2 #kj/kg
hf2=163 #kj/kg
hfg2=2409 #kj/kg
#CALCULATIONS
xb=(sa-sfb)/sfgb
hb=hfb+(xb*hfgb)
m1=(h5-h3)/(hb-hfb)
x2=(s1-sf2)/sfg2
h2=hf2+(x2*hfg2)
wn=m1*(ha-hb)+(h1-h2)
teff1=wn/qs
hx=ha-(0.8*(ha-hb))
hy=h1-(0.8*(h1-h2))
m2=(h5-h3)/(hx-hfb)
wo=m2*(ha-hx)+(h1-hy)
qs=m2*(ha-hfb)+(h1-h5)
teff2=wo/qs
#RESULTS
print 'thermal efficiency of steam cycle is %0.3f'%(teff1)
print '\nwork output of plant is %0.1f kJ/kg'%(wo)
print '\nheat supplied is %0.1f kJ/kg'%(qs)
print '\nthermal efficiency of the plant is %0.4f'%(teff2)
#initialisation of variables
ha=360.025 #kj/kg
hfb=38.05 #kj/kg
hb=264.2 #kj/kg
h1=2963 #kj/kg
h2=1974.6 #kj/kg
h3=163 #kj/kg
h4=1087 #kj/kg
h=1714 #kj/kg
#CALCULATIONS
m=h/(hb-hfb)
wo=7.58*(ha-hb)+(h1-h2)
qs=7.58*(ha-hfb)+(h4-h3)+(h1-h)
teff=(wo/qs)
#RESULTS
print 'thermal efficiency is %0.1f %%'%(teff*100.0)
#initialisation of variables
ha=359.11 #under 10 bar pressure in kj/kg
sa=0.5089 #under 10 bar pressure in kj/kgk
sfb=0.0870 #under 0.08 bar pressure in kj/kgk
sfgb=0.57 #under 0.08 bar pressure in kj/kgk
hfb=33.21 #under 0.08 bar pressure in kj/kg
hfgb=294.7 #under 0.08 bar pressure in kj/kg
h=1840.5 #kj/kg
h1=3350 #under 25 bar pressure and 723 k in kj/kg
s1=7.183 #under 25 bar pressure and 723 k in kj/kgk
sf2=0.476 #under 25 bar pressure and 723 k in kj/kgk
sfg2=7.918 #under 25 bar pressure and 723 k in kj/kgk
hf2=138 #under 25 bar pressure and 723 ki n kj/kg
hfg2=2423 #under 25 bar pressure and 723 k in kj/kg
h5=964 #kj/kg
#CALCULATIONS
xb=(sa-sfb)/(sfgb)
hb=hfb+(xb*hfgb)
m=h/(hb-hfb)
x2=(s1-sf2)/sfg2
h2=hf2+(x2*hfg2)
wo=8.47*(ha-hb)+(h1-h2)
qs=8.47*(ha-hfb)+(h5-138)+(h1-2802.5)
teff=(wo/qs)*100
#RESULTS
print 'work output is %0.1f kJ/kg of steam'%(wo) #textbook ans slightly varies
print '\nheat supplied to the plant is %0.1f kJ/kg of steam'%(qs)
print '\nthermal efficiency is %0.1f %%'%(teff)