# Chapter 15 - Ideal gas power cycles¶

## Example 1: pg 436¶

In :
#pg 436
print('Example 15.1');

# aim : To determine
# the thermal efficiency of the cycle

# given values
T1 = 273.+400;#  temperature limit, [K]
T3 = 273.+70;# temperature limit, [K]

#  solution
#  using equation  of section 15.3
n_the = (T1-T3)/T1*100;# thermal efficiency
#results
print ' The thermal efficiency of the cycle is (percent) = ',round(n_the)

#  End

Example 15.1
The thermal efficiency of the cycle is (percent) =  49.0


## Example 2: pg 437¶

In :
#pg 437
print('Example 15.2');

# aim : To determine
# (a) the volume ratios of the isothermal and adiabatic processes
# (b) the thermal efficiency of the cycle

# given values
T1 = 273.+260;# temperature, [K]
T3 = 273.+21;# temperature, [K]
er = 15.;# expansion ratio
Gama = 1.4;# heat capacity ratio

# solution
# (a)
T2 = T1;
T4 = T3;
# for adiabatic process
rva = (T1/T4)**(1/(Gama-1));# volume ratio of adiabatic
rvi = er/rva;# volume ratio of isothermal
print ' (a) The volume ratio of the adiabatic process is  =  ',round(rva,3)
print '      The volume ratio of the isothermal process is  = ',round(rvi,2)

# (b)
n_the = (T1-T4)/T1*100;# thermal efficiency
print ' (b) The thermal efficiency of the cycle is (percent) = ',round(n_the,1)
#  End

Example 15.2
(a) The volume ratio of the adiabatic process is  =   4.425
The volume ratio of the isothermal process is  =  3.39
(b) The thermal efficiency of the cycle is (percent) =  44.8


## Example 3: pg 438¶

In :
#pg 438
print('Example 15.3');

# aim : To determine
# (a) the pressure, volume and temperature at each corner of the cycle
# (b) the thermal efficiency of the cycle
# (c) the work done per cycle
# (d) the work ratio
from math import log
# given values
m = 1;# mass of air, [kg]
P1 = 1730.;# initial pressure of carnot engine, [kN/m^2]
T1 = 273.+300;# initial temperature, [K]
R = .29;# [kJ/kg K]
Gama = 1.4;# heat capacity ratio

# solution
# taking reference  Fig. 15.15
# (a)
# for the isothermal process 1-2
# using ideal gas law
V1 = m*R*T1/P1;# initial volume, [m^3]
T2 = T1;
V2 = 3.*V1;# given condition
# for isothermal process, P1*V1=P2*V2, so
P2 = P1*(V1/V2);# [MN/m^2]
# for the adiabatic process 2-3
V3 = 6.*V1;# given condition
T3 = T2*(V2/V3)**(Gama-1);
# also for adiabatic process, P2*V2^Gama=P3*V3^Gama, so
P3 = P2*(V2/V3)**Gama;
# for the isothermal process 3-4
T4 = T3;
# for both adiabatic processes, the temperataure ratio is same,
# T1/T4 = T2/T3=(V4/V1)^(Gama-1)=(V3/V2)^(Gama-1), so
V4 = 2*V1;
# for isothermal process, 3-4, P3*V3=P4*V4, so
P4 = P3*(V3/V4);
print '(a) At line 1'
print ' V1  = ',round(V1,3),' m^3, t1  = ',T1-273,' C,  P1  = ',P1,' kN/m^2 '

print 'At line 2'
print ' V2  = ',round(V2,3),' m^3, t2  = ',T2-273,' C,  P2  = ',round(P2,1),' kN/m^2'

print 'At line 3'
print ' V3  = ',round(V3,3),' m^3, t3  = ',round(T3-273),' C,  P3  = ',round(P3,1),' kN/m^2'

print 'At line 4'
print ' V4  = ',round(V4,3),' m^3, t4  = ',round(T4-273,1),' C,  P4  = ',round(P4,1),' kN/m^2'

# (b)
n_the = (T1-T3)/T1;# thermal efficiency
print ' (b) The thermal efficiency of the cycle (percent) = ',round(n_the*100)

# (c)
W = m*R*T1*log(V2/V1)*n_the;#  work done, [J]
print ' (c) The work done per cycle is (kJ) = ',round(W,1)

#  (d)
wr = (T1-T3)*log(V2/V1)/(T1*log(V2/V1)+(T1-T3)/(Gama-1));# work ratio
print ' (d) The work ratio is  =  ',round(wr,3)

print 'there is calculation mistake in the book so answer is not matching'

#   End

Example 15.3
(a) At line 1
V1  =  0.096  m^3, t1  =  300.0  C,  P1  =  1730.0  kN/m^2
At line 2
V2  =  0.288  m^3, t2  =  300.0  C,  P2  =  576.7  kN/m^2
At line 3
V3  =  0.576  m^3, t3  =  161.0  C,  P3  =  218.5  kN/m^2
At line 4
V4  =  0.192  m^3, t4  =  161.3  C,  P4  =  655.5  kN/m^2
(b) The thermal efficiency of the cycle (percent) =  24.0
(c) The work done per cycle is (kJ) =  44.2
(d) The work ratio is  =   0.156
there is calculation mistake in the book so answer is not matching


