# Chapter 16 - Gas cycles¶

## Example 1 - Pg 330¶

In [1]:
#calculate the max. pressure, temperature and thermal efficiency
#Initalization of variables
import math
cr=9.
p1=14. #psia
t1=80.+460 #R
n=1.4
heat=800. #Btu
c=0.1715
R=53.35
J=778.
#calculations
p2=p1*math.pow(cr,n)
t2=t1*math.pow(cr,(n-1))
t3=heat/c +t2
p3=p2*t3/t2
eff=(1-1/math.pow(cr,(n-1)))*100
t4=t3/math.pow(cr,(n-1))
Qr=c*(t4-t1)
cyclework=heat-Qr
eff2= cyclework/heat *100
V1=R*t1/(144*p1)
pd=(1-1/cr)*V1
mep=cyclework*J/(pd*144)
#results
print '%s %d %s' %("Max. temperature =",t3,"R")
print '%s %d %s' %("\n Max. pressure =",p3,"psia")
print '%s %.1f %s' %("\n In method 1,Thermal efficiency =",eff," percent")
print '%s %.1f %s' %("\n In method 2,Thermal efficiency =",eff2," percent")
print '%s %.1f %s' %("\n Mean effective pressure mep =",mep," psia")

Max. temperature = 5965 R

Max. pressure = 1391 psia

In method 1,Thermal efficiency = 58.5  percent

In method 2,Thermal efficiency = 58.5  percent

Mean effective pressure mep = 199.0  psia


## Example 2 - Pg 333¶

In [2]:
#calculate the max temperature, pressure and thermal efficiency
#Initalization of variables
import math
t1=80+460. #R
p1=14. #psia
n=1.4
cr=16.
heat=800. #Btu
cp=0.24
c=0.1715
#calculations
t2=t1*math.pow(cr,(n-1))
p2=p1*math.pow(cr,n)
t3=t2 +heat/cp
v32=t3/t2
v43=cr/v32
t4=t3/math.pow(v43,(n-1))
Qr=c*(t4-t1)
etat=(heat-Qr)/heat *100
#results
print '%s %d %s' %("Max. Temperature =",t3," R")
print '%s %d %s' %("\n Max. Pressure =",p2,"psia")
print '%s %.1f %s' %("\n Thermal efficiency =",etat," percent")

Max. Temperature = 4970  R

Max. Pressure = 679 psia

Thermal efficiency = 56.8  percent


## Example 3 - Pg 335¶

In [3]:
#calculate the Mean effective pressure
#Initalization of variables
eff=0.585
heat=800. #Btu
t1=80+460. #R
p1=14. #psia
n=1.4
R=53.35
cr=9.
cp=0.24
J=778.
#calculations
W=eff*heat
v1=R*t1/(144*p1)
v2=v1/cr
t2=1301 #R
t3=t2+ heat/cp
v3=v2*t3/t2
v4=cr*v3
mep=W*J/(144*(v4-v2))
#results
print '%s %.1f %s' %("Mean effective pressure =",mep," psia")

Mean effective pressure = 51.3  psia


## Example 4 - Pg 340¶

In [4]:
#calculate the max temperature, pressure, thermal efficiency, mean effective pressure
#Initalization of variables
import math
eff=0.585
heat=500. #Btu
heat1=300. #Btu
t1=80+460. #R
p1=14. #psia
n=1.4
R=53.35
cr=9.
J=778.
c=0.1715
cp=0.24
t2=1301. #R
p2=308. #psia
#calculations
t3=t2+ heat/c
p3=p2*t3/t2
t4=t3+ heat1/cp
v43=t4/t3
v54=cr/v43
t5=t4/math.pow(v54,(n-1))
Qr=c*(t5-t1)
etat=(heat+heat1-Qr)/(heat+heat1) *100
mep=(heat+heat1-Qr)*J/(12.69*144)
#results
print '%s %d %s' %("Max. Temperature =",t4," R")
print '%s %d %s' %("\n Max. Pressure =",p3,"psia")
print '%s %.1f %s' %("\n Thermal efficiency =",etat,"percent")
print '%s %.1f %s' %("\n Mean effective pressure =",mep," psia")
print '%s' %("The calculations are a bit different due to rounding off error in textbook")

Max. Temperature = 5466  R

Max. Pressure = 998 psia

Thermal efficiency = 57.6 percent

Mean effective pressure = 196.2  psia
The calculations are a bit different due to rounding off error in textbook