## Example 4: pg 446¶

In :
#pg 446
print('Example 15.4');

# aim : To determine
# (a) the pressure, volume and temperature at cycle state points
# (b) the heat received
# (c) the work done
# (d) the thermal efficiency
# (e) the carnot efficiency
# (f) the work ration
# (g) the mean effective pressure

# given values
ro = 8.;# overall volume ratio;
rv = 6.;# volume ratio of adiabatic compression
P1 = 100.;# initial pressure , [kN/m^2]
V1 = .084;# initial volume, [m^3]
T1 = 273.+28;# initial temperature, [K]
Gama = 1.4;# heat capacity ratio
cp = 1.006;# specific heat capacity, [kJ/kg K]

# solution
# taking reference  Fig. 15.18
# (a)
V2 = V1/rv;# volume at stage2, [m^3]
V4 = ro*V2;# volume at stage 4;[m^3]
# using PV^(Gama)=constant for process 1-2
P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [kN/m^2]
T2 = T1*(V1/V2)**(Gama-1);# [K]

P3 = P2;# pressure at stage 3, [kN/m^2]
V3 = V4/rv;# volume at stage 3, [m^3]
# since pressure is constant in process 2-3 , so using V/T=constant, so
T3 = T2*(V3/V2);# temperature at stage 3, [K]

# for process 1-4
T4 = T1*(V4/V1);# temperature at stage4, [K
P4 = P1;# pressure at stage4, [kN/m^2]

print ' (a)  P1  =  ',P1,' kN/m^2,    V1  = ',V1,' m^3,       t1  = ',T1-273,' C,\n      P2  =  ',round(P2),' kN/m^2,    V2  = ',V2,' m^3,      t2  = ',round(T2-273),' C,\n      P3  = ',round(P3),' kN/m^2,    V3  = ',round(V3,3),' m^3,       t3  = ',round(T3-273),' C,\n      P4  = ',P4,' kN/m^2,      V4  = ',V4,' m^3,       t4  = ',round(T4-273),' C'

# (b)
R = cp*(Gama-1)/Gama;# gas constant, [kJ/kg K]
m = P1*V1/(R*T1);# mass of gas, [kg]
Q = m*cp*(T3-T2);# heat received, [kJ]
print ' (b) The heat received is (kJ) = ',round(Q,2)

# (c)
W = P2*(V3-V2)-P1*(V4-V1)+((P3*V3-P4*V4)-(P2*V2-P1*V1))/(Gama-1);# work done, [kJ]
print ' (c) The work done is (kJ) = ',round(W,2)

#  (d)
TE = 1-T1/T2;# thermal efficiency
print ' (d) The thermal efficiency is (percent) = ',round(TE*100,1)

# (e)
CE = (T3-T1)/T3;# carnot efficiency
print ' (e) The carnot efficiency is (percent) = ',round(CE*100,1)

# (f)
PW = P2*(V3-V2)+(P3*V3-P4*V4)/(Gama-1);# positive work done, [kj]
WR = W/PW;#  work ratio
print ' (f) The work ratio is  =  ',round(WR,3)

# (g)
Pm = W/(V4-V2);# mean effective pressure, [kN/m^2]
print ' (g) The mean effective pressure is (kN/m^2) = ',round(Pm,2)

print ' there is minor variation in answer reported in the book due to rounding off error'

#  End

Example 15.4
(a)  P1  =   100.0  kN/m^2,    V1  =  0.084  m^3,       t1  =  28.0  C,
P2  =   1229.0  kN/m^2,    V2  =  0.014  m^3,      t2  =  343.0  C,
P3  =  1229.0  kN/m^2,    V3  =  0.019  m^3,       t3  =  549.0  C,
P4  =  100.0  kN/m^2,      V4  =  0.112  m^3,       t4  =  128.0  C
(b) The heat received is (kJ) =  20.07
(c) The work done is (kJ) =  10.27
(d) The thermal efficiency is (percent) =  51.2
(e) The carnot efficiency is (percent) =  63.4
(f) The work ratio is  =   0.293
(g) The mean effective pressure is (kN/m^2) =  104.77
there is minor variation in answer reported in the book due to rounding off error


## Example 5: pg 450¶

In :
#pg 450
print('Example 15.5');

# aim : To determine
# (a) the actual thermal efficiency of the turbine
# (b) the specific fuel consumption of the turbine in kg/kWh

# given values
P2_by_P1 = 8;
n_tur = .6;# ideal turbine thermal efficiency
c = 43.*10**3;# calorific value of fuel, [kJ/kg]
Gama = 1.4;# heat capacity ratio

# solution
# (a)
rv = P2_by_P1;
n_tur_ide = 1-1/(P2_by_P1)**((Gama-1)/Gama);# ideal thermal efficiency
ate = n_tur_ide*n_tur;# actual thermal efficiency
print ' (a) The actual thermal efficiency of the turbine is (percent) = ',round(ate*100,2)

# (b)
ewf = c*ate;# energy to work fuel, [kJ/kg]
kWh = 3600.;# energy equivalent ,[kJ]
sfc = kWh/ewf;# specific fuel consumption, [kg/kWh]
print ' (b) The specific fuel consumption of the turbine is (kg/kWh) = ',round(sfc,3)

#  End

Example 15.5
(a) The actual thermal efficiency of the turbine is (percent) =  26.88
(b) The specific fuel consumption of the turbine is (kg/kWh) =  0.311


## Example 6: pg 456¶

In :
#pg 456
print('Example 15.6');

# aim : To determine
# the relative efficiency of the engine
import math
# given values
d = 80;# bore, [mm]
l = 85;# stroke, [mm]
V1 = .06*10**6;# clearence volume, [mm^3]
ate = .22;# actual thermal efficiency of the engine
Gama = 1.4;# heat capacity ratio

# solution
sv = math.pi*d**2/4*l;# stroke volume, [mm^3]
V2 = sv+V1;# [mm^3]
rv = V2/V1;
ite = 1-(1/rv)**(Gama-1);# ideal thermal efficiency
re = ate/ite;# relative thermal efficiency
#results
print ' The relative efficiency of the engine is (percent) = ',round(re*100,1)

#  End

Example 15.6
The relative efficiency of the engine is (percent) =  38.8


## Example 7: pg 457¶

In :
#pg 457
print('Example 15.7');

# aim : To determine
# (a) the pressure, volume and temperature at each cycle process change points
# (b) the heat transferred to air
# (c) the heat rejected by the air
# (d) the ideal thermal efficiency
# (e) the work done
# (f) the mean effective pressure

# given values
m = 1.;# mass of air, [kg]
rv = 6.;# volume ratio of adiabatic compression
P1 = 103.;# initial pressure , [kN/m^2]
T1 = 273.+100;# initial temperature, [K]
P3 = 3450.;# maximum pressure, [kN/m^2]
Gama = 1.4;# heat capacity ratio
R = .287;# gas constant, [kJ/kg K]

# solution
# taking reference  Fig. 15.20
# (a)
# for point 1
V1 = m*R*T1/P1;# initial volume, [m^3]

# for point 2
V2 = V1/rv;# volume at point 2, [m^3]
# using PV^(Gama)=constant for process 1-2
P2 = P1*(V1/V2)**(Gama);# pressure at point 2,. [kN/m^2]
T2 = T1*(V1/V2)**(Gama-1);# temperature at point 2,[K]

# for point 3
V3 = V2;# volume at point 3, [m^3]
# since volume is constant in process 2-3 , so using P/T=constant, so
T3 = T2*(P3/P2);# temperature at stage 3, [K]

# for point 4
V4 = V1;#  volume at point 4, [m^3]
P4 = P3*(V3/V4)**Gama;# pressure at point 4, [kN/m^2]
# again  since volume is constant in process 4-1 , so using P/T=constant, so
T4 = T1*(P4/P1);# temperature at point 4, [K]

print ' (a)  P1  =  ',P1,' kN/m^2,    V1  = ',round(V1,3),' m^3,       t1  = ',T1-273,' C,\n      P2  =  ',round(P2),' kN/m^2,    V2  = ',round(V2,3),' m^3,      t2  = ',round(T2-273),' C,\n      P3  = ',round(P3),' kN/m^2,    V3  = ',round(V3,3),' m^3,       t3  = ',round(T3-273),' C,\n      P4  = ',round(P4,1),' kN/m^2,      V4  = ',round(V4,3),' m^3,       t4  = ',round(T4-273),' C'

#  (b)
cv = R/(Gama-1);#  specific heat capacity, [kJ/kg K]
Q23 = m*cv*(T3-T2);# heat transferred, [kJ]
print ' (b) The heat transferred to the air is (kJ) = ',round(Q23)

# (c)
Q34 = m*cv*(T4-T1);# heat rejected by air, [kJ]
print ' (c) The heat rejected by the air is (kJ) = ',round(Q34,1)

# (d)
TE = 1-Q34/Q23;# ideal thermal efficiency
print ' (d) The ideal thermal efficiency is (percent) = ',round(TE*100,1)

# (e)
W = Q23-Q34;# work done ,[kJ]
print ' (e) The work done  is (kJ) = ',round(W,1)
# (f)
Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]
print ' (f)  The mean effective pressure is (kN/m^2) = ',round(Pm,2)

print 'The answers are a bit different due to rounding off error in textbook'
#  End

Example 15.7
(a)  P1  =   103.0  kN/m^2,    V1  =  1.039  m^3,       t1  =  100.0  C,
P2  =   1265.0  kN/m^2,    V2  =  0.173  m^3,      t2  =  491.0  C,
P3  =  3450.0  kN/m^2,    V3  =  0.173  m^3,       t3  =  1809.0  C,
P4  =  280.8  kN/m^2,      V4  =  1.039  m^3,       t4  =  744.0  C
(b) The heat transferred to the air is (kJ) =  946.0
(c) The heat rejected by the air is (kJ) =  462.0
(d) The ideal thermal efficiency is (percent) =  51.2
(e) The work done  is (kJ) =  484.0
(f)  The mean effective pressure is (kN/m^2) =  558.85
The answers are a bit different due to rounding off error in textbook


## Example 8: pg 460¶

In :
#pg 460
print('Example 15.8');

# aim : To determine
# (a) the pressure, volume and temperature at cycle state points
# (b) the thermal efficiency
# (c) the theoretical output
# (d) the mean effective pressure
# (e) the carnot efficiency

# given values
rv = 9.;# volume ratio
P1 = 101.;# initial pressure , [kN/m^2]
V1 = .003;# initial volume, [m^3]
T1 = 273.+18;# initial temperature, [K]
P3 = 4500.;# maximum pressure, [kN/m^2]
N = 3000.;
cp = 1.006;# specific heat capacity at constant pressure, [kJ/kg K]
cv = .716;# specific heat capacity at constant volume, [kJ/kg K]

# solution
# taking reference  Fig. 15.20
# (a)
# for process 1-2
Gama = cp/cv;# heat capacity ratio
R = cp-cv;# gas constant, [kJ/kg K]
V2 = V1/rv;# volume at stage2, [m^3]
# using PV^(Gama)=constant for process 1-2
P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [kN/m^2]
T2 = T1*(V1/V2)**(Gama-1);# [K]

# for process 2-3
V3 = V2;# volume at stage 3, [m^3]
# since volume is constant in process 2-3 , so using P/T=constant, so
T3 = T2*(P3/P2);# temperature at stage 3, [K]

# for process 3-4
V4 = V1;# volume at stage 4
# using PV^(Gama)=constant for process 3-4
P4 = P3*(V3/V4)**(Gama);# pressure at stage2,. [kN/m^2]
T4 = T3*(V3/V4)**(Gama-1);# temperature at stage  4,[K]

print ' (a)  P1  =  ',P1,' kN/m^2,    V1  = ',round(V1,3),' m^3,       t1  = ',T1-273,' C,\n      P2  =  ',round(P2),' kN/m^2,    V2  = ',round(V2,3),' m^3,      t2  = ',round(T2-273),' C,\n      P3  = ',round(P3),' kN/m^2,    V3  = ',round(V3,3),' m^3,       t3  = ',round(T3-273),' C,\n      P4  = ',round(P4,1),' kN/m^2,      V4  = ',round(V4,3),' m^3,       t4  = ',round(T4-273),' C'

# (b)
TE = 1-(T4-T1)/(T3-T2);# thermal efficiency
print ' (b) The thermal efficiency is (percent) = ',round(TE*100)

# (c)
m = P1*V1/(R*T1);# mass os gas, [kg]
W = m*cv*((T3-T2)-(T4-T1));# work done, [kJ]
Wt = W*N/60;# workdone per minute, [kW]
print ' (c) The theoretical output  is (kW) = ',round(Wt,1)

# (d)
Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]
print ' (g) The mean effefctive pressure is (kN/m^2) = ',round(Pm,1)

# (e)
CE = (T3-T1)/T3;# carnot efficiency
print ' (e) The carnot efficiency is (percent) = ',CE*100

#  End

Example 15.8
(a)  P1  =   101.0  kN/m^2,    V1  =  0.003  m^3,       t1  =  18.0  C,
P2  =   2213.0  kN/m^2,    V2  =  0.0  m^3,      t2  =  436.0  C,
P3  =  4500.0  kN/m^2,    V3  =  0.0  m^3,       t3  =  1168.0  C,
P4  =  205.3  kN/m^2,      V4  =  0.003  m^3,       t4  =  319.0  C
(b) The thermal efficiency is (percent) =  59.0
(c) The theoretical output  is (kW) =  55.5
(g) The mean effefctive pressure is (kN/m^2) =  415.9
(e) The carnot efficiency is (percent) =  79.8


## Example 9: pg 467¶

In :
#pg 467
print('Example 15.9');

# aim : To determine
# (a) the pressure and temperature at cycle process change points
# (b) the work done
# (c)  the thermal efficiency
# (d)  the work ratio
# (e)  the mean effective pressure
# (f)  the carnot efficiency

# given values
rv = 16.;# volume ratio of compression
P1 = 90.;# initial pressure , [kN/m^2]
T1 = 273.+40;# initial temperature, [K]
T3 = 273.+1400;# maximum temperature, [K]
cp = 1.004;# specific heat capacity at constant pressure, [kJ/kg K]
Gama = 1.4;# heat capacoty ratio

# solution
cv = cp/Gama;# specific heat capacity at constant volume, [kJ/kg K]
R = cp-cv;# gas constant, [kJ/kg K]
# for one kg of gas
V1 = R*T1/P1;# initial volume, [m^3]
# taking reference  Fig. 15.22
# (a)
# for process 1-2
# using PV^(Gama)=constant for process 1-2
# also rv = V1/V2
P2 = P1*(rv)**(Gama);# pressure at stage2,. [kN/m^2]
T2 = T1*(rv)**(Gama-1);# temperature at stage 2, [K]

# for process 2-3
P3 = P2;# pressure at stage 3, [kN/m^2]
V2 = V1/rv;#[m^3]
# since pressure is constant in process 2-3 , so using V/T=constant, so
V3 = V2*(T3/T2);# volume at stage 3, [m^3]

# for process 1-4
V4 = V1;# [m^3]
P4 = P3*(V3/V4)**(Gama)
# since in stage 1-4 volume is constant, so P/T=constant,
T4 = T1*(P4/P1);# temperature at stage  4,[K]

print ' (a)  P1  =  ',P1,' kN/m^2,    V1  = ',round(V1,3),' m^3,       t1  = ',T1-273,' C,\n      P2  =  ',round(P2),' kN/m^2,    V2  = ',round(V2,3),' m^3,      t2  = ',round(T2-273),' C,\n      P3  = ',round(P3),' kN/m^2,    V3  = ',round(V3,3),' m^3,       t3  = ',round(T3-273),' C,\n      P4  = ',round(P4,1),' kN/m^2,      V4  = ',round(V4,3),' m^3,       t4  = ',round(T4-273),' C'

# (b)
W = cp*(T3-T2)-cv*(T4-T1);# work done, [kJ]
print ' (b) The work done is (kJ) = ',W

# (c)
TE = 1-(T4-T1)/((T3-T2)*Gama);# thermal efficiency
print ' (c) The thermal efficiency is (percent) = ',round(TE*100,1)

# (d)
PW = cp*(T3-T2)+R*(T3-T4)/(Gama-1);# positive work done
WR = W/PW;#  work ratio
print ' (d) The work ratio is  =  ',round(WR,3)

# (e)
Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]
print ' (e) The mean effefctive pressure is (kN/m^2) = ',round(Pm,1)

# (f)
CE = (T3-T1)/T3;# carnot efficiency
print ' (f) The carnot efficiency is (percent) = ',round(CE*100,1)

print 'value of t2 printed in the book is incorrect'

# End

Example 15.9
(a)  P1  =   90.0  kN/m^2,    V1  =  0.998  m^3,       t1  =  40.0  C,
P2  =   4365.0  kN/m^2,    V2  =  0.062  m^3,      t2  =  676.0  C,
P3  =  4365.0  kN/m^2,    V3  =  0.11  m^3,       t3  =  1400.0  C,
P4  =  199.1  kN/m^2,      V4  =  0.998  m^3,       t4  =  419.0  C
(b) The work done is (kJ) =  454.959974156
(c) The thermal efficiency is (percent) =  62.6
(d) The work ratio is  =   0.318
(e) The mean effefctive pressure is (kN/m^2) =  486.4
(f) The carnot efficiency is (percent) =  81.3
value of t2 printed in the book is incorrect


## Example 10: pg 470¶

In :
#pg 470
print('Example 10');

# aim : To determine
# (a) the maximum temperature attained during the cycle
# (b) the thermal efficiency of the cycle

# given value
rva  =7.5;# volume ratio of adiabatic expansion
rvc  =15.;# volume ratio of compression
P1 = 98.;# initial pressure, [kn/m^2]
T1 = 273.+44;# initial temperature, [K]
P4 = 258.;# pressure at the end of the adiabatic expansion, [kN/m^2]
Gama = 1.4;#  heat capacity  ratio

# solution
# by seeing diagram
# for process 4-1, P4/T4=P1/T1
T4 = T1*(P4/P1);# [K]
# for process 3-4
T3 = T4*(rva)**(Gama-1);
print ' (a) The maximum temperature during the cycle is (C) = ',round(T3-273,1)

# (b)

# for process 1-2,
T2 = T1*(rvc)**(Gama-1);# [K]
n_the = 1-(T4-T1)/((Gama)*(T3-T2));# thermal efficiency
print ' (b) The thermal efficiency of the cycle is (percent) = ',round(n_the*100,1)

#  End

Example 10
(a) The maximum temperature during the cycle is (C) =  1595.4
(b) The thermal efficiency of the cycle is (percent) =  60.3


## Example 11: pg 471¶

In :
#pg 471
print('Example 15.11');

# aim : To determine
# (a) the thermal efficiency of the cycle
# (b) the indicared power of the cycle

# given values
# taking basis one second
rv = 11.;# volume ratio
P1 = 96.;# initial pressure , [kN/m^2]
T1 = 273.+18;# initial temperature, [K]
Gama = 1.4;# heat capacity ratio

# solution
# taking reference  Fig. 15.24
# (a)
Beta = 2;# ratio of V3 and V2
TE = 1-(Beta**(Gama)-1)/((rv**(Gama-1))*Gama*(Beta-1));# thermal efficiency
print ' (a) the thermal efficiency of the cycle is (percent) = ',round(TE*100,1)

# (b)
# let V1-V2=.05, so
V2 = .05*.1;# [m^3]
# from this
V1 = rv*V2;# [m^3]
V3 = Beta*V2;# [m^3]
V4 = V1;# [m^3]
P2 = P1*(V1/V2)**(Gama);# [kN/m^2]
P3 = P2;# [kn/m^2]
P4=P3*(V3/V4)**(Gama);# [kN/m^2]
# indicated power
W = P2*(V3-V2)+((P3*V3-P4*V4)-(P2*V2-P1*V1))/(Gama-1);# indicated power, [kW]
print ' (c) The indicated power of the cycle is (kW) = ',round(W,2)

#  End

Example 15.11
(a) the thermal efficiency of the cycle is (percent) =  55.1
(c) The indicated power of the cycle is (kW) =  26.59


## Example 12: pg 477¶

In :
#pg 477
print('Example 15.12');
# aim : To determine
# (a) the pressure and temperature at the end of compression
# (b) the pressure and temperature at the end of the constant volume process
# (c) the temperature at the end of constant pressure process

# given values
P1 = 103.;# initial pressure, [kN/m^2]
T1 = 273.+22;# initial temperature, [K]
rv = 16.;# volume ratio of the compression
Q = 244.;#heat added, [kJ/kg]
Gama = 1.4;# heat capacity ratio
cv = .717;# heat capacity, [kJ/kg k]

# solution
#  taking reference as Fig.15.26
# (a)
# for compression
# rv = V1/V2
P2 = P1*(rv)**Gama;# pressure at end of compression, [kN/m^2]
T2 = T1*(rv)**(Gama-1);# temperature at end of compression, [K]
print ' (a) The pressure at the end of compression is (MN/m^2) = ',round(P2*10**-3)
print '      The temperature at the end of compression is (C) = ',round(T2-273)

# (b)
# for constant volume process,
# Q = cv*(T3-T2), so
T3 = T2+Q/cv;# temperature at the end of constant volume, [K]

# so for constant volume, P/T=constant, hence
P3 = P2*(T3/T2);# pressure at the end of constant volume process, [kN/m^2]
print ' (b) The pressure at the end of constant volume process is  (MN/m^2) = ',round(P3*10**-3,1)
print '     The temperature at the end of constant volume process is (C) = ',round(T3-273)

# (c)
S = rv-1;# stroke
# assuming
V3 = 1;# [volume]
#so
V4 = V3+S*.03;# [volume]
# also for constant process V/T=constant, hence
T4 = T3*(V4/V3);# temperature at the end of constant presure process, [k]
print ' (c) The temperature at the end of constant pressure process is (C) = ',round(T4-273)

#  End

Example 15.12
(a) The pressure at the end of compression is (MN/m^2) =  5.0
The temperature at the end of compression is (C) =  621.0
(b) The pressure at the end of constant volume process is  (MN/m^2) =  6.9
The temperature at the end of constant volume process is (C) =  962.0
(c) The temperature at the end of constant pressure process is (C) =  1517.0


## Example 13: pg 479¶

In :
#pg 479
print('Example 15.13');

# aim : To determine
# (a) the pressure, volume and temperature at cycle process change points
# (b) the net work done
# (c)  the thermal efficiency
# (d) the heat received
# (e)  the work ratio
# (f)  the mean effective pressure
# (g)  the carnot efficiency

# given values
rv = 15.;# volume ratio
P1 = 97.*10**-3;# initial pressure , [MN/m^2]
V1 = .084;# initial volume, [m^3]
T1 = 273.+28;# initial temperature, [K]
T4 = 273.+1320;# maximum temperature, [K]
P3 = 6.2;# maximum pressure, [MN/m^2]
cp = 1.005;# specific heat capacity at constant pressure, [kJ/kg K]
cv = .717;# specific heat capacity at constant volume, [kJ/kg K]

# solution
# taking reference  Fig. 15.27
# (a)
R = cp-cv;# gas constant, [kJ/kg K]
Gama = cp/cv;# heat capacity ratio
# for process 1-2
V2 = V1/rv;# volume at stage2, [m^3]
# using PV^(Gama)=constant for process 1-2
P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [MN/m^2]
T2 = T1*(V1/V2)**(Gama-1);# temperature at stage 2, [K]

# for process 2-3
# since volumee is constant in process 2-3 , so using P/T=constant, so
T3 = T2*(P3/P2);# volume at stage 3, [K]
V3 = V2;# volume at stage 3, [MN/m^2]

# for process 3-4
P4 = P3;# pressure at stage 4, [m^3]
# since in stage 3-4 P is constant, so V/T=constant,
V4 = V3*(T4/T3);# temperature at stage  4,[K]

# for process 4-5
V5 = V1;# volume at stage 5, [m^3]
P5 = P4*(V4/V5)**(Gama);# pressure at stage5,. [MN/m^2]
T5 = T4*(V4/V5)**(Gama-1);# temperature at stage 5, [K]

print ' (a)  P1  =  ',P1,' kN/m^2,    V1  = ',round(V1,3),' m^3,       t1  = ',T1-273,' C,\n      P2  =  ',round(P2),' kN/m^2,    V2  = ',round(V2,6),' m^3,      t2  = ',round(T2-273),' C,\n      P3  = ',round(P3),' kN/m^2,    V3  = ',round(V3,6),' m^3,       t3  = ',round(T3-273),' C,\n      P4  = ',round(P4,1),' kN/m^2,      V4  = ',round(V4,6),' m^3,       t4  = ',round(T4-273),' C   \n P5  = ',round(P5,1),' kN/m^2,      V5  = ',round(V5,3),' m^3,       t5  = ',round(T5-273),' C'

# (b)
W = (P3*(V4-V3)+((P4*V4-P5*V5)-(P2*V2-P1*V1))/(Gama-1))*10**3;# work done, [kJ]
print ' (b) The net work done is (kJ) = ',round(W,1)

# (c)
TE = 1-(T5-T1)/((T3-T2)+Gama*(T4-T3));# thermal efficiency
print ' (c) The thermal efficiency is (percent) = ',round(TE*100,1)

# (d)
Q = W/TE;# heat received, [kJ]
print ' (d) The heat received is (kJ) = ',round(Q,1)

# (e)
PW = P3*(V4-V3)+(P4*V4-P5*V5)/(Gama-1)
WR = W*10**-3/PW;#  work ratio
print ' (f) The work ratio is  = ',round(WR,3)

# (e)
Pm = W/(V1-V2);# mean effective pressure, [kN/m^2]
print ' (e) The mean effective pressure is (kN/m^2) = ',round(Pm,1)

# (f)
CE = (T4-T1)/T4;# carnot efficiency
print ' (f) The carnot efficiency is (percent) = ',round(CE*100)

#  End

Example 15.13
(a)  P1  =   0.097  kN/m^2,    V1  =  0.084  m^3,       t1  =  28.0  C,
P2  =   4.0  kN/m^2,    V2  =  0.0056  m^3,      t2  =  620.0  C,
P3  =  6.0  kN/m^2,    V3  =  0.0056  m^3,       t3  =  1010.0  C,
P4  =  6.2  kN/m^2,      V4  =  0.006955  m^3,       t4  =  1320.0  C
P5  =  0.2  kN/m^2,      V5  =  0.084  m^3,       t5  =  313.0  C
(b) The net work done is (kJ) =  36.4
(c) The thermal efficiency is (percent) =  65.5
(d) The heat received is (kJ) =  55.6
(f) The work ratio is  =  0.477
(e) The mean effective pressure is (kN/m^2) =  464.0
(f) The carnot efficiency is (percent) =  81.0


## Example 14: pg 487¶

In :
#pg 487
print('Example 15.14');

# aim : To determine
# (a)  the thermal efficiency
# (b)  the heat received
# (c) the heat rejected
# (d) the net work
# (e)  the work ratio
# (f)  the mean effective pressure
# (g)  the carnot efficiency

# given values
P1 = 101.;# initial pressure , [kN/m**2]
V1 = 14.*10**-3;# initial volume, [m**3]
T1 = 273.+15;# initial temperature, [K]
P3 = 1850.;# maximum pressure, [kN/m**2]
V2 = 2.8*10**-3;# compressed volume, [m**3]
Gama = 1.4;# heat capacity
R = .29;# gas constant, [kJ/kg k]

# solution
# taking reference  Fig. 15.29
# (a)
# for process 1-2
# using PV**(Gama)=constant for process 1-2
P2 = P1*(V1/V2)**(Gama);# pressure at stage2,. [MN/m**2]
T2 = T1*(V1/V2)**(Gama-1);# temperature at stage 2, [K]

# for process 2-3
# since volumee is constant in process 2-3 , so using P/T=constant, so
T3 = T2*(P3/P2);# volume at stage 3, [K]

# for process 3-4
P4 = P1;
T4 = T3*(P4/P3)**((Gama-1)/Gama);# temperature

TE = 1-Gama*(T4-T1)/(T3-T2);# thermal efficiency
print ' (a) The thermal efficiency is (percent) = ',round(TE*100,1)

# (b)
cv = R/(Gama-1);# heat capacity at copnstant volume, [kJ/kg k]
m = P1*V1/(R*T1);# mass of gas, [kg]
Q1 = m*cv*(T3-T2);# heat received, [kJ/cycle]
print ' (b) The heat received is (kJ/cycle) = ',round(Q1,2)

# (c)
cp = Gama*cv;# heat capacity at constant at constant pressure, [kJ/kg K]
Q2 = m*cp*(T4-T1);# heat rejected, [kJ/cycle]
print ' (c) The heat rejected is (kJ/cycle) = ',round(Q2,2)

# (d)
W = Q1-Q2;# net work , [kJ/cycle]
print ' (d) The net work is (kJ/cycle) = ',round(W,2)

# (e)
# pressure is constant for process 1-4, so V/T=constant
V4 = V1*(T4/T1);# volume, [m**3]
V3 = V2;# for process 2-3
P4 = P1;# for process 1-4
PW = (P3*V3-P1*V1)/(Gama-1);# positive work done, [kJ/cycle]
WR = W/PW;#  work ratio
print ' (e) The work ratio is  =  ',round(WR,3)

# (f)
Pm = W/(V4-V2);# mean effective pressure, [kN/m**2]
print ' (f) The mean effefctive pressure is (kN/m^2) = ',round(Pm,2)

# (g)
CE = (T3-T1)/T3;# carnot efficiency
print ' (g) The carnot efficiency is (percent) = ',round(CE*100,1)

print 'there is minor variation in answer reported in the book due to rounding off error'

#  End

Example 15.14
(a) The thermal efficiency is (percent) =  52.6
(b) The heat received is (kJ/cycle) =  6.22
(c) The heat rejected is (kJ/cycle) =  2.95
(d) The net work is (kJ/cycle) =  3.27
(e) The work ratio is  =   0.347
(f) The mean effefctive pressure is (kN/m^2) =  167.32
(g) The carnot efficiency is (percent) =  72.7
there is minor variation in answer reported in the book due to rounding off error


## Example 15: pg 492¶

In :
#pg 492
print('Example 15.15');

# aim : To determine
# (a) the net work done
# (b) the ideal thermal efficiency
# (c) the thermal efficiency if the process of generation is not included
from math import log
# given values
P1 = 110.;# initial pressure, [kN/m^2)
T1 = 273.+30;# initial temperature, [K]
V1 = .05;# initial volume, [m^3]
V2 = .005;# volume, [m^3]
T3 = 273.+700;# temperature, [m^3]
R = .289;# gas constant, [kJ/kg K]
cv = .718;# heat capacity, [kJ/kg K]

# solution
# (a)
m = P1*V1/(R*T1);# mass , [kg]
W = m*R*(T3-T1)*log(V1/V2);# work done, [kJ]
print ' (a) The net work done is (kJ) = ',round(W)

# (b)
n_the = (T3-T1)/T3;# ideal thermal efficiency
print ' (b) The ideal thermal efficiency is (percent) = ',round(n_the*100,1)

# (c)
V4 = V1;
V3 = V2;
T4 = T3;
T2 = T1;

Q_rej = m*cv*(T4-T1)+m*R*T1*log(V1/V2);# heat rejected
Q_rec = m*cv*(T3-T2)+m*R*T3*log(V4/V3);# heat received

n_th = (1-Q_rej/Q_rec);# thermal efficiency
print ' (c) the thermal efficiency if the process of regeneration is not included is (percent) = ',round(n_th*100,1)

#  End

Example 15.15
(a) The net work done is (kJ) =  28.0
(b) The ideal thermal efficiency is (percent) =  68.9
(c) the thermal efficiency if the process of regeneration is not included is (percent) =  39.5


## Example 16: pg 493¶

In :
#pg 493
print('Example 15.16');
from math import log
# aim : To determine
# (a) the maximum temperature
# (b) the net work done
# (c) the ideal thermal efficiency
# (d) the thermal efficiency if the process of regeneration is not included

# given values
P1 = 100.;# initial pressure, [kN/m^2)
T1 = 273.+20;# initial temperature, [K]
V1 = .08;# initial volume, [m^3]
rv = 5;# volume ratio
R = .287;# gas constant, [kJ/kg K]
cp = 1.006;# heat capacity, [kJ/kg K]
V3_by_V2 = 2;

# solution
# (a)
# using Fig.15.33
# process 1-2 is isothermal
T2 = T1;
# since process 2-3 isisobaric, so V/T=constant
T3 = T2*(V3_by_V2);# maximumtemperature, [K]
print ' (a) The maximum temperature is (C) = ',T3-273

# (b)
m = P1*V1/(R*T1);# mass , [kg]
W = m*R*(T3-T1)*log(rv);# work done, [kJ]
print ' (b) The net work done is (kJ) = ',round(W,2)

# (c)
TE = (T3-T1)/T3;# ideal thermal efficiency
print ' (c) The ideal thermal efficiency is (percent) = ',TE*100

# (d)
T4 = T3;
T2 = T1;

Q_rej = m*cp*(T4-T1)+m*R*T1*log(rv);# heat rejected
Q_rec = m*cp*(T3-T2)+m*R*T3*log(rv);# heat received

n_th = (1-Q_rej/Q_rec);# thermal efficiency
print ' (d) the thermal efficiency if the process of regeneration is not included is (percent) = ',round(n_th*100)

#  End

Example 15.16
(a) The maximum temperature is (C) =  313.0
(b) The net work done is (kJ) =  12.88
(c) The ideal thermal efficiency is (percent) =  50.0
(d) the thermal efficiency if the process of regeneration is not included is (percent) =  24.0


## Example 17: pg 495¶

In :
#pg 495
print('Example 15.17');

# aim : To determine
# (a) the net work done
# (b) thethermal efficiency
from math import log
# given values
m = 1.;# mass of air, [kg]
T1 = 273.+230;# initial temperature, [K]
P1 = 3450.;# initial pressure, [kN/m^2]
P2 = 2000.;# pressure, [kN/m^2]
P3 = 140.;# pressure, [kN/m^2]
P4 = P3;
Gama = 1.4; # heat capacity ratio
cp = 1.006;# heat capacity, [kJ/kg k]

# solution
T2 =T1;# isothermal process 1-2
# process 2-3 and 1-4 are adiabatic so
T3 = T2*(P3/P2)**((Gama-1)/Gama);# temperature, [K]
T4 = T1*(P4/P1)**((Gama-1)/Gama);# [K]
R = cp*(Gama-1)/Gama;# gas constant, [kJ/kg K]
Q1 = m*R*T1*log(P1/P2);# heat received, [kJ]
Q2 = m*cp*(T3-T4);# heat rejected

#hence
W = Q1-Q2;# work done
print ' (a) The net work done is (kJ) = ',round(W,1)

# (b)
TE = 1-Q2/Q1;# thermal efficiency
print ' (b) The thermal efficiency is (percent) = ',round(TE*100,1)

#  End

Example 15.17
(a) The net work done is (kJ) =  44.7
(b) The thermal efficiency is (percent) =  56.7


## Example 18: pg 497¶

In :
#pg 497
print('Example 15.18');

# aim : To determine
# thermal eficiency
# carnot efficiency
from math import log
# given values
rv = 5.;# volume ratio
Gama = 1.4;# heat capacity ratio

# solution
# under given condition

TE = 1-(1/Gama*(2-1/rv**(Gama-1)))/(1+2*((Gama-1)/Gama)*log(rv/2));# thermal efficiency
print ' The thermal efficiency is (percent) = ',round(TE*100)

CE = 1-1/(2*rv**(Gama-1));# carnot efficiency
print ' The carnot efficiency is  = ',round(CE*100,1)

#  End

Example 15.18
The thermal efficiency is (percent) =  31.0
The carnot efficiency is  =  73.